public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [Bitcoin-development] A suggestion for reducing the size of the UTXO database
@ 2015-05-09 17:09 Jim Phillips
  2015-05-09 18:45 ` Peter Todd
                   ` (6 more replies)
  0 siblings, 7 replies; 45+ messages in thread
From: Jim Phillips @ 2015-05-09 17:09 UTC (permalink / raw)
  To: bitcoin-development

[-- Attachment #1: Type: text/plain, Size: 2877 bytes --]

Forgive me if this idea has been suggested before, but I made this
suggestion on reddit and I got some feedback recommending I also bring it
to this list -- so here goes.

I wonder if there isn't perhaps a simpler way of dealing with UTXO growth.
What if, rather than deal with the issue at the protocol level, we deal
with it at the source of the problem -- the wallets. Right now, the typical
wallet selects only the minimum number of unspent outputs when building a
transaction. The goal is to keep the transaction size to a minimum so that
the fee stays low. Consequently, lots of unspent outputs just don't get
used, and are left lying around until some point in the future.

What if we started designing wallets to consolidate unspent outputs? When
selecting unspent outputs for a transaction, rather than choosing just the
minimum number from a particular address, why not select them ALL? Take all
of the UTXOs from a particular address or wallet, send however much needs
to be spent to the payee, and send the rest back to the same address or a
change address as a single output? Through this method, we should wind up
shrinking the UTXO database over time rather than growing it with each
transaction. Obviously, as Bitcoin gains wider adoption, the UTXO database
will grow, simply because there are 7 billion people in the world, and
eventually a good percentage of them will have one or more wallets with
spendable bitcoin. But this idea could limit the growth at least.

The vast majority of users are running one of a handful of different wallet
apps: Core, Electrum; Armory; Mycelium; Breadwallet; Coinbase; Circle;
Blockchain.info; and maybe a few others. The developers of all these
wallets have a vested interest in the continued usefulness of Bitcoin, and
so should not be opposed to changing their UTXO selection algorithms to one
that reduces the UTXO database instead of growing it.

From the miners perspective, even though these types of transactions would
be larger, the fee could stay low. Miners actually benefit from them in
that it reduces the amount of storage they need to dedicate to holding the
UTXO. So miners are incentivized to mine these types of transactions with a
higher priority despite a low fee.

Relays could also get in on the action and enforce this type of behavior by
refusing to relay or deprioritizing the relay of transactions that don't
use all of the available UTXOs from the addresses used as inputs. Relays
are not only the ones who benefit the most from a reduction of the UTXO
database, they're also in the best position to promote good behavior.

--
*James G. Phillips IV*
<https://plus.google.com/u/0/113107039501292625391/posts>

*"Don't bunt. Aim out of the ball park. Aim for the company of immortals."
-- David Ogilvy*

 *This message was created with 100% recycled electrons. Please think twice
before printing.*

[-- Attachment #2: Type: text/html, Size: 3558 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 17:09 [Bitcoin-development] A suggestion for reducing the size of the UTXO database Jim Phillips
@ 2015-05-09 18:45 ` Peter Todd
  2015-05-09 19:02   ` Jim Phillips
  2015-05-09 19:00 ` Andreas Schildbach
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 45+ messages in thread
From: Peter Todd @ 2015-05-09 18:45 UTC (permalink / raw)
  To: Jim Phillips; +Cc: bitcoin-development

[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]

On Sat, May 09, 2015 at 12:09:32PM -0500, Jim Phillips wrote:
> The vast majority of users are running one of a handful of different wallet
> apps: Core, Electrum; Armory; Mycelium; Breadwallet; Coinbase; Circle;
> Blockchain.info; and maybe a few others. The developers of all these
> wallets have a vested interest in the continued usefulness of Bitcoin, and
> so should not be opposed to changing their UTXO selection algorithms to one
> that reduces the UTXO database instead of growing it.

You can't assume that UTXO growth will be driven by walles at all; the
UTXO set's global consensus functionality is incredibly useful and will
certainly be used by all manner of applications, many having nothing to
do with Bitcoin.

As one of many examples, here's a proposal - with working code - to use
the UTXO set to get consensus over TLC certificate revocations. The
author, Christopher Allen, was one of the co-authors of the SSL
standard:

https://github.com/ChristopherA/revocable-self-signed-tls-certificates-hack

There's nothing we can do to stop these kinds of usages other than
forcing users to identify themselves to get permission to use the
Bitcoin blockchain. Using the Bitcoin blockchain gives their users
significantly better security in many cases than any alternatives, so
there's strong incentives to do so. Finally, the cost many of these
alternative uses are willing to pay pre UTXO/transaction is
significantly higher than the fees many existing Bitcoin users can pay
to make transactions.

-- 
'peter'[:-1]@petertodd.org
00000000000000000e7980aab9c096c46e7f34c43a661c5cb2ea71525ebb8af7

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 650 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 17:09 [Bitcoin-development] A suggestion for reducing the size of the UTXO database Jim Phillips
  2015-05-09 18:45 ` Peter Todd
@ 2015-05-09 19:00 ` Andreas Schildbach
  2015-05-09 19:05   ` Jim Phillips
  2015-05-09 19:06   ` Pieter Wuille
       [not found] ` <3862E01F-FD0F-48F5-A6D9-F8E0FB0AB68F@newcastle.ac.uk>
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 45+ messages in thread
From: Andreas Schildbach @ 2015-05-09 19:00 UTC (permalink / raw)
  To: bitcoin-development

Actually your assumption is wrong. Bitcoin Wallet (and I think most, if
not all, other bitcoinj based wallets) picks UTXO by age, in order to
maximize priority. So it keeps the number of UTXOs low, though not as
low as if it would always pick *all* UTXOs.


On 05/09/2015 07:09 PM, Jim Phillips wrote:
> Forgive me if this idea has been suggested before, but I made this
> suggestion on reddit and I got some feedback recommending I also bring
> it to this list -- so here goes.
> 
> I wonder if there isn't perhaps a simpler way of dealing with UTXO
> growth. What if, rather than deal with the issue at the protocol level,
> we deal with it at the source of the problem -- the wallets. Right now,
> the typical wallet selects only the minimum number of unspent outputs
> when building a transaction. The goal is to keep the transaction size to
> a minimum so that the fee stays low. Consequently, lots of unspent
> outputs just don't get used, and are left lying around until some point
> in the future.
> 
> What if we started designing wallets to consolidate unspent outputs?
> When selecting unspent outputs for a transaction, rather than choosing
> just the minimum number from a particular address, why not select them
> ALL? Take all of the UTXOs from a particular address or wallet, send
> however much needs to be spent to the payee, and send the rest back to
> the same address or a change address as a single output? Through this
> method, we should wind up shrinking the UTXO database over time rather
> than growing it with each transaction. Obviously, as Bitcoin gains wider
> adoption, the UTXO database will grow, simply because there are 7
> billion people in the world, and eventually a good percentage of them
> will have one or more wallets with spendable bitcoin. But this idea
> could limit the growth at least.
> 
> The vast majority of users are running one of a handful of different
> wallet apps: Core, Electrum; Armory; Mycelium; Breadwallet; Coinbase;
> Circle; Blockchain.info; and maybe a few others. The developers of all
> these wallets have a vested interest in the continued usefulness of
> Bitcoin, and so should not be opposed to changing their UTXO selection
> algorithms to one that reduces the UTXO database instead of growing it.
> 
> From the miners perspective, even though these types of transactions
> would be larger, the fee could stay low. Miners actually benefit from
> them in that it reduces the amount of storage they need to dedicate to
> holding the UTXO. So miners are incentivized to mine these types of
> transactions with a higher priority despite a low fee.
> 
> Relays could also get in on the action and enforce this type of behavior
> by refusing to relay or deprioritizing the relay of transactions that
> don't use all of the available UTXOs from the addresses used as inputs.
> Relays are not only the ones who benefit the most from a reduction of
> the UTXO database, they're also in the best position to promote good
> behavior.
> 
> --
> *James G. Phillips
> IV* <https://plus.google.com/u/0/113107039501292625391/posts> 
> /"Don't bunt. Aim out of the ball park. Aim for the company of
> immortals." -- David Ogilvy
> /
> 
>  /This message was created with 100% recycled electrons. Please think
> twice before printing./
> 
> 
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> 
> 
> 
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
> 





^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 18:45 ` Peter Todd
@ 2015-05-09 19:02   ` Jim Phillips
  0 siblings, 0 replies; 45+ messages in thread
From: Jim Phillips @ 2015-05-09 19:02 UTC (permalink / raw)
  To: Peter Todd; +Cc: bitcoin-development

[-- Attachment #1: Type: text/plain, Size: 1741 bytes --]

On Sat, May 9, 2015 at 1:45 PM, Peter Todd <pete@petertodd•org> wrote:

> On Sat, May 09, 2015 at 12:09:32PM -0500, Jim Phillips wrote:
> > The vast majority of users are running one of a handful of different
> wallet
> > apps: Core, Electrum; Armory; Mycelium; Breadwallet; Coinbase; Circle;
> > Blockchain.info; and maybe a few others. The developers of all these
> > wallets have a vested interest in the continued usefulness of Bitcoin,
> and
> > so should not be opposed to changing their UTXO selection algorithms to
> one
> > that reduces the UTXO database instead of growing it.
>
> You can't assume that UTXO growth will be driven by walles at all; the
> UTXO set's global consensus functionality is incredibly useful and will
> certainly be used by all manner of applications, many having nothing to
> do with Bitcoin.
>

You're correct in this point. Future UTXO growth will be coming from all
directions. But I'm a believer in the idea that whatever can be done should
be done.  If we get Bitcoin devs into the mindset now that UTXOs are
expensive to those that have to store them, and that they should be good
netizens and do what they can to limit them, then hopefully that will ideal
will be passed down to future developers. I don't believe consolidating
UTXOs in the wallet is the only solution.. I just think it is a fairly easy
one to implement, and can only help the problem from getting worse in the
future.

--
*James G. Phillips IV*
<https://plus.google.com/u/0/113107039501292625391/posts>
<http://www.linkedin.com/in/ergophobe>

*"Don't bunt. Aim out of the ball park. Aim for the company of immortals."
-- David Ogilvy*

 *This message was created with 100% recycled electrons. Please think twice
before printing.*

[-- Attachment #2: Type: text/html, Size: 2805 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 19:00 ` Andreas Schildbach
@ 2015-05-09 19:05   ` Jim Phillips
  2015-05-09 19:06   ` Pieter Wuille
  1 sibling, 0 replies; 45+ messages in thread
From: Jim Phillips @ 2015-05-09 19:05 UTC (permalink / raw)
  To: Andreas Schildbach; +Cc: bitcoin-development

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

On Sat, May 9, 2015 at 2:00 PM, Andreas Schildbach <andreas@schildbach•de>
wrote:

> Actually your assumption is wrong. Bitcoin Wallet (and I think most, if
> not all, other bitcoinj based wallets) picks UTXO by age, in order to
> maximize priority. So it keeps the number of UTXOs low, though not as
> low as if it would always pick *all* UTXOs.
>
> Is it not fair to say though that UTXO database growth is not considered
when selecting the UTXOs to use? And that size of transaction is a priority
if not the top priority?

[-- Attachment #2: Type: text/html, Size: 872 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 19:00 ` Andreas Schildbach
  2015-05-09 19:05   ` Jim Phillips
@ 2015-05-09 19:06   ` Pieter Wuille
  2015-05-09 19:16     ` Jim Phillips
  1 sibling, 1 reply; 45+ messages in thread
From: Pieter Wuille @ 2015-05-09 19:06 UTC (permalink / raw)
  To: Andreas Schildbach; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 5168 bytes --]

It's a very complex trade-off, which is hard to optimize for all use cases.
Using more UTXOs requires larger transactions, and thus more fees in
general. In addition, it results in more linkage between coins/addresses
used, so lower privacy.

The only way you can guarantee an economical reason to keep the UTXO set
small is by actually having a consensus rule that punishes increasing its
size.
On May 9, 2015 12:02 PM, "Andreas Schildbach" <andreas@schildbach•de> wrote:

> Actually your assumption is wrong. Bitcoin Wallet (and I think most, if
> not all, other bitcoinj based wallets) picks UTXO by age, in order to
> maximize priority. So it keeps the number of UTXOs low, though not as
> low as if it would always pick *all* UTXOs.
>
>
> On 05/09/2015 07:09 PM, Jim Phillips wrote:
> > Forgive me if this idea has been suggested before, but I made this
> > suggestion on reddit and I got some feedback recommending I also bring
> > it to this list -- so here goes.
> >
> > I wonder if there isn't perhaps a simpler way of dealing with UTXO
> > growth. What if, rather than deal with the issue at the protocol level,
> > we deal with it at the source of the problem -- the wallets. Right now,
> > the typical wallet selects only the minimum number of unspent outputs
> > when building a transaction. The goal is to keep the transaction size to
> > a minimum so that the fee stays low. Consequently, lots of unspent
> > outputs just don't get used, and are left lying around until some point
> > in the future.
> >
> > What if we started designing wallets to consolidate unspent outputs?
> > When selecting unspent outputs for a transaction, rather than choosing
> > just the minimum number from a particular address, why not select them
> > ALL? Take all of the UTXOs from a particular address or wallet, send
> > however much needs to be spent to the payee, and send the rest back to
> > the same address or a change address as a single output? Through this
> > method, we should wind up shrinking the UTXO database over time rather
> > than growing it with each transaction. Obviously, as Bitcoin gains wider
> > adoption, the UTXO database will grow, simply because there are 7
> > billion people in the world, and eventually a good percentage of them
> > will have one or more wallets with spendable bitcoin. But this idea
> > could limit the growth at least.
> >
> > The vast majority of users are running one of a handful of different
> > wallet apps: Core, Electrum; Armory; Mycelium; Breadwallet; Coinbase;
> > Circle; Blockchain.info; and maybe a few others. The developers of all
> > these wallets have a vested interest in the continued usefulness of
> > Bitcoin, and so should not be opposed to changing their UTXO selection
> > algorithms to one that reduces the UTXO database instead of growing it.
> >
> > From the miners perspective, even though these types of transactions
> > would be larger, the fee could stay low. Miners actually benefit from
> > them in that it reduces the amount of storage they need to dedicate to
> > holding the UTXO. So miners are incentivized to mine these types of
> > transactions with a higher priority despite a low fee.
> >
> > Relays could also get in on the action and enforce this type of behavior
> > by refusing to relay or deprioritizing the relay of transactions that
> > don't use all of the available UTXOs from the addresses used as inputs.
> > Relays are not only the ones who benefit the most from a reduction of
> > the UTXO database, they're also in the best position to promote good
> > behavior.
> >
> > --
> > *James G. Phillips
> > IV* <https://plus.google.com/u/0/113107039501292625391/posts>
> > /"Don't bunt. Aim out of the ball park. Aim for the company of
> > immortals." -- David Ogilvy
> > /
> >
> >  /This message was created with 100% recycled electrons. Please think
> > twice before printing./
> >
> >
> >
> ------------------------------------------------------------------------------
> > One dashboard for servers and applications across Physical-Virtual-Cloud
> > Widest out-of-the-box monitoring support with 50+ applications
> > Performance metrics, stats and reports that give you Actionable Insights
> > Deep dive visibility with transaction tracing using APM Insight.
> > http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> >
> >
> >
> > _______________________________________________
> > Bitcoin-development mailing list
> > Bitcoin-development@lists•sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/bitcoin-development
> >
>
>
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>

[-- Attachment #2: Type: text/html, Size: 6530 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 19:06   ` Pieter Wuille
@ 2015-05-09 19:16     ` Jim Phillips
  2015-05-09 19:43       ` Ross Nicoll
  0 siblings, 1 reply; 45+ messages in thread
From: Jim Phillips @ 2015-05-09 19:16 UTC (permalink / raw)
  To: Pieter Wuille; +Cc: Bitcoin Dev, Andreas Schildbach

[-- Attachment #1: Type: text/plain, Size: 1325 bytes --]

On Sat, May 9, 2015 at 2:06 PM, Pieter Wuille <pieter.wuille@gmail•com>
wrote:

> It's a very complex trade-off, which is hard to optimize for all use
> cases. Using more UTXOs requires larger transactions, and thus more fees in
> general.
>
Unless the miner determines that the reduction in UTXO storage requirements
is worth the lower fee. There's no protocol level enforcement of a fee as
far as I understand it. It's enforced by the miners and their willingness
to include a transaction in a block.

> In addition, it results in more linkage between coins/addresses used, so
> lower privacy.
>
Not if you only select all the UTXOs from a single address. A wallet that
is geared more towards privacy minded individuals may want to reduce the
amount of address linkage, but a wallet geared towards the general masses
probably won't have to worry so much about that.

> The only way you can guarantee an economical reason to keep the UTXO set
> small is by actually having a consensus rule that punishes increasing its
> size.
>
There's an economical reason right now to keeping the UTXO set small. The
smaller it is, the easier it is for the individual to run a full node. The
easier it is to run a full node, the faster Bitcoin will spread to the
masses. The faster it spreads to the masses, the more valuable it becomes.

[-- Attachment #2: Type: text/html, Size: 1949 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
       [not found]     ` <8029969D-FD22-43F7-930D-CEC7A87CEAD5@newcastle.ac.uk>
@ 2015-05-09 19:28       ` Jim Phillips
  0 siblings, 0 replies; 45+ messages in thread
From: Jim Phillips @ 2015-05-09 19:28 UTC (permalink / raw)
  To: Patrick Mccorry (PGR), bitcoin-development

[-- Attachment #1: Type: text/plain, Size: 2558 bytes --]

On Sat, May 9, 2015 at 2:12 PM, Patrick Mccorry (PGR) <
patrick.mccorry@newcastle•ac.uk> wrote:

>   Not necessarily. If you want to ensure privacy, you could limit the
> selection of UTXOs to a single address, and even go so far as to send
> change back to that same address. This wouldn't be as effective as
> combining the UTXOs from multiple addresses, but it would help. The key is
> to do everything that can be done when building a transaction to ensure
> that as many inputs as possible are consolidated into as few outputs as
> possible.
>
>
>  I would agree if you have multiple utxo for a single address then it
> makes sense since there is no privacy loss. However sending the change back
> to the same address would damage privacy (Hive does this) as it is then
> obvious from looking at the transaction which output is change and which
> output is sending funds.
>

I tend to agree with you here. But the change output could just as easily
be sent to a new change address.

>  Also not everyone is concerned with their own privacy, and I'm not aware
> of any HD-wallet implementations that won't already combine inputs from
> multiple addresses within that wallet without user input.
>
>
>  For people who do not care for privacy then it would work fine. But
> adding it into the wallet as default behaviour would deter those who do
> care for privacy - and making it a customisable option just adds complexity
> for the users. Wallets do need to combine utxo at times to spend bitcoins
> which is how people can be tracked today, using the minimum set of utxo
> tries to reduce the risk.
>
> Different wallets are targeted at different demographics. Some are geared
towards more mainstream users (for whom the privacy issue is less a
concern) and some (such as DarkWallet) are geared more towards the privacy
advocates. These wallets may choose to set their defaults at oposite ends
of the spectrum as to how they choose to select and link addresses and
UTXOs, but they can all improve on their current algorithms and promote
some degree of consolidation.

>   Additionally, large wallets that have lots of addresses owned by
> multiple users like exchanges, blockchain.info, and Coinbase can
> consolidate UTXOs very effectively when building transactions
>
>
>  That's true - I'm not sure how they would feel about it though. I
> imagine they probably are already to minimise key management.
>
> That's what these discussions are for. Hopefully this thread will be seen
by developers of these wallets and give them something to consider.

>

[-- Attachment #2: Type: text/html, Size: 4200 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 19:16     ` Jim Phillips
@ 2015-05-09 19:43       ` Ross Nicoll
  0 siblings, 0 replies; 45+ messages in thread
From: Ross Nicoll @ 2015-05-09 19:43 UTC (permalink / raw)
  To: Jim Phillips, Pieter Wuille; +Cc: Bitcoin Dev, Andreas Schildbach

[-- Attachment #1: Type: text/plain, Size: 2438 bytes --]

I think potential fee subsidies for cleaning up UTXO (and/or penalties 
for creating more UTXO than you burn) are worth thinking about. As 
Gavin's post ( gavinandresen.ninja/utxo-uhoh ) indicates, UTXO cost is 
far higher than block storage, so charging differently for the in/out 
mismatches should make good economic sense.

Ross


On 09/05/2015 20:16, Jim Phillips wrote:
> On Sat, May 9, 2015 at 2:06 PM, Pieter Wuille <pieter.wuille@gmail•com 
> <mailto:pieter.wuille@gmail•com>> wrote:
>
>     It's a very complex trade-off, which is hard to optimize for all
>     use cases. Using more UTXOs requires larger transactions, and thus
>     more fees in general.
>
> Unless the miner determines that the reduction in UTXO storage 
> requirements is worth the lower fee. There's no protocol level 
> enforcement of a fee as far as I understand it. It's enforced by the 
> miners and their willingness to include a transaction in a block.
>
>     In addition, it results in more linkage between coins/addresses
>     used, so lower privacy.
>
> Not if you only select all the UTXOs from a single address. A wallet 
> that is geared more towards privacy minded individuals may want to 
> reduce the amount of address linkage, but a wallet geared towards the 
> general masses probably won't have to worry so much about that.
>
>     The only way you can guarantee an economical reason to keep the
>     UTXO set small is by actually having a consensus rule that
>     punishes increasing its size.
>
> There's an economical reason right now to keeping the UTXO set small. 
> The smaller it is, the easier it is for the individual to run a full 
> node. The easier it is to run a full node, the faster Bitcoin will 
> spread to the masses. The faster it spreads to the masses, the more 
> valuable it becomes.
>
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>
>
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development


[-- Attachment #2: Type: text/html, Size: 4553 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 17:09 [Bitcoin-development] A suggestion for reducing the size of the UTXO database Jim Phillips
                   ` (2 preceding siblings ...)
       [not found] ` <3862E01F-FD0F-48F5-A6D9-F8E0FB0AB68F@newcastle.ac.uk>
@ 2015-05-10  2:11 ` Matt Whitlock
  2015-05-10 12:11   ` Jim Phillips
  2015-05-25 18:41   ` Mike Hearn
  2015-05-10 13:35 ` Bob McElrath
                   ` (2 subsequent siblings)
  6 siblings, 2 replies; 45+ messages in thread
From: Matt Whitlock @ 2015-05-10  2:11 UTC (permalink / raw)
  To: bitcoin-development

Minimizing the number of UTXOs in a wallet is sometimes not in the best interests of the user. In fact, quite often I've wished for a configuration option like "Try to maintain _[number]_ UTXOs in the wallet." This is because I often want to make multiple spends from my wallet within one block, but spends of unconfirmed inputs are less reliable than spends of confirmed inputs, and some wallets (e.g., Andreas Schildbach's wallet) don't even allow it - you can only spend confirmed UTXOs. I can't tell you how aggravating it is to have to tell a friend, "Oh, oops, I can't pay you yet. I have to wait for the last transaction I did to confirm first." All the more aggravating because I know, if I have multiple UTXOs in my wallet, I can make multiple spends within the same block.


On Saturday, 9 May 2015, at 12:09 pm, Jim Phillips wrote:
> Forgive me if this idea has been suggested before, but I made this
> suggestion on reddit and I got some feedback recommending I also bring it
> to this list -- so here goes.
> 
> I wonder if there isn't perhaps a simpler way of dealing with UTXO growth.
> What if, rather than deal with the issue at the protocol level, we deal
> with it at the source of the problem -- the wallets. Right now, the typical
> wallet selects only the minimum number of unspent outputs when building a
> transaction. The goal is to keep the transaction size to a minimum so that
> the fee stays low. Consequently, lots of unspent outputs just don't get
> used, and are left lying around until some point in the future.
> 
> What if we started designing wallets to consolidate unspent outputs? When
> selecting unspent outputs for a transaction, rather than choosing just the
> minimum number from a particular address, why not select them ALL? Take all
> of the UTXOs from a particular address or wallet, send however much needs
> to be spent to the payee, and send the rest back to the same address or a
> change address as a single output? Through this method, we should wind up
> shrinking the UTXO database over time rather than growing it with each
> transaction. Obviously, as Bitcoin gains wider adoption, the UTXO database
> will grow, simply because there are 7 billion people in the world, and
> eventually a good percentage of them will have one or more wallets with
> spendable bitcoin. But this idea could limit the growth at least.
> 
> The vast majority of users are running one of a handful of different wallet
> apps: Core, Electrum; Armory; Mycelium; Breadwallet; Coinbase; Circle;
> Blockchain.info; and maybe a few others. The developers of all these
> wallets have a vested interest in the continued usefulness of Bitcoin, and
> so should not be opposed to changing their UTXO selection algorithms to one
> that reduces the UTXO database instead of growing it.
> 
> >From the miners perspective, even though these types of transactions would
> be larger, the fee could stay low. Miners actually benefit from them in
> that it reduces the amount of storage they need to dedicate to holding the
> UTXO. So miners are incentivized to mine these types of transactions with a
> higher priority despite a low fee.
> 
> Relays could also get in on the action and enforce this type of behavior by
> refusing to relay or deprioritizing the relay of transactions that don't
> use all of the available UTXOs from the addresses used as inputs. Relays
> are not only the ones who benefit the most from a reduction of the UTXO
> database, they're also in the best position to promote good behavior.
> 
> --
> *James G. Phillips IV*
> <https://plus.google.com/u/0/113107039501292625391/posts>
> 
> *"Don't bunt. Aim out of the ball park. Aim for the company of immortals."
> -- David Ogilvy*
> 
>  *This message was created with 100% recycled electrons. Please think twice
> before printing.*



^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-10  2:11 ` Matt Whitlock
@ 2015-05-10 12:11   ` Jim Phillips
  2015-05-25 18:41   ` Mike Hearn
  1 sibling, 0 replies; 45+ messages in thread
From: Jim Phillips @ 2015-05-10 12:11 UTC (permalink / raw)
  To: Matt Whitlock; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 4363 bytes --]

I feel your pain. I've had the same thing happen to me in the past. And I
agree it's more likely to occur with my proposed scheme but I think with HD
wallets there will still be UTXOs left unspent after most transactions
since, for privacy sake it's looking for the smallest set of addresses that
can be linked.
On May 9, 2015 9:11 PM, "Matt Whitlock" <bip@mattwhitlock•name> wrote:

> Minimizing the number of UTXOs in a wallet is sometimes not in the best
> interests of the user. In fact, quite often I've wished for a configuration
> option like "Try to maintain _[number]_ UTXOs in the wallet." This is
> because I often want to make multiple spends from my wallet within one
> block, but spends of unconfirmed inputs are less reliable than spends of
> confirmed inputs, and some wallets (e.g., Andreas Schildbach's wallet)
> don't even allow it - you can only spend confirmed UTXOs. I can't tell you
> how aggravating it is to have to tell a friend, "Oh, oops, I can't pay you
> yet. I have to wait for the last transaction I did to confirm first." All
> the more aggravating because I know, if I have multiple UTXOs in my wallet,
> I can make multiple spends within the same block.
>
>
> On Saturday, 9 May 2015, at 12:09 pm, Jim Phillips wrote:
> > Forgive me if this idea has been suggested before, but I made this
> > suggestion on reddit and I got some feedback recommending I also bring it
> > to this list -- so here goes.
> >
> > I wonder if there isn't perhaps a simpler way of dealing with UTXO
> growth.
> > What if, rather than deal with the issue at the protocol level, we deal
> > with it at the source of the problem -- the wallets. Right now, the
> typical
> > wallet selects only the minimum number of unspent outputs when building a
> > transaction. The goal is to keep the transaction size to a minimum so
> that
> > the fee stays low. Consequently, lots of unspent outputs just don't get
> > used, and are left lying around until some point in the future.
> >
> > What if we started designing wallets to consolidate unspent outputs? When
> > selecting unspent outputs for a transaction, rather than choosing just
> the
> > minimum number from a particular address, why not select them ALL? Take
> all
> > of the UTXOs from a particular address or wallet, send however much needs
> > to be spent to the payee, and send the rest back to the same address or a
> > change address as a single output? Through this method, we should wind up
> > shrinking the UTXO database over time rather than growing it with each
> > transaction. Obviously, as Bitcoin gains wider adoption, the UTXO
> database
> > will grow, simply because there are 7 billion people in the world, and
> > eventually a good percentage of them will have one or more wallets with
> > spendable bitcoin. But this idea could limit the growth at least.
> >
> > The vast majority of users are running one of a handful of different
> wallet
> > apps: Core, Electrum; Armory; Mycelium; Breadwallet; Coinbase; Circle;
> > Blockchain.info; and maybe a few others. The developers of all these
> > wallets have a vested interest in the continued usefulness of Bitcoin,
> and
> > so should not be opposed to changing their UTXO selection algorithms to
> one
> > that reduces the UTXO database instead of growing it.
> >
> > >From the miners perspective, even though these types of transactions
> would
> > be larger, the fee could stay low. Miners actually benefit from them in
> > that it reduces the amount of storage they need to dedicate to holding
> the
> > UTXO. So miners are incentivized to mine these types of transactions
> with a
> > higher priority despite a low fee.
> >
> > Relays could also get in on the action and enforce this type of behavior
> by
> > refusing to relay or deprioritizing the relay of transactions that don't
> > use all of the available UTXOs from the addresses used as inputs. Relays
> > are not only the ones who benefit the most from a reduction of the UTXO
> > database, they're also in the best position to promote good behavior.
> >
> > --
> > *James G. Phillips IV*
> > <https://plus.google.com/u/0/113107039501292625391/posts>
> >
> > *"Don't bunt. Aim out of the ball park. Aim for the company of
> immortals."
> > -- David Ogilvy*
> >
> >  *This message was created with 100% recycled electrons. Please think
> twice
> > before printing.*
>

[-- Attachment #2: Type: text/html, Size: 5062 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 17:09 [Bitcoin-development] A suggestion for reducing the size of the UTXO database Jim Phillips
                   ` (3 preceding siblings ...)
  2015-05-10  2:11 ` Matt Whitlock
@ 2015-05-10 13:35 ` Bob McElrath
  2015-05-10 14:33   ` Jeff Garzik
  2015-05-12 19:50 ` Danny Thorpe
  2015-05-25 18:44 ` Mike Hearn
  6 siblings, 1 reply; 45+ messages in thread
From: Bob McElrath @ 2015-05-10 13:35 UTC (permalink / raw)
  To: bitcoin-development


[-- Attachment #1.1: Type: text/plain, Size: 5154 bytes --]

This is my biggest headache with practical bitcoin usage. I'd love to hear it if
anyone has any clever solutions to the wallet/utxo locked problem. Spending
unconfirmed outputs really requires a different security model on the part of
the receiver than #confirmations, but isn't inherently bad if the receiver has a
better security model and knows how to compute the probability that an
unconfirmed-spend will get confirmed. Of course the bigger problem is wallet
software that refuses to spend unconfirmed outputs.

I've thought a bit about a fork/merge design: if the change were computed by the
network instead of the submitter, two transactions having the same change
address and a common input could be straightforwardly merged or split (in a
reorg), where with bitcoin currently it would be considered a double-spend.  Of
course that has big privacy implications since it directly exposes the change
address, and is a hard fork, but is much closer to what people expect of a
debit-based "account" in traditional banking.

The fact of the matter is that having numerous sequential debits on an account
is an extremely common use case, and bitcoin is obtuse in this respect.

On May 9, 2015 1:09:32 PM EDT, Jim Phillips <jim@ergophobia•org> wrote:
>Forgive me if this idea has been suggested before, but I made this
>suggestion on reddit and I got some feedback recommending I also bring
>it
>to this list -- so here goes.
>
>I wonder if there isn't perhaps a simpler way of dealing with UTXO
>growth.
>What if, rather than deal with the issue at the protocol level, we deal
>with it at the source of the problem -- the wallets. Right now, the
>typical
>wallet selects only the minimum number of unspent outputs when building
>a
>transaction. The goal is to keep the transaction size to a minimum so
>that
>the fee stays low. Consequently, lots of unspent outputs just don't get
>used, and are left lying around until some point in the future.
>
>What if we started designing wallets to consolidate unspent outputs?
>When
>selecting unspent outputs for a transaction, rather than choosing just
>the
>minimum number from a particular address, why not select them ALL? Take
>all
>of the UTXOs from a particular address or wallet, send however much
>needs
>to be spent to the payee, and send the rest back to the same address or
>a
>change address as a single output? Through this method, we should wind
>up
>shrinking the UTXO database over time rather than growing it with each
>transaction. Obviously, as Bitcoin gains wider adoption, the UTXO
>database
>will grow, simply because there are 7 billion people in the world, and
>eventually a good percentage of them will have one or more wallets with
>spendable bitcoin. But this idea could limit the growth at least.
>
>The vast majority of users are running one of a handful of different
>wallet
>apps: Core, Electrum; Armory; Mycelium; Breadwallet; Coinbase; Circle;
>Blockchain.info; and maybe a few others. The developers of all these
>wallets have a vested interest in the continued usefulness of Bitcoin,
>and
>so should not be opposed to changing their UTXO selection algorithms to
>one
>that reduces the UTXO database instead of growing it.
>
>>From the miners perspective, even though these types of transactions
>would
>be larger, the fee could stay low. Miners actually benefit from them in
>that it reduces the amount of storage they need to dedicate to holding
>the
>UTXO. So miners are incentivized to mine these types of transactions
>with a
>higher priority despite a low fee.
>
>Relays could also get in on the action and enforce this type of
>behavior by
>refusing to relay or deprioritizing the relay of transactions that
>don't
>use all of the available UTXOs from the addresses used as inputs.
>Relays
>are not only the ones who benefit the most from a reduction of the UTXO
>database, they're also in the best position to promote good behavior.
>
>--
>*James G. Phillips IV*
><https://plus.google.com/u/0/113107039501292625391/posts>
>
>*"Don't bunt. Aim out of the ball park. Aim for the company of
>immortals."
>-- David Ogilvy*
>
>*This message was created with 100% recycled electrons. Please think
>twice
>before printing.*
>
>
>!DSPAM:554e4e5450787476022393!
>
>
>------------------------------------------------------------------------
>
>------------------------------------------------------------------------------
>One dashboard for servers and applications across
>Physical-Virtual-Cloud 
>Widest out-of-the-box monitoring support with 50+ applications
>Performance metrics, stats and reports that give you Actionable
>Insights
>Deep dive visibility with transaction tracing using APM Insight.
>http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>
>!DSPAM:554e4e5450787476022393!
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Bitcoin-development mailing list
>Bitcoin-development@lists•sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>
>
>!DSPAM:554e4e5450787476022393!

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

[-- Attachment #1.2: Type: text/html, Size: 6101 bytes --]

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-10 13:35 ` Bob McElrath
@ 2015-05-10 14:33   ` Jeff Garzik
  2015-05-10 14:42     ` Bob McElrath
  0 siblings, 1 reply; 45+ messages in thread
From: Jeff Garzik @ 2015-05-10 14:33 UTC (permalink / raw)
  To: Bob McElrath, Jim Phillips; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 12181 bytes --]

This has been frequently explored on IRC.

My general conclusion is "dollar bills" - pick highly common denominations
of bitcoins.  Aggregate to obtain these denominations, but do not aggregate
further.

This permits merge avoidance (privacy++), easy coinjoin where many hide in
the noise (privacy++), wallet dust de-fragmentation, while avoiding the
over-aggregation problem where you have consolidated down to one output.

Thus a wallet would have several consolidation targets.

Another strategy is simply doubling outputs.  Say you pay 0.1 BTC to
Starbucks.  Add another 0.1 BTC output to yourself, and a final change
output.  Who can say which output goes to Starbucks?

There are many iterations and trade-offs between fragmentation and privacy.









On Sun, May 10, 2015 at 9:35 AM, Bob McElrath <bob_bitcoin@mcelrath•org>
wrote:

> This is my biggest headache with practical bitcoin usage. I'd love to hear
> it if
> anyone has any clever solutions to the wallet/utxo locked problem. Spending
> unconfirmed outputs really requires a different security model on the part
> of
> the receiver than #confirmations, but isn't inherently bad if the receiver
> has a
> better security model and knows how to compute the probability that an
> unconfirmed-spend will get confirmed. Of course the bigger problem is
> wallet
> software that refuses to spend unconfirmed outputs.
>
> I've thought a bit about a fork/merge design: if the change were computed
> by the
> network instead of the submitter, two transactions having the same change
> address and a common input could be straightforwardly merged or split (in a
> reorg), where with bitcoin currently it would be considered a
> double-spend.  Of
> course that has big privacy implications since it directly exposes the
> change
> address, and is a hard fork, but is much closer to what people expect of a
> debit-based "account" in traditional banking.
>
> The fact of the matter is that having numerous sequential debits on an
> account
> is an extremely common use case, and bitcoin is obtuse in this respect.
>
> On May 9, 2015 1:09:32 PM EDT, Jim Phillips <jim@ergophobia•org> wrote:
> >Forgive me if this idea has been suggested before, but I made this
> >suggestion on reddit and I got some feedback recommending I also bring
> >it
> >to this list -- so here goes.
> >
> >I wonder if there isn't perhaps a simpler way of dealing with UTXO
> >growth.
> >What if, rather than deal with the issue at the protocol level, we deal
> >with it at the source of the problem -- the wallets. Right now, the
> >typical
> >wallet selects only the minimum number of unspent outputs when building
> >a
> >transaction. The goal is to keep the transaction size to a minimum so
> >that
> >the fee stays low. Consequently, lots of unspent outputs just don't get
> >used, and are left lying around until some point in the future.
> >
> >What if we started designing wallets to consolidate unspent outputs?
> >When
> >selecting unspent outputs for a transaction, rather than choosing just
> >the
> >minimum number from a particular address, why not select them ALL? Take
> >all
> >of the UTXOs from a particular address or wallet, send however much
> >needs
> >to be spent to the payee, and send the rest back to the same address or
> >a
> >change address as a single output? Through this method, we should wind
> >up
> >shrinking the UTXO database over time rather than growing it with each
> >transaction. Obviously, as Bitcoin gains wider adoption, the UTXO
> >database
> >will grow, simply because there are 7 billion people in the world, and
> >eventually a good percentage of them will have one or more wallets with
> >spendable bitcoin. But this idea could limit the growth at least.
> >
> >The vast majority of users are running one of a handful of different
> >wallet
> >apps: Core, Electrum; Armory; Mycelium; Breadwallet; Coinbase; Circle;
> >Blockchain.info; and maybe a few others. The developers of all these
> >wallets have a vested interest in the continued usefulness of Bitcoin,
> >and
> >so should not be opposed to changing their UTXO selection algorithms to
> >one
> >that reduces the UTXO database instead of growing it.
> >
> >>From the miners perspective, even though these types of transactions
> >would
> >be larger, the fee could stay low. Miners actually benefit from them in
> >that it reduces the amount of storage they need to dedicate to holding
> >the
> >UTXO. So miners are incentivized to mine these types of transactions
> >with a
> >higher priority despite a low fee.
> >
> >Relays could also get in on the action and enforce this type of
> >behavior by
> >refusing to relay or deprioritizing the relay of transactions that
> >don't
> >use all of the available UTXOs from the addresses used as inputs.
> >Relays
> >are not only the ones who benefit the most from a reduction of the UTXO
> >database, they're also in the best position to promote good behavior.
> >
> >--
> >*James G. Phillips IV*
> ><https://plus.google.com/u/0/113107039501292625391/posts>
> >
> >*"Don't bunt. Aim out of the ball park. Aim for the company of
> >immortals."
> >-- David Ogilvy*
> >
> >*This message was created with 100% recycled electrons. Please think
> >twice
> >before printing.*
> >
> >
> >!DSPAM:554e4e5450787476022393!
> >
> >
> >------------------------------------------------------------------------
> >
>
> >------------------------------------------------------------------------------
> >One dashboard for servers and applications across
> >Physical-Virtual-Cloud
> >Widest out-of-the-box monitoring support with 50+ applications
> >Performance metrics, stats and reports that give you Actionable
> >Insights
> >Deep dive visibility with transaction tracing using APM Insight.
> >http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> >
> >!DSPAM:554e4e5450787476022393!
> >
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >Bitcoin-development mailing list
> >Bitcoin-development@lists•sourceforge.net
> >https://lists.sourceforge.net/lists/listinfo/bitcoin-development
> >
> >
> >!DSPAM:554e4e5450787476022393!
>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>
> This is my biggest headache with practical bitcoin usage. I'd love to hear
> it if anyone has any clever solutions to the wallet/utxo locked problem.
> Spending unconfirmed outputs really requires a different security model on
> the part of the receiver than #confirmations, but isn't inherently bad if
> the receiver has a better security model and knows how to compute the
> probability that an unconfirmed-spend will get confirmed. Of course the
> bigger problem is wallet software that refuses to spend unconfirmed outputs.
>
> I've thought a bit about a fork/merge design: if the change were computed
> by the network instead of the submitter, two transactions having the same
> change address could be straightforwardly merged or split (in a reorg). Of
> course that has big privacy implications and is pretty far from bitcoin's
> design, but is much closer to what people expect of a debit-based "account"
> in traditional banking.
>
> The fact of the matter is that having numerous sequential debits on an
> account is an extremely common use case, and bitcoin is obtuse in this
> respect.
>
> On May 9, 2015 1:09:32 PM EDT, Jim Phillips <jim@ergophobia•org> wrote:
>>
>> Forgive me if this idea has been suggested before, but I made this
>> suggestion on reddit and I got some feedback recommending I also bring it
>> to this list -- so here goes.
>>
>> I wonder if there isn't perhaps a simpler way of dealing with UTXO
>> growth. What if, rather than deal with the issue at the protocol level, we
>> deal with it at the source of the problem -- the wallets. Right now, the
>> typical wallet selects only the minimum number of unspent outputs when
>> building a transaction. The goal is to keep the transaction size to a
>> minimum so that the fee stays low. Consequently, lots of unspent outputs
>> just don't get used, and are left lying around until some point in the
>> future.
>>
>> What if we started designing wallets to consolidate unspent outputs? When
>> selecting unspent outputs for a transaction, rather than choosing just the
>> minimum number from a particular address, why not select them ALL? Take all
>> of the UTXOs from a particular address or wallet, send however much needs
>> to be spent to the payee, and send the rest back to the same address or a
>> change address as a single output? Through this method, we should wind up
>> shrinking the UTXO database over time rather than growing it with each
>> transaction. Obviously, as Bitcoin gains wider adoption, the UTXO database
>> will grow, simply because there are 7 billion people in the world, and
>> eventually a good percentage of them will have one or more wallets with
>> spendable bitcoin. But this idea could limit the growth at least.
>>
>> The vast majority of users are running one of a handful of different
>> wallet apps: Core, Electrum; Armory; Mycelium; Breadwallet; Coinbase;
>> Circle; Blockchain.info; and maybe a few others. The developers of all
>> these wallets have a vested interest in the continued usefulness of
>> Bitcoin, and so should not be opposed to changing their UTXO selection
>> algorithms to one that reduces the UTXO database instead of growing it.
>>
>> From the miners perspective, even though these types of transactions
>> would be larger, the fee could stay low. Miners actually benefit from them
>> in that it reduces the amount of storage they need to dedicate to holding
>> the UTXO. So miners are incentivized to mine these types of transactions
>> with a higher priority despite a low fee.
>>
>> Relays could also get in on the action and enforce this type of behavior
>> by refusing to relay or deprioritizing the relay of transactions that don't
>> use all of the available UTXOs from the addresses used as inputs. Relays
>> are not only the ones who benefit the most from a reduction of the UTXO
>> database, they're also in the best position to promote good behavior.
>>
>> --
>> *James G. Phillips IV*
>> <https://plus.google.com/u/0/113107039501292625391/posts>
>>
>> *"Don't bunt. Aim out of the ball park. Aim for the company of
>> immortals." -- David Ogilvy*
>>
>>  *This message was created with 100% recycled electrons. Please think
>> twice before printing.*
>>  !DSPAM:554e4e5450787476022393!
>>
>> ------------------------------
>>
>> One dashboard for servers and applications across Physical-Virtual-Cloud
>> Widest out-of-the-box monitoring support with 50+ applications
>> Performance metrics, stats and reports that give you Actionable Insights
>> Deep dive visibility with transaction tracing using APM Insight.
>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>>
>> !DSPAM:554e4e5450787476022393!
>>
>> ------------------------------
>>
>> Bitcoin-development mailing list
>> Bitcoin-development@lists•sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>>
>>
>> !DSPAM:554e4e5450787476022393!
>>
>>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAlVPXp0ACgkQjwioWRGe9K1+2ACfViY0D2ksVFe29SwhxbtmNSC3
> TQAAnRoJLI9wW3DQRPqQ7PorKxelC2S2
> =Er51
> -----END PGP SIGNATURE-----
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>
>


-- 
Jeff Garzik
Bitcoin core developer and open source evangelist
BitPay, Inc.      https://bitpay.com/

[-- Attachment #2: Type: text/html, Size: 15471 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-10 14:33   ` Jeff Garzik
@ 2015-05-10 14:42     ` Bob McElrath
  0 siblings, 0 replies; 45+ messages in thread
From: Bob McElrath @ 2015-05-10 14:42 UTC (permalink / raw)
  To: Bitcoin Dev

That's a lot of work, a lot of extra utxo's, and a lot of blockchain spam, just
so I can do a convoluted form of arithmetic on my balance.

If a tx contained an explicit miner fee and a change address, but did not
compute the change, letting the network compute it (and therefore merge
transactions spending the same utxo), could one add some form of ring signature
a la Dash to alleviate the worsened privacy implications?

Jeff Garzik [jgarzik@bitpay•com] wrote:
> This has been frequently explored on IRC.
> 
> My general conclusion is "dollar bills" - pick highly common denominations of
> bitcoins.  Aggregate to obtain these denominations, but do not aggregate
> further.
> 
> This permits merge avoidance (privacy++), easy coinjoin where many hide in the
> noise (privacy++), wallet dust de-fragmentation, while avoiding the
> over-aggregation problem where you have consolidated down to one output.
> 
> Thus a wallet would have several consolidation targets.
> 
> Another strategy is simply doubling outputs.  Say you pay 0.1 BTC to
> Starbucks.  Add another 0.1 BTC output to yourself, and a final change output. 
> Who can say which output goes to Starbucks?
> 
> There are many iterations and trade-offs between fragmentation and privacy.



--
Cheers, Bob McElrath

"The individual has always had to struggle to keep from being overwhelmed by
the tribe.  If you try it, you will be lonely often, and sometimes frightened.
But no price is too high to pay for the privilege of owning yourself." 
    -- Friedrich Nietzsche



^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 17:09 [Bitcoin-development] A suggestion for reducing the size of the UTXO database Jim Phillips
                   ` (4 preceding siblings ...)
  2015-05-10 13:35 ` Bob McElrath
@ 2015-05-12 19:50 ` Danny Thorpe
  2015-05-25 18:44 ` Mike Hearn
  6 siblings, 0 replies; 45+ messages in thread
From: Danny Thorpe @ 2015-05-12 19:50 UTC (permalink / raw)
  To: Jim Phillips; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 4951 bytes --]

Having thousands of utxos floating around for a single address is clearly a
bad thing - it creates a lot of memory load on bitcoin nodes.

However, having only one utxo for an address is also a bad thing, for
concurrent operations.

Having "several" utxos available to spend is good for parallelism, so that
2 or more tasks which are spending from the same address don't have to line
up single file waiting for one of the tasks to publish a tx first so that
the next task can spend the (unconfirmed) change output of the first.
Requiring/Forcing/Having a single output carry the entire balance of an
address does not work at scale. (Yes, this presumes that the tasks are
coordinated so that they don't attempt to spend the same outputs. Internal
coordination is solvable.)

In multiple replies, you push for having "all" utxos of an address spent in
one transaction.  Why all?  If the objective is to reduce the size of the
utxo pool, it would be sufficient simply to recommend that wallets and
other spenders consume more utxos than they create, on average.

I'm ok with "consume more utxos than you generate" as a good citizen / best
practices recommendation, but a requirement that all prior outputs must be
spent in one transaction seems excessive and impractical.

-Danny

On Sat, May 9, 2015 at 10:09 AM, Jim Phillips <jim@ergophobia•org> wrote:

> Forgive me if this idea has been suggested before, but I made this
> suggestion on reddit and I got some feedback recommending I also bring it
> to this list -- so here goes.
>
> I wonder if there isn't perhaps a simpler way of dealing with UTXO growth.
> What if, rather than deal with the issue at the protocol level, we deal
> with it at the source of the problem -- the wallets. Right now, the typical
> wallet selects only the minimum number of unspent outputs when building a
> transaction. The goal is to keep the transaction size to a minimum so that
> the fee stays low. Consequently, lots of unspent outputs just don't get
> used, and are left lying around until some point in the future.
>
> What if we started designing wallets to consolidate unspent outputs? When
> selecting unspent outputs for a transaction, rather than choosing just the
> minimum number from a particular address, why not select them ALL? Take all
> of the UTXOs from a particular address or wallet, send however much needs
> to be spent to the payee, and send the rest back to the same address or a
> change address as a single output? Through this method, we should wind up
> shrinking the UTXO database over time rather than growing it with each
> transaction. Obviously, as Bitcoin gains wider adoption, the UTXO database
> will grow, simply because there are 7 billion people in the world, and
> eventually a good percentage of them will have one or more wallets with
> spendable bitcoin. But this idea could limit the growth at least.
>
> The vast majority of users are running one of a handful of different
> wallet apps: Core, Electrum; Armory; Mycelium; Breadwallet; Coinbase;
> Circle; Blockchain.info; and maybe a few others. The developers of all
> these wallets have a vested interest in the continued usefulness of
> Bitcoin, and so should not be opposed to changing their UTXO selection
> algorithms to one that reduces the UTXO database instead of growing it.
>
> From the miners perspective, even though these types of transactions would
> be larger, the fee could stay low. Miners actually benefit from them in
> that it reduces the amount of storage they need to dedicate to holding the
> UTXO. So miners are incentivized to mine these types of transactions with a
> higher priority despite a low fee.
>
> Relays could also get in on the action and enforce this type of behavior
> by refusing to relay or deprioritizing the relay of transactions that don't
> use all of the available UTXOs from the addresses used as inputs. Relays
> are not only the ones who benefit the most from a reduction of the UTXO
> database, they're also in the best position to promote good behavior.
>
> --
> *James G. Phillips IV*
> <https://plus.google.com/u/0/113107039501292625391/posts>
>
> *"Don't bunt. Aim out of the ball park. Aim for the company of immortals."
> -- David Ogilvy*
>
>  *This message was created with 100% recycled electrons. Please think
> twice before printing.*
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>
>

[-- Attachment #2: Type: text/html, Size: 6252 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-10  2:11 ` Matt Whitlock
  2015-05-10 12:11   ` Jim Phillips
@ 2015-05-25 18:41   ` Mike Hearn
  2015-05-25 20:03     ` Matt Whitlock
  1 sibling, 1 reply; 45+ messages in thread
From: Mike Hearn @ 2015-05-25 18:41 UTC (permalink / raw)
  To: Matt Whitlock; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 695 bytes --]

>
> some wallets (e.g., Andreas Schildbach's wallet) don't even allow it - you
> can only spend confirmed UTXOs. I can't tell you how aggravating it is to
> have to tell a friend, "Oh, oops, I can't pay you yet. I have to wait for
> the last transaction I did to confirm first." All the more aggravating
> because I know, if I have multiple UTXOs in my wallet, I can make multiple
> spends within the same block.
>

Andreas' wallet hasn't done that for years. Are you repeating this from
some very old memory or do you actually see this issue in reality?

The only time you're forced to wait for confirmations is when you have an
unconfirmed inbound transaction, and thus the sender is unknown.

[-- Attachment #2: Type: text/html, Size: 968 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 17:09 [Bitcoin-development] A suggestion for reducing the size of the UTXO database Jim Phillips
                   ` (5 preceding siblings ...)
  2015-05-12 19:50 ` Danny Thorpe
@ 2015-05-25 18:44 ` Mike Hearn
  2015-05-25 21:26   ` Peter Todd
  6 siblings, 1 reply; 45+ messages in thread
From: Mike Hearn @ 2015-05-25 18:44 UTC (permalink / raw)
  To: Jim Phillips; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 1165 bytes --]

Wallets are incentivised to do a better job with defragmentation already,
as if you have lots of tiny UTXOs then your fees end up being huge when
trying to make a payment.

The reason they largely don't is just one of manpower. Nobody is working on
it.

As a wallet developer myself, one way I'd like to see this issue be fixed
by making free transactions more reliable. Then wallets can submit free
transactions to the network to consolidate UTXOs together, e.g. at night
when the user is sleeping. They would then fit into whatever space is
available in the block during periods of low demand, like on Sunday.

If we don't do this then wallets won't automatically defragment, as we'd be
unable to explain to the user why their money is slowly leaking out of
their wallet without them doing anything. Trying to explain the existing
transaction fees is hard enough already ("I thought bitcoin doesn't have
banks" etc).

There is another way:  as the fee is based on a rounded 1kb calculation, if
you go into the next fee band adding some more outputs and making a bigger
change output becomes "free" for another output or two. But wallets don't
exploit this today.

[-- Attachment #2: Type: text/html, Size: 1483 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-25 18:41   ` Mike Hearn
@ 2015-05-25 20:03     ` Matt Whitlock
  2015-05-25 20:29       ` Andreas Schildbach
  2015-05-25 21:12       ` Mike Hearn
  0 siblings, 2 replies; 45+ messages in thread
From: Matt Whitlock @ 2015-05-25 20:03 UTC (permalink / raw)
  To: Mike Hearn; +Cc: Bitcoin Dev

On Monday, 25 May 2015, at 8:41 pm, Mike Hearn wrote:
> > some wallets (e.g., Andreas Schildbach's wallet) don't even allow it - you
> > can only spend confirmed UTXOs. I can't tell you how aggravating it is to
> > have to tell a friend, "Oh, oops, I can't pay you yet. I have to wait for
> > the last transaction I did to confirm first." All the more aggravating
> > because I know, if I have multiple UTXOs in my wallet, I can make multiple
> > spends within the same block.
> 
> Andreas' wallet hasn't done that for years. Are you repeating this from
> some very old memory or do you actually see this issue in reality?
> 
> The only time you're forced to wait for confirmations is when you have an
> unconfirmed inbound transaction, and thus the sender is unknown.

I see this behavior all the time. I am using the latest release, as far as I know. Version 4.30.

The same behavior occurs in the Testnet3 variant of the app. Go in there with an empty wallet and receive one payment and wait for it to confirm. Then send a payment and, before it confirms, try to send another one. The wallet won't let you send the second payment. It'll say something like, "You need x.xxxxxx more bitcoins to make this payment." But if you wait for your first payment to confirm, then you'll be able to make the second payment.

If it matters, I configure the app to connect only to my own trusted Bitcoin node, so I only ever have one active connection at most. I notice that outgoing payments never show as "Sent" until they appear in a block, presumably because the app never sees the transaction come in over any connection.



^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-25 20:03     ` Matt Whitlock
@ 2015-05-25 20:29       ` Andreas Schildbach
  2015-05-25 21:05         ` Peter Todd
  2015-05-25 21:14         ` Warren Togami Jr.
  2015-05-25 21:12       ` Mike Hearn
  1 sibling, 2 replies; 45+ messages in thread
From: Andreas Schildbach @ 2015-05-25 20:29 UTC (permalink / raw)
  To: bitcoin-development

On 05/25/2015 10:03 PM, Matt Whitlock wrote:
> On Monday, 25 May 2015, at 8:41 pm, Mike Hearn wrote:
>>> some wallets (e.g., Andreas Schildbach's wallet) don't even allow it - you
>>> can only spend confirmed UTXOs. I can't tell you how aggravating it is to
>>> have to tell a friend, "Oh, oops, I can't pay you yet. I have to wait for
>>> the last transaction I did to confirm first." All the more aggravating
>>> because I know, if I have multiple UTXOs in my wallet, I can make multiple
>>> spends within the same block.
>>
>> Andreas' wallet hasn't done that for years. Are you repeating this from
>> some very old memory or do you actually see this issue in reality?
>>
>> The only time you're forced to wait for confirmations is when you have an
>> unconfirmed inbound transaction, and thus the sender is unknown.
> 
> I see this behavior all the time. I am using the latest release, as far as I know. Version 4.30.
> 
> The same behavior occurs in the Testnet3 variant of the app. Go in there with an empty wallet and receive one payment and wait for it to confirm. Then send a payment and, before it confirms, try to send another one. The wallet won't let you send the second payment. It'll say something like, "You need x.xxxxxx more bitcoins to make this payment." But if you wait for your first payment to confirm, then you'll be able to make the second payment.
> 
> If it matters, I configure the app to connect only to my own trusted Bitcoin node, so I only ever have one active connection at most. I notice that outgoing payments never show as "Sent" until they appear in a block, presumably because the app never sees the transaction come in over any connection.

Yes, that's the issue. Because you're connecting only to one node, you
don't get any instant confirmations -- due to a Bitcoin protocol
limitation you can only get them from nodes you don't post the tx to.






^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-25 20:29       ` Andreas Schildbach
@ 2015-05-25 21:05         ` Peter Todd
  2015-05-26 12:40           ` Andreas Schildbach
  2015-05-25 21:14         ` Warren Togami Jr.
  1 sibling, 1 reply; 45+ messages in thread
From: Peter Todd @ 2015-05-25 21:05 UTC (permalink / raw)
  To: Andreas Schildbach; +Cc: bitcoin-development

[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]

On Mon, May 25, 2015 at 10:29:26PM +0200, Andreas Schildbach wrote:
> > I see this behavior all the time. I am using the latest release, as far as I know. Version 4.30.
> > 
> > The same behavior occurs in the Testnet3 variant of the app. Go in there with an empty wallet and receive one payment and wait for it to confirm. Then send a payment and, before it confirms, try to send another one. The wallet won't let you send the second payment. It'll say something like, "You need x.xxxxxx more bitcoins to make this payment." But if you wait for your first payment to confirm, then you'll be able to make the second payment.
> > 
> > If it matters, I configure the app to connect only to my own trusted Bitcoin node, so I only ever have one active connection at most. I notice that outgoing payments never show as "Sent" until they appear in a block, presumably because the app never sees the transaction come in over any connection.
> 
> Yes, that's the issue. Because you're connecting only to one node, you
> don't get any instant confirmations -- due to a Bitcoin protocol
> limitation you can only get them from nodes you don't post the tx to.

Odd, I just tried the above as well - with multiple peers connected -
and had the exact same problem.

-- 
'peter'[:-1]@petertodd.org
00000000000000000e83c311f4244e4eefb54aa845abb181e46f16d126ab21e1

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 650 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-25 20:03     ` Matt Whitlock
  2015-05-25 20:29       ` Andreas Schildbach
@ 2015-05-25 21:12       ` Mike Hearn
  1 sibling, 0 replies; 45+ messages in thread
From: Mike Hearn @ 2015-05-25 21:12 UTC (permalink / raw)
  To: Matt Whitlock; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 570 bytes --]

>
> If it matters, I configure the app to connect only to my own trusted
> Bitcoin node, so I only ever have one active connection at most.


Ah, I see, non default configuration. Because the Bitcoin network can and
does change in backwards incompatible ways, the app wants to see that the
transaction it made actually propagated across the network. If you set a
trusted node it won't see that.

Probably the logic should be tweaked so if you set a trusted node you're
just assumed to know what you're doing and we assume the transactions we
make ourselves always work.

[-- Attachment #2: Type: text/html, Size: 824 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-25 20:29       ` Andreas Schildbach
  2015-05-25 21:05         ` Peter Todd
@ 2015-05-25 21:14         ` Warren Togami Jr.
  1 sibling, 0 replies; 45+ messages in thread
From: Warren Togami Jr. @ 2015-05-25 21:14 UTC (permalink / raw)
  Cc: Bitcoin Dev

On Mon, May 25, 2015 at 1:29 PM, Andreas Schildbach
<andreas@schildbach•de> wrote:
> Yes, that's the issue. Because you're connecting only to one node, you
> don't get any instant confirmations -- due to a Bitcoin protocol
> limitation you can only get them from nodes you don't post the tx to.

Is it really wise to call this a "confirmation"?  All this is really
telling you is one seemingly random peer has relayed the transaction
back to you that you sent to a presumably different seemingly random
peer.

Warren



^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-25 18:44 ` Mike Hearn
@ 2015-05-25 21:26   ` Peter Todd
  2015-05-25 22:03     ` Mike Hearn
  0 siblings, 1 reply; 45+ messages in thread
From: Peter Todd @ 2015-05-25 21:26 UTC (permalink / raw)
  To: Mike Hearn; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]

On Mon, May 25, 2015 at 08:44:18PM +0200, Mike Hearn wrote:
> Wallets are incentivised to do a better job with defragmentation already,
> as if you have lots of tiny UTXOs then your fees end up being huge when
> trying to make a payment.
> 
> The reason they largely don't is just one of manpower. Nobody is working on
> it.
> 
> As a wallet developer myself, one way I'd like to see this issue be fixed
> by making free transactions more reliable. Then wallets can submit free
> transactions to the network to consolidate UTXOs together, e.g. at night
> when the user is sleeping. They would then fit into whatever space is
> available in the block during periods of low demand, like on Sunday.

This can cause problems as until those transactions confirm, even more
of the user's outputs are unavailable for spending, causing confusion as
to why they can't send their full balance. It's also inefficient, as in
the case where the user does try to send a small payment that could be
satisfied by one or more of these small UTXO's, the wallet has to use a
larger UTXO.

With replace-by-fee however this problem goes away, as you can simply
double-spend the pending defragmentation transactions instead if they
are still unconfirmed when you need to use them.

-- 
'peter'[:-1]@petertodd.org
00000000000000000aa9033c06c10d6131eafa3754c3157d74c2267c1dd2ca35

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 650 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-25 21:26   ` Peter Todd
@ 2015-05-25 22:03     ` Mike Hearn
  2015-05-26  0:10       ` [Bitcoin-development] Cost savings by using replace-by-fee, 30-90% Peter Todd
  0 siblings, 1 reply; 45+ messages in thread
From: Mike Hearn @ 2015-05-25 22:03 UTC (permalink / raw)
  To: Peter Todd; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 31 bytes --]

CPFP also solves it just fine.

[-- Attachment #2: Type: text/html, Size: 52 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* [Bitcoin-development]  Cost savings by using replace-by-fee, 30-90%
  2015-05-25 22:03     ` Mike Hearn
@ 2015-05-26  0:10       ` Peter Todd
  2015-05-26 18:22         ` Danny Thorpe
  2015-05-26 20:30         ` joliver
  0 siblings, 2 replies; 45+ messages in thread
From: Peter Todd @ 2015-05-26  0:10 UTC (permalink / raw)
  To: Mike Hearn; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 3521 bytes --]

On Tue, May 26, 2015 at 12:03:09AM +0200, Mike Hearn wrote:
> CPFP also solves it just fine.

CPFP is a significantly more expensive way of paying fees than RBF,
particularly for the use-case of defragmenting outputs, with cost
savings ranging from 30% to 90%


Case 1: CPFP vs. RBF for increasing the fee on a single tx
----------------------------------------------------------

Creating an spending a P2PKH output uses 34 bytes of txout, and 148
bytes of txin, 182 bytes total.

Let's suppose I have a 1 BTC P2PKH output and I want to pay 0.1 BTC to
Alice. This results in a 1in/2out transaction t1 that's 226 bytes in size.
I forget to click on the "priority fee" option, so it goes out with the
minimum fee of 2.26uBTC. Whoops! I use CPFP to spend that output,
creating a new transaction t2 that's 192 bytes in size. I want to pay
1mBTC/KB for a fast confirmation, so I'm now paying 418uBTC of
transaction fees.

On the other hand, had I use RBF, my wallet would have simply
rebroadcast t1 with the change address decreased. The rules require you
to pay 2.26uBTC for the bandwidth consumed broadcasting it, plus the new
fee level, or 218uBTC of fees in total.

Cost savings: 48%


Case 2: Paying multiple recipients in succession
------------------------------------------------

Suppose that after I pay Alice, I also decide to pay Bob for his hard
work demonstrating cryptographic protocols. I need to create a new
transaction t2 spending t1's change address. Normally t2 would be
another 226 bytes in size, resulting in 226uBTC additional fees.

With RBF on the other hand I can simply double-spend t1 with a
transaction paying both Alice and Bob. This new transaction is 260 bytes
in size. I have to pay 2.6uBTC additional fees to pay for the bandwidth
consumed broadcasting it, resulting in an additional 36uBTC of fees.

Cost savings: 84%


Case 3: Paying multiple recipients from a 2-of-3 multisig wallet
----------------------------------------------------------------

The above situation gets even worse with multisig. t1 in the multisig
case is 367 bytes; t2 another 367 bytes, costing an additional 367uBTC
in fees. With RBF we rewrite t1 with an additional output, resulting in
a 399 byte transaction, with just 36uBTC in additional fees.

Cost savings: 90%


Case 4: Dust defragmentation
----------------------------

My wallet has a two transaction outputs that it wants to combine into
one for the purpose of UTXO defragmentation. It broadcasts transaction
t1 with two inputs and one output, size 340 bytes, paying zero fees.

Prior to the transaction confirming I find I need to spend those funds
for a priority transaction at the 1mBTC/KB fee level. This transaction,
t2a, has one input and two outputs, 226 bytes in size. However it needs
to pay fees for both transactions at once, resulting in a combined total
fee of 556uBTC. If this situation happens frequently, defragmenting
UTXOs is likely to cost more in additional fees than it saves.

With RBF I'd simply doublespend t1 with a 2-in-2-out transaction 374
bytes in size, paying 374uBTC. Even better, if one of the two inputs is
sufficiently large to cover my costs I can doublespend t1 with a
1-in-2-out tx just 226 bytes in size, paying 226uBTC.

Cost savings: 32% to 59%, or even infinite if defragmentation w/o RBF
              costs you more than you save

-- 
'peter'[:-1]@petertodd.org
0000000000000000134ce6577d4122094479f548b997baf84367eaf0c190bc9f

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 650 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-25 21:05         ` Peter Todd
@ 2015-05-26 12:40           ` Andreas Schildbach
  0 siblings, 0 replies; 45+ messages in thread
From: Andreas Schildbach @ 2015-05-26 12:40 UTC (permalink / raw)
  To: bitcoin-development

On 05/25/2015 11:05 PM, Peter Todd wrote:
> On Mon, May 25, 2015 at 10:29:26PM +0200, Andreas Schildbach wrote:
>>> I see this behavior all the time. I am using the latest release, as far as I know. Version 4.30.
>>>
>>> The same behavior occurs in the Testnet3 variant of the app. Go in there with an empty wallet and receive one payment and wait for it to confirm. Then send a payment and, before it confirms, try to send another one. The wallet won't let you send the second payment. It'll say something like, "You need x.xxxxxx more bitcoins to make this payment." But if you wait for your first payment to confirm, then you'll be able to make the second payment.
>>>
>>> If it matters, I configure the app to connect only to my own trusted Bitcoin node, so I only ever have one active connection at most. I notice that outgoing payments never show as "Sent" until they appear in a block, presumably because the app never sees the transaction come in over any connection.
>>
>> Yes, that's the issue. Because you're connecting only to one node, you
>> don't get any instant confirmations -- due to a Bitcoin protocol
>> limitation you can only get them from nodes you don't post the tx to.
> 
> Odd, I just tried the above as well - with multiple peers connected -
> and had the exact same problem.

It should work, I'm testing this regularly. Can you report an issue
through the app and attach your log when this happens again?





^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] Cost savings by using replace-by-fee, 30-90%
  2015-05-26  0:10       ` [Bitcoin-development] Cost savings by using replace-by-fee, 30-90% Peter Todd
@ 2015-05-26 18:22         ` Danny Thorpe
  2015-05-26 18:38           ` Allen Piscitello
                             ` (3 more replies)
  2015-05-26 20:30         ` joliver
  1 sibling, 4 replies; 45+ messages in thread
From: Danny Thorpe @ 2015-05-26 18:22 UTC (permalink / raw)
  To: Peter Todd; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 4553 bytes --]

What prevents RBF from being used for fraudulent payment reversals?

Pay 1BTC to Alice for hard goods, then after you receive the goods
broadcast a double spend of that transaction to pay Alice nothing? Your
only cost is the higher network fee of the 2nd tx.

Thanks,
-Danny

On Mon, May 25, 2015 at 5:10 PM, Peter Todd <pete@petertodd•org> wrote:

> On Tue, May 26, 2015 at 12:03:09AM +0200, Mike Hearn wrote:
> > CPFP also solves it just fine.
>
> CPFP is a significantly more expensive way of paying fees than RBF,
> particularly for the use-case of defragmenting outputs, with cost
> savings ranging from 30% to 90%
>
>
> Case 1: CPFP vs. RBF for increasing the fee on a single tx
> ----------------------------------------------------------
>
> Creating an spending a P2PKH output uses 34 bytes of txout, and 148
> bytes of txin, 182 bytes total.
>
> Let's suppose I have a 1 BTC P2PKH output and I want to pay 0.1 BTC to
> Alice. This results in a 1in/2out transaction t1 that's 226 bytes in size.
> I forget to click on the "priority fee" option, so it goes out with the
> minimum fee of 2.26uBTC. Whoops! I use CPFP to spend that output,
> creating a new transaction t2 that's 192 bytes in size. I want to pay
> 1mBTC/KB for a fast confirmation, so I'm now paying 418uBTC of
> transaction fees.
>
> On the other hand, had I use RBF, my wallet would have simply
> rebroadcast t1 with the change address decreased. The rules require you
> to pay 2.26uBTC for the bandwidth consumed broadcasting it, plus the new
> fee level, or 218uBTC of fees in total.
>
> Cost savings: 48%
>
>
> Case 2: Paying multiple recipients in succession
> ------------------------------------------------
>
> Suppose that after I pay Alice, I also decide to pay Bob for his hard
> work demonstrating cryptographic protocols. I need to create a new
> transaction t2 spending t1's change address. Normally t2 would be
> another 226 bytes in size, resulting in 226uBTC additional fees.
>
> With RBF on the other hand I can simply double-spend t1 with a
> transaction paying both Alice and Bob. This new transaction is 260 bytes
> in size. I have to pay 2.6uBTC additional fees to pay for the bandwidth
> consumed broadcasting it, resulting in an additional 36uBTC of fees.
>
> Cost savings: 84%
>
>
> Case 3: Paying multiple recipients from a 2-of-3 multisig wallet
> ----------------------------------------------------------------
>
> The above situation gets even worse with multisig. t1 in the multisig
> case is 367 bytes; t2 another 367 bytes, costing an additional 367uBTC
> in fees. With RBF we rewrite t1 with an additional output, resulting in
> a 399 byte transaction, with just 36uBTC in additional fees.
>
> Cost savings: 90%
>
>
> Case 4: Dust defragmentation
> ----------------------------
>
> My wallet has a two transaction outputs that it wants to combine into
> one for the purpose of UTXO defragmentation. It broadcasts transaction
> t1 with two inputs and one output, size 340 bytes, paying zero fees.
>
> Prior to the transaction confirming I find I need to spend those funds
> for a priority transaction at the 1mBTC/KB fee level. This transaction,
> t2a, has one input and two outputs, 226 bytes in size. However it needs
> to pay fees for both transactions at once, resulting in a combined total
> fee of 556uBTC. If this situation happens frequently, defragmenting
> UTXOs is likely to cost more in additional fees than it saves.
>
> With RBF I'd simply doublespend t1 with a 2-in-2-out transaction 374
> bytes in size, paying 374uBTC. Even better, if one of the two inputs is
> sufficiently large to cover my costs I can doublespend t1 with a
> 1-in-2-out tx just 226 bytes in size, paying 226uBTC.
>
> Cost savings: 32% to 59%, or even infinite if defragmentation w/o RBF
>               costs you more than you save
>
> --
> 'peter'[:-1]@petertodd.org
> 0000000000000000134ce6577d4122094479f548b997baf84367eaf0c190bc9f
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>
>

[-- Attachment #2: Type: text/html, Size: 5608 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] Cost savings by using replace-by-fee, 30-90%
  2015-05-26 18:22         ` Danny Thorpe
@ 2015-05-26 18:38           ` Allen Piscitello
  2015-05-26 18:42           ` Aaron Voisine
                             ` (2 subsequent siblings)
  3 siblings, 0 replies; 45+ messages in thread
From: Allen Piscitello @ 2015-05-26 18:38 UTC (permalink / raw)
  To: Danny Thorpe; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 5438 bytes --]

What prevents you from writing a bad check using today's systems?

On Tue, May 26, 2015 at 1:22 PM, Danny Thorpe <danny.thorpe@gmail•com>
wrote:

> What prevents RBF from being used for fraudulent payment reversals?
>
> Pay 1BTC to Alice for hard goods, then after you receive the goods
> broadcast a double spend of that transaction to pay Alice nothing? Your
> only cost is the higher network fee of the 2nd tx.
>
> Thanks,
> -Danny
>
> On Mon, May 25, 2015 at 5:10 PM, Peter Todd <pete@petertodd•org> wrote:
>
>> On Tue, May 26, 2015 at 12:03:09AM +0200, Mike Hearn wrote:
>> > CPFP also solves it just fine.
>>
>> CPFP is a significantly more expensive way of paying fees than RBF,
>> particularly for the use-case of defragmenting outputs, with cost
>> savings ranging from 30% to 90%
>>
>>
>> Case 1: CPFP vs. RBF for increasing the fee on a single tx
>> ----------------------------------------------------------
>>
>> Creating an spending a P2PKH output uses 34 bytes of txout, and 148
>> bytes of txin, 182 bytes total.
>>
>> Let's suppose I have a 1 BTC P2PKH output and I want to pay 0.1 BTC to
>> Alice. This results in a 1in/2out transaction t1 that's 226 bytes in size.
>> I forget to click on the "priority fee" option, so it goes out with the
>> minimum fee of 2.26uBTC. Whoops! I use CPFP to spend that output,
>> creating a new transaction t2 that's 192 bytes in size. I want to pay
>> 1mBTC/KB for a fast confirmation, so I'm now paying 418uBTC of
>> transaction fees.
>>
>> On the other hand, had I use RBF, my wallet would have simply
>> rebroadcast t1 with the change address decreased. The rules require you
>> to pay 2.26uBTC for the bandwidth consumed broadcasting it, plus the new
>> fee level, or 218uBTC of fees in total.
>>
>> Cost savings: 48%
>>
>>
>> Case 2: Paying multiple recipients in succession
>> ------------------------------------------------
>>
>> Suppose that after I pay Alice, I also decide to pay Bob for his hard
>> work demonstrating cryptographic protocols. I need to create a new
>> transaction t2 spending t1's change address. Normally t2 would be
>> another 226 bytes in size, resulting in 226uBTC additional fees.
>>
>> With RBF on the other hand I can simply double-spend t1 with a
>> transaction paying both Alice and Bob. This new transaction is 260 bytes
>> in size. I have to pay 2.6uBTC additional fees to pay for the bandwidth
>> consumed broadcasting it, resulting in an additional 36uBTC of fees.
>>
>> Cost savings: 84%
>>
>>
>> Case 3: Paying multiple recipients from a 2-of-3 multisig wallet
>> ----------------------------------------------------------------
>>
>> The above situation gets even worse with multisig. t1 in the multisig
>> case is 367 bytes; t2 another 367 bytes, costing an additional 367uBTC
>> in fees. With RBF we rewrite t1 with an additional output, resulting in
>> a 399 byte transaction, with just 36uBTC in additional fees.
>>
>> Cost savings: 90%
>>
>>
>> Case 4: Dust defragmentation
>> ----------------------------
>>
>> My wallet has a two transaction outputs that it wants to combine into
>> one for the purpose of UTXO defragmentation. It broadcasts transaction
>> t1 with two inputs and one output, size 340 bytes, paying zero fees.
>>
>> Prior to the transaction confirming I find I need to spend those funds
>> for a priority transaction at the 1mBTC/KB fee level. This transaction,
>> t2a, has one input and two outputs, 226 bytes in size. However it needs
>> to pay fees for both transactions at once, resulting in a combined total
>> fee of 556uBTC. If this situation happens frequently, defragmenting
>> UTXOs is likely to cost more in additional fees than it saves.
>>
>> With RBF I'd simply doublespend t1 with a 2-in-2-out transaction 374
>> bytes in size, paying 374uBTC. Even better, if one of the two inputs is
>> sufficiently large to cover my costs I can doublespend t1 with a
>> 1-in-2-out tx just 226 bytes in size, paying 226uBTC.
>>
>> Cost savings: 32% to 59%, or even infinite if defragmentation w/o RBF
>>               costs you more than you save
>>
>> --
>> 'peter'[:-1]@petertodd.org
>> 0000000000000000134ce6577d4122094479f548b997baf84367eaf0c190bc9f
>>
>>
>> ------------------------------------------------------------------------------
>> One dashboard for servers and applications across Physical-Virtual-Cloud
>> Widest out-of-the-box monitoring support with 50+ applications
>> Performance metrics, stats and reports that give you Actionable Insights
>> Deep dive visibility with transaction tracing using APM Insight.
>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>> _______________________________________________
>> Bitcoin-development mailing list
>> Bitcoin-development@lists•sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>>
>>
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>
>

[-- Attachment #2: Type: text/html, Size: 7019 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] Cost savings by using replace-by-fee, 30-90%
  2015-05-26 18:22         ` Danny Thorpe
  2015-05-26 18:38           ` Allen Piscitello
@ 2015-05-26 18:42           ` Aaron Voisine
  2015-05-26 18:47           ` Adam Back
  2015-05-26 20:18           ` Matt Whitlock
  3 siblings, 0 replies; 45+ messages in thread
From: Aaron Voisine @ 2015-05-26 18:42 UTC (permalink / raw)
  To: Danny Thorpe; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 5472 bytes --]

See the "first-seen-safe replace-by-fee" thread


Aaron Voisine
co-founder and CEO
breadwallet.com

On Tue, May 26, 2015 at 11:22 AM, Danny Thorpe <danny.thorpe@gmail•com>
wrote:

> What prevents RBF from being used for fraudulent payment reversals?
>
> Pay 1BTC to Alice for hard goods, then after you receive the goods
> broadcast a double spend of that transaction to pay Alice nothing? Your
> only cost is the higher network fee of the 2nd tx.
>
> Thanks,
> -Danny
>
> On Mon, May 25, 2015 at 5:10 PM, Peter Todd <pete@petertodd•org> wrote:
>
>> On Tue, May 26, 2015 at 12:03:09AM +0200, Mike Hearn wrote:
>> > CPFP also solves it just fine.
>>
>> CPFP is a significantly more expensive way of paying fees than RBF,
>> particularly for the use-case of defragmenting outputs, with cost
>> savings ranging from 30% to 90%
>>
>>
>> Case 1: CPFP vs. RBF for increasing the fee on a single tx
>> ----------------------------------------------------------
>>
>> Creating an spending a P2PKH output uses 34 bytes of txout, and 148
>> bytes of txin, 182 bytes total.
>>
>> Let's suppose I have a 1 BTC P2PKH output and I want to pay 0.1 BTC to
>> Alice. This results in a 1in/2out transaction t1 that's 226 bytes in size.
>> I forget to click on the "priority fee" option, so it goes out with the
>> minimum fee of 2.26uBTC. Whoops! I use CPFP to spend that output,
>> creating a new transaction t2 that's 192 bytes in size. I want to pay
>> 1mBTC/KB for a fast confirmation, so I'm now paying 418uBTC of
>> transaction fees.
>>
>> On the other hand, had I use RBF, my wallet would have simply
>> rebroadcast t1 with the change address decreased. The rules require you
>> to pay 2.26uBTC for the bandwidth consumed broadcasting it, plus the new
>> fee level, or 218uBTC of fees in total.
>>
>> Cost savings: 48%
>>
>>
>> Case 2: Paying multiple recipients in succession
>> ------------------------------------------------
>>
>> Suppose that after I pay Alice, I also decide to pay Bob for his hard
>> work demonstrating cryptographic protocols. I need to create a new
>> transaction t2 spending t1's change address. Normally t2 would be
>> another 226 bytes in size, resulting in 226uBTC additional fees.
>>
>> With RBF on the other hand I can simply double-spend t1 with a
>> transaction paying both Alice and Bob. This new transaction is 260 bytes
>> in size. I have to pay 2.6uBTC additional fees to pay for the bandwidth
>> consumed broadcasting it, resulting in an additional 36uBTC of fees.
>>
>> Cost savings: 84%
>>
>>
>> Case 3: Paying multiple recipients from a 2-of-3 multisig wallet
>> ----------------------------------------------------------------
>>
>> The above situation gets even worse with multisig. t1 in the multisig
>> case is 367 bytes; t2 another 367 bytes, costing an additional 367uBTC
>> in fees. With RBF we rewrite t1 with an additional output, resulting in
>> a 399 byte transaction, with just 36uBTC in additional fees.
>>
>> Cost savings: 90%
>>
>>
>> Case 4: Dust defragmentation
>> ----------------------------
>>
>> My wallet has a two transaction outputs that it wants to combine into
>> one for the purpose of UTXO defragmentation. It broadcasts transaction
>> t1 with two inputs and one output, size 340 bytes, paying zero fees.
>>
>> Prior to the transaction confirming I find I need to spend those funds
>> for a priority transaction at the 1mBTC/KB fee level. This transaction,
>> t2a, has one input and two outputs, 226 bytes in size. However it needs
>> to pay fees for both transactions at once, resulting in a combined total
>> fee of 556uBTC. If this situation happens frequently, defragmenting
>> UTXOs is likely to cost more in additional fees than it saves.
>>
>> With RBF I'd simply doublespend t1 with a 2-in-2-out transaction 374
>> bytes in size, paying 374uBTC. Even better, if one of the two inputs is
>> sufficiently large to cover my costs I can doublespend t1 with a
>> 1-in-2-out tx just 226 bytes in size, paying 226uBTC.
>>
>> Cost savings: 32% to 59%, or even infinite if defragmentation w/o RBF
>>               costs you more than you save
>>
>> --
>> 'peter'[:-1]@petertodd.org
>> 0000000000000000134ce6577d4122094479f548b997baf84367eaf0c190bc9f
>>
>>
>> ------------------------------------------------------------------------------
>> One dashboard for servers and applications across Physical-Virtual-Cloud
>> Widest out-of-the-box monitoring support with 50+ applications
>> Performance metrics, stats and reports that give you Actionable Insights
>> Deep dive visibility with transaction tracing using APM Insight.
>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>> _______________________________________________
>> Bitcoin-development mailing list
>> Bitcoin-development@lists•sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>>
>>
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>
>

[-- Attachment #2: Type: text/html, Size: 7254 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] Cost savings by using replace-by-fee, 30-90%
  2015-05-26 18:22         ` Danny Thorpe
  2015-05-26 18:38           ` Allen Piscitello
  2015-05-26 18:42           ` Aaron Voisine
@ 2015-05-26 18:47           ` Adam Back
  2015-05-26 20:18           ` Matt Whitlock
  3 siblings, 0 replies; 45+ messages in thread
From: Adam Back @ 2015-05-26 18:47 UTC (permalink / raw)
  To: Danny Thorpe; +Cc: Bitcoin Dev

The general idea for replace by fee is that it would be restricted so
as to make it safe, eg all the original addresses should receive no
less bitcoin (more addresses can be added).

The scorched earth game theory stuff (allowing removing recipients) is
kind of orthogonal.

Adam

On 26 May 2015 at 19:22, Danny Thorpe <danny.thorpe@gmail•com> wrote:
> What prevents RBF from being used for fraudulent payment reversals?
>
> Pay 1BTC to Alice for hard goods, then after you receive the goods broadcast
> a double spend of that transaction to pay Alice nothing? Your only cost is
> the higher network fee of the 2nd tx.
>
> Thanks,
> -Danny
>
> On Mon, May 25, 2015 at 5:10 PM, Peter Todd <pete@petertodd•org> wrote:
>>
>> On Tue, May 26, 2015 at 12:03:09AM +0200, Mike Hearn wrote:
>> > CPFP also solves it just fine.
>>
>> CPFP is a significantly more expensive way of paying fees than RBF,
>> particularly for the use-case of defragmenting outputs, with cost
>> savings ranging from 30% to 90%
>>
>>
>> Case 1: CPFP vs. RBF for increasing the fee on a single tx
>> ----------------------------------------------------------
>>
>> Creating an spending a P2PKH output uses 34 bytes of txout, and 148
>> bytes of txin, 182 bytes total.
>>
>> Let's suppose I have a 1 BTC P2PKH output and I want to pay 0.1 BTC to
>> Alice. This results in a 1in/2out transaction t1 that's 226 bytes in size.
>> I forget to click on the "priority fee" option, so it goes out with the
>> minimum fee of 2.26uBTC. Whoops! I use CPFP to spend that output,
>> creating a new transaction t2 that's 192 bytes in size. I want to pay
>> 1mBTC/KB for a fast confirmation, so I'm now paying 418uBTC of
>> transaction fees.
>>
>> On the other hand, had I use RBF, my wallet would have simply
>> rebroadcast t1 with the change address decreased. The rules require you
>> to pay 2.26uBTC for the bandwidth consumed broadcasting it, plus the new
>> fee level, or 218uBTC of fees in total.
>>
>> Cost savings: 48%
>>
>>
>> Case 2: Paying multiple recipients in succession
>> ------------------------------------------------
>>
>> Suppose that after I pay Alice, I also decide to pay Bob for his hard
>> work demonstrating cryptographic protocols. I need to create a new
>> transaction t2 spending t1's change address. Normally t2 would be
>> another 226 bytes in size, resulting in 226uBTC additional fees.
>>
>> With RBF on the other hand I can simply double-spend t1 with a
>> transaction paying both Alice and Bob. This new transaction is 260 bytes
>> in size. I have to pay 2.6uBTC additional fees to pay for the bandwidth
>> consumed broadcasting it, resulting in an additional 36uBTC of fees.
>>
>> Cost savings: 84%
>>
>>
>> Case 3: Paying multiple recipients from a 2-of-3 multisig wallet
>> ----------------------------------------------------------------
>>
>> The above situation gets even worse with multisig. t1 in the multisig
>> case is 367 bytes; t2 another 367 bytes, costing an additional 367uBTC
>> in fees. With RBF we rewrite t1 with an additional output, resulting in
>> a 399 byte transaction, with just 36uBTC in additional fees.
>>
>> Cost savings: 90%
>>
>>
>> Case 4: Dust defragmentation
>> ----------------------------
>>
>> My wallet has a two transaction outputs that it wants to combine into
>> one for the purpose of UTXO defragmentation. It broadcasts transaction
>> t1 with two inputs and one output, size 340 bytes, paying zero fees.
>>
>> Prior to the transaction confirming I find I need to spend those funds
>> for a priority transaction at the 1mBTC/KB fee level. This transaction,
>> t2a, has one input and two outputs, 226 bytes in size. However it needs
>> to pay fees for both transactions at once, resulting in a combined total
>> fee of 556uBTC. If this situation happens frequently, defragmenting
>> UTXOs is likely to cost more in additional fees than it saves.
>>
>> With RBF I'd simply doublespend t1 with a 2-in-2-out transaction 374
>> bytes in size, paying 374uBTC. Even better, if one of the two inputs is
>> sufficiently large to cover my costs I can doublespend t1 with a
>> 1-in-2-out tx just 226 bytes in size, paying 226uBTC.
>>
>> Cost savings: 32% to 59%, or even infinite if defragmentation w/o RBF
>>               costs you more than you save
>>
>> --
>> 'peter'[:-1]@petertodd.org
>> 0000000000000000134ce6577d4122094479f548b997baf84367eaf0c190bc9f
>>
>>
>> ------------------------------------------------------------------------------
>> One dashboard for servers and applications across Physical-Virtual-Cloud
>> Widest out-of-the-box monitoring support with 50+ applications
>> Performance metrics, stats and reports that give you Actionable Insights
>> Deep dive visibility with transaction tracing using APM Insight.
>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>> _______________________________________________
>> Bitcoin-development mailing list
>> Bitcoin-development@lists•sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>>
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>



^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] Cost savings by using replace-by-fee, 30-90%
  2015-05-26 18:22         ` Danny Thorpe
                             ` (2 preceding siblings ...)
  2015-05-26 18:47           ` Adam Back
@ 2015-05-26 20:18           ` Matt Whitlock
  3 siblings, 0 replies; 45+ messages in thread
From: Matt Whitlock @ 2015-05-26 20:18 UTC (permalink / raw)
  To: Danny Thorpe; +Cc: bitcoin-development

On Tuesday, 26 May 2015, at 11:22 am, Danny Thorpe wrote:
> What prevents RBF from being used for fraudulent payment reversals?
> 
> Pay 1BTC to Alice for hard goods, then after you receive the goods
> broadcast a double spend of that transaction to pay Alice nothing? Your
> only cost is the higher network fee of the 2nd tx.

The "First-Seen-Safe" replace-by-fee presently being discussed on this list disallows fraudulent payment reversals, as it disallows a replacing transaction that pays less to any output script than the replaced transaction paid.



^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] Cost savings by using replace-by-fee, 30-90%
  2015-05-26  0:10       ` [Bitcoin-development] Cost savings by using replace-by-fee, 30-90% Peter Todd
  2015-05-26 18:22         ` Danny Thorpe
@ 2015-05-26 20:30         ` joliver
  2015-05-26 20:56           ` Mark Friedenbach
                             ` (2 more replies)
  1 sibling, 3 replies; 45+ messages in thread
From: joliver @ 2015-05-26 20:30 UTC (permalink / raw)
  To: bitcoin-development

You're the Chief Scientist of __ViaCoin__ a alt with 30 second blocks 
and you have big banks as clients. Shit like replace-by-fee and leading 
the anti-scaling mob is for your clients, not Bitcoin. Get the fuck out.

Peter Todd - 8930511 Canada Ltd.
1214-1423 Mississauga Valley Blvd.
Mississauga ON L5A 4A5
Canada

https://www.ic.gc.ca/app/scr/cc/CorporationsCanada/fdrlCrpDtls.html?corpId=8930511

On 2015-05-26 00:10, Peter Todd wrote:
> On Tue, May 26, 2015 at 12:03:09AM +0200, Mike Hearn wrote:
>> CPFP also solves it just fine.
> 
> CPFP is a significantly more expensive way of paying fees than RBF,
> particularly for the use-case of defragmenting outputs, with cost
> savings ranging from 30% to 90%
> 
> 
> Case 1: CPFP vs. RBF for increasing the fee on a single tx
> ----------------------------------------------------------
> 
> Creating an spending a P2PKH output uses 34 bytes of txout, and 148
> bytes of txin, 182 bytes total.
> 
> Let's suppose I have a 1 BTC P2PKH output and I want to pay 0.1 BTC to
> Alice. This results in a 1in/2out transaction t1 that's 226 bytes in 
> size.
> I forget to click on the "priority fee" option, so it goes out with the
> minimum fee of 2.26uBTC. Whoops! I use CPFP to spend that output,
> creating a new transaction t2 that's 192 bytes in size. I want to pay
> 1mBTC/KB for a fast confirmation, so I'm now paying 418uBTC of
> transaction fees.
> 
> On the other hand, had I use RBF, my wallet would have simply
> rebroadcast t1 with the change address decreased. The rules require you
> to pay 2.26uBTC for the bandwidth consumed broadcasting it, plus the 
> new
> fee level, or 218uBTC of fees in total.
> 
> Cost savings: 48%
> 
> 
> Case 2: Paying multiple recipients in succession
> ------------------------------------------------
> 
> Suppose that after I pay Alice, I also decide to pay Bob for his hard
> work demonstrating cryptographic protocols. I need to create a new
> transaction t2 spending t1's change address. Normally t2 would be
> another 226 bytes in size, resulting in 226uBTC additional fees.
> 
> With RBF on the other hand I can simply double-spend t1 with a
> transaction paying both Alice and Bob. This new transaction is 260 
> bytes
> in size. I have to pay 2.6uBTC additional fees to pay for the bandwidth
> consumed broadcasting it, resulting in an additional 36uBTC of fees.
> 
> Cost savings: 84%
> 
> 
> Case 3: Paying multiple recipients from a 2-of-3 multisig wallet
> ----------------------------------------------------------------
> 
> The above situation gets even worse with multisig. t1 in the multisig
> case is 367 bytes; t2 another 367 bytes, costing an additional 367uBTC
> in fees. With RBF we rewrite t1 with an additional output, resulting in
> a 399 byte transaction, with just 36uBTC in additional fees.
> 
> Cost savings: 90%
> 
> 
> Case 4: Dust defragmentation
> ----------------------------
> 
> My wallet has a two transaction outputs that it wants to combine into
> one for the purpose of UTXO defragmentation. It broadcasts transaction
> t1 with two inputs and one output, size 340 bytes, paying zero fees.
> 
> Prior to the transaction confirming I find I need to spend those funds
> for a priority transaction at the 1mBTC/KB fee level. This transaction,
> t2a, has one input and two outputs, 226 bytes in size. However it needs
> to pay fees for both transactions at once, resulting in a combined 
> total
> fee of 556uBTC. If this situation happens frequently, defragmenting
> UTXOs is likely to cost more in additional fees than it saves.
> 
> With RBF I'd simply doublespend t1 with a 2-in-2-out transaction 374
> bytes in size, paying 374uBTC. Even better, if one of the two inputs is
> sufficiently large to cover my costs I can doublespend t1 with a
> 1-in-2-out tx just 226 bytes in size, paying 226uBTC.
> 
> Cost savings: 32% to 59%, or even infinite if defragmentation w/o RBF
>               costs you more than you save
> 
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across 
> Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable 
> Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> 
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development



^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] Cost savings by using replace-by-fee, 30-90%
  2015-05-26 20:30         ` joliver
@ 2015-05-26 20:56           ` Mark Friedenbach
  2015-05-26 21:29           ` s7r
  2015-05-26 22:29           ` Jeff Garzik
  2 siblings, 0 replies; 45+ messages in thread
From: Mark Friedenbach @ 2015-05-26 20:56 UTC (permalink / raw)
  To: joliver; +Cc: Bitcoin Development

[-- Attachment #1: Type: text/plain, Size: 5176 bytes --]

Please let's at least have some civility and decorum on this list.

On Tue, May 26, 2015 at 1:30 PM, <joliver@airmail•cc> wrote:

> You're the Chief Scientist of __ViaCoin__ a alt with 30 second blocks
> and you have big banks as clients. Shit like replace-by-fee and leading
> the anti-scaling mob is for your clients, not Bitcoin. Get the fuck out.
>
> Peter Todd - 8930511 Canada Ltd.
> 1214-1423 Mississauga Valley Blvd.
> Mississauga ON L5A 4A5
> Canada
>
>
> https://www.ic.gc.ca/app/scr/cc/CorporationsCanada/fdrlCrpDtls.html?corpId=8930511
>
> On 2015-05-26 00:10, Peter Todd wrote:
> > On Tue, May 26, 2015 at 12:03:09AM +0200, Mike Hearn wrote:
> >> CPFP also solves it just fine.
> >
> > CPFP is a significantly more expensive way of paying fees than RBF,
> > particularly for the use-case of defragmenting outputs, with cost
> > savings ranging from 30% to 90%
> >
> >
> > Case 1: CPFP vs. RBF for increasing the fee on a single tx
> > ----------------------------------------------------------
> >
> > Creating an spending a P2PKH output uses 34 bytes of txout, and 148
> > bytes of txin, 182 bytes total.
> >
> > Let's suppose I have a 1 BTC P2PKH output and I want to pay 0.1 BTC to
> > Alice. This results in a 1in/2out transaction t1 that's 226 bytes in
> > size.
> > I forget to click on the "priority fee" option, so it goes out with the
> > minimum fee of 2.26uBTC. Whoops! I use CPFP to spend that output,
> > creating a new transaction t2 that's 192 bytes in size. I want to pay
> > 1mBTC/KB for a fast confirmation, so I'm now paying 418uBTC of
> > transaction fees.
> >
> > On the other hand, had I use RBF, my wallet would have simply
> > rebroadcast t1 with the change address decreased. The rules require you
> > to pay 2.26uBTC for the bandwidth consumed broadcasting it, plus the
> > new
> > fee level, or 218uBTC of fees in total.
> >
> > Cost savings: 48%
> >
> >
> > Case 2: Paying multiple recipients in succession
> > ------------------------------------------------
> >
> > Suppose that after I pay Alice, I also decide to pay Bob for his hard
> > work demonstrating cryptographic protocols. I need to create a new
> > transaction t2 spending t1's change address. Normally t2 would be
> > another 226 bytes in size, resulting in 226uBTC additional fees.
> >
> > With RBF on the other hand I can simply double-spend t1 with a
> > transaction paying both Alice and Bob. This new transaction is 260
> > bytes
> > in size. I have to pay 2.6uBTC additional fees to pay for the bandwidth
> > consumed broadcasting it, resulting in an additional 36uBTC of fees.
> >
> > Cost savings: 84%
> >
> >
> > Case 3: Paying multiple recipients from a 2-of-3 multisig wallet
> > ----------------------------------------------------------------
> >
> > The above situation gets even worse with multisig. t1 in the multisig
> > case is 367 bytes; t2 another 367 bytes, costing an additional 367uBTC
> > in fees. With RBF we rewrite t1 with an additional output, resulting in
> > a 399 byte transaction, with just 36uBTC in additional fees.
> >
> > Cost savings: 90%
> >
> >
> > Case 4: Dust defragmentation
> > ----------------------------
> >
> > My wallet has a two transaction outputs that it wants to combine into
> > one for the purpose of UTXO defragmentation. It broadcasts transaction
> > t1 with two inputs and one output, size 340 bytes, paying zero fees.
> >
> > Prior to the transaction confirming I find I need to spend those funds
> > for a priority transaction at the 1mBTC/KB fee level. This transaction,
> > t2a, has one input and two outputs, 226 bytes in size. However it needs
> > to pay fees for both transactions at once, resulting in a combined
> > total
> > fee of 556uBTC. If this situation happens frequently, defragmenting
> > UTXOs is likely to cost more in additional fees than it saves.
> >
> > With RBF I'd simply doublespend t1 with a 2-in-2-out transaction 374
> > bytes in size, paying 374uBTC. Even better, if one of the two inputs is
> > sufficiently large to cover my costs I can doublespend t1 with a
> > 1-in-2-out tx just 226 bytes in size, paying 226uBTC.
> >
> > Cost savings: 32% to 59%, or even infinite if defragmentation w/o RBF
> >               costs you more than you save
> >
> >
> ------------------------------------------------------------------------------
> > One dashboard for servers and applications across
> > Physical-Virtual-Cloud
> > Widest out-of-the-box monitoring support with 50+ applications
> > Performance metrics, stats and reports that give you Actionable
> > Insights
> > Deep dive visibility with transaction tracing using APM Insight.
> > http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> >
> > _______________________________________________
> > Bitcoin-development mailing list
> > Bitcoin-development@lists•sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>

[-- Attachment #2: Type: text/html, Size: 6795 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] Cost savings by using replace-by-fee, 30-90%
  2015-05-26 20:30         ` joliver
  2015-05-26 20:56           ` Mark Friedenbach
@ 2015-05-26 21:29           ` s7r
  2015-05-26 22:06             ` Adam Back
  2015-05-27  1:25             ` Peter Todd
  2015-05-26 22:29           ` Jeff Garzik
  2 siblings, 2 replies; 45+ messages in thread
From: s7r @ 2015-05-26 21:29 UTC (permalink / raw)
  To: bitcoin-development

What is wrong with the man testing some ideas on his custom branch? This
is how improvements come to life. I saw in the BIPs some really
interesting ideas and nice brainstorming which came from Peter Todd.

Now, my question, if replace by fee doesn't allow me to change the
inputs or the outputs, I can only add outputs... what can I do with this
feature? If I sent a tx and want to replace it with a higher fee one,
the higher fee one can only have maybe additional change addresses or
another payment, if the inputs suffice? Do we have any real use cases?

P.S. is it planned to include this by default in bitcoin core 10.0.3 or
it will remain just on Peter's branch?

On 5/26/2015 11:30 PM, joliver@airmail•cc wrote:
> You're the Chief Scientist of __ViaCoin__ a alt with 30 second blocks 
> and you have big banks as clients. Shit like replace-by-fee and leading 
> the anti-scaling mob is for your clients, not Bitcoin. Get the fuck out.
> 
> Peter Todd - 8930511 Canada Ltd.
> 1214-1423 Mississauga Valley Blvd.
> Mississauga ON L5A 4A5
> Canada
> 
> https://www.ic.gc.ca/app/scr/cc/CorporationsCanada/fdrlCrpDtls.html?corpId=8930511
> 
> On 2015-05-26 00:10, Peter Todd wrote:
>> On Tue, May 26, 2015 at 12:03:09AM +0200, Mike Hearn wrote:
>>> CPFP also solves it just fine.
>>
>> CPFP is a significantly more expensive way of paying fees than RBF,
>> particularly for the use-case of defragmenting outputs, with cost
>> savings ranging from 30% to 90%
>>
>>
>> Case 1: CPFP vs. RBF for increasing the fee on a single tx
>> ----------------------------------------------------------
>>
>> Creating an spending a P2PKH output uses 34 bytes of txout, and 148
>> bytes of txin, 182 bytes total.
>>
>> Let's suppose I have a 1 BTC P2PKH output and I want to pay 0.1 BTC to
>> Alice. This results in a 1in/2out transaction t1 that's 226 bytes in 
>> size.
>> I forget to click on the "priority fee" option, so it goes out with the
>> minimum fee of 2.26uBTC. Whoops! I use CPFP to spend that output,
>> creating a new transaction t2 that's 192 bytes in size. I want to pay
>> 1mBTC/KB for a fast confirmation, so I'm now paying 418uBTC of
>> transaction fees.
>>
>> On the other hand, had I use RBF, my wallet would have simply
>> rebroadcast t1 with the change address decreased. The rules require you
>> to pay 2.26uBTC for the bandwidth consumed broadcasting it, plus the 
>> new
>> fee level, or 218uBTC of fees in total.
>>
>> Cost savings: 48%
>>
>>
>> Case 2: Paying multiple recipients in succession
>> ------------------------------------------------
>>
>> Suppose that after I pay Alice, I also decide to pay Bob for his hard
>> work demonstrating cryptographic protocols. I need to create a new
>> transaction t2 spending t1's change address. Normally t2 would be
>> another 226 bytes in size, resulting in 226uBTC additional fees.
>>
>> With RBF on the other hand I can simply double-spend t1 with a
>> transaction paying both Alice and Bob. This new transaction is 260 
>> bytes
>> in size. I have to pay 2.6uBTC additional fees to pay for the bandwidth
>> consumed broadcasting it, resulting in an additional 36uBTC of fees.
>>
>> Cost savings: 84%
>>
>>
>> Case 3: Paying multiple recipients from a 2-of-3 multisig wallet
>> ----------------------------------------------------------------
>>
>> The above situation gets even worse with multisig. t1 in the multisig
>> case is 367 bytes; t2 another 367 bytes, costing an additional 367uBTC
>> in fees. With RBF we rewrite t1 with an additional output, resulting in
>> a 399 byte transaction, with just 36uBTC in additional fees.
>>
>> Cost savings: 90%
>>
>>
>> Case 4: Dust defragmentation
>> ----------------------------
>>
>> My wallet has a two transaction outputs that it wants to combine into
>> one for the purpose of UTXO defragmentation. It broadcasts transaction
>> t1 with two inputs and one output, size 340 bytes, paying zero fees.
>>
>> Prior to the transaction confirming I find I need to spend those funds
>> for a priority transaction at the 1mBTC/KB fee level. This transaction,
>> t2a, has one input and two outputs, 226 bytes in size. However it needs
>> to pay fees for both transactions at once, resulting in a combined 
>> total
>> fee of 556uBTC. If this situation happens frequently, defragmenting
>> UTXOs is likely to cost more in additional fees than it saves.
>>
>> With RBF I'd simply doublespend t1 with a 2-in-2-out transaction 374
>> bytes in size, paying 374uBTC. Even better, if one of the two inputs is
>> sufficiently large to cover my costs I can doublespend t1 with a
>> 1-in-2-out tx just 226 bytes in size, paying 226uBTC.
>>
>> Cost savings: 32% to 59%, or even infinite if defragmentation w/o RBF
>>               costs you more than you save
>>
>> ------------------------------------------------------------------------------
>> One dashboard for servers and applications across 
>> Physical-Virtual-Cloud
>> Widest out-of-the-box monitoring support with 50+ applications
>> Performance metrics, stats and reports that give you Actionable 
>> Insights
>> Deep dive visibility with transaction tracing using APM Insight.
>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>>
>> _______________________________________________
>> Bitcoin-development mailing list
>> Bitcoin-development@lists•sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
> 



^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] Cost savings by using replace-by-fee, 30-90%
  2015-05-26 21:29           ` s7r
@ 2015-05-26 22:06             ` Adam Back
  2015-05-27  1:25             ` Peter Todd
  1 sibling, 0 replies; 45+ messages in thread
From: Adam Back @ 2015-05-26 22:06 UTC (permalink / raw)
  To: s7r; +Cc: Bitcoin Dev

Well so for example it could have an additional input (to increase the
BTC paid into the transaction) and pay more to an existing change
address and higher fee, or add an additional change address, and leave
a larger fee, or if you had a right-sized coin add an additional input
that all goes to fees.

(As well as optionally tacking on additional pending payments to other
addresses funded from the higher input).

Adam

On 26 May 2015 at 22:29, s7r <s7r@sky-ip•org> wrote:
> What is wrong with the man testing some ideas on his custom branch? This
> is how improvements come to life. I saw in the BIPs some really
> interesting ideas and nice brainstorming which came from Peter Todd.
>
> Now, my question, if replace by fee doesn't allow me to change the
> inputs or the outputs, I can only add outputs... what can I do with this
> feature? If I sent a tx and want to replace it with a higher fee one,
> the higher fee one can only have maybe additional change addresses or
> another payment, if the inputs suffice? Do we have any real use cases?
>
> P.S. is it planned to include this by default in bitcoin core 10.0.3 or
> it will remain just on Peter's branch?
>
> On 5/26/2015 11:30 PM, joliver@airmail•cc wrote:
>> You're the Chief Scientist of __ViaCoin__ a alt with 30 second blocks
>> and you have big banks as clients. Shit like replace-by-fee and leading
>> the anti-scaling mob is for your clients, not Bitcoin. Get the fuck out.
>>
>> Peter Todd - 8930511 Canada Ltd.
>> 1214-1423 Mississauga Valley Blvd.
>> Mississauga ON L5A 4A5
>> Canada
>>
>> https://www.ic.gc.ca/app/scr/cc/CorporationsCanada/fdrlCrpDtls.html?corpId=8930511
>>
>> On 2015-05-26 00:10, Peter Todd wrote:
>>> On Tue, May 26, 2015 at 12:03:09AM +0200, Mike Hearn wrote:
>>>> CPFP also solves it just fine.
>>>
>>> CPFP is a significantly more expensive way of paying fees than RBF,
>>> particularly for the use-case of defragmenting outputs, with cost
>>> savings ranging from 30% to 90%
>>>
>>>
>>> Case 1: CPFP vs. RBF for increasing the fee on a single tx
>>> ----------------------------------------------------------
>>>
>>> Creating an spending a P2PKH output uses 34 bytes of txout, and 148
>>> bytes of txin, 182 bytes total.
>>>
>>> Let's suppose I have a 1 BTC P2PKH output and I want to pay 0.1 BTC to
>>> Alice. This results in a 1in/2out transaction t1 that's 226 bytes in
>>> size.
>>> I forget to click on the "priority fee" option, so it goes out with the
>>> minimum fee of 2.26uBTC. Whoops! I use CPFP to spend that output,
>>> creating a new transaction t2 that's 192 bytes in size. I want to pay
>>> 1mBTC/KB for a fast confirmation, so I'm now paying 418uBTC of
>>> transaction fees.
>>>
>>> On the other hand, had I use RBF, my wallet would have simply
>>> rebroadcast t1 with the change address decreased. The rules require you
>>> to pay 2.26uBTC for the bandwidth consumed broadcasting it, plus the
>>> new
>>> fee level, or 218uBTC of fees in total.
>>>
>>> Cost savings: 48%
>>>
>>>
>>> Case 2: Paying multiple recipients in succession
>>> ------------------------------------------------
>>>
>>> Suppose that after I pay Alice, I also decide to pay Bob for his hard
>>> work demonstrating cryptographic protocols. I need to create a new
>>> transaction t2 spending t1's change address. Normally t2 would be
>>> another 226 bytes in size, resulting in 226uBTC additional fees.
>>>
>>> With RBF on the other hand I can simply double-spend t1 with a
>>> transaction paying both Alice and Bob. This new transaction is 260
>>> bytes
>>> in size. I have to pay 2.6uBTC additional fees to pay for the bandwidth
>>> consumed broadcasting it, resulting in an additional 36uBTC of fees.
>>>
>>> Cost savings: 84%
>>>
>>>
>>> Case 3: Paying multiple recipients from a 2-of-3 multisig wallet
>>> ----------------------------------------------------------------
>>>
>>> The above situation gets even worse with multisig. t1 in the multisig
>>> case is 367 bytes; t2 another 367 bytes, costing an additional 367uBTC
>>> in fees. With RBF we rewrite t1 with an additional output, resulting in
>>> a 399 byte transaction, with just 36uBTC in additional fees.
>>>
>>> Cost savings: 90%
>>>
>>>
>>> Case 4: Dust defragmentation
>>> ----------------------------
>>>
>>> My wallet has a two transaction outputs that it wants to combine into
>>> one for the purpose of UTXO defragmentation. It broadcasts transaction
>>> t1 with two inputs and one output, size 340 bytes, paying zero fees.
>>>
>>> Prior to the transaction confirming I find I need to spend those funds
>>> for a priority transaction at the 1mBTC/KB fee level. This transaction,
>>> t2a, has one input and two outputs, 226 bytes in size. However it needs
>>> to pay fees for both transactions at once, resulting in a combined
>>> total
>>> fee of 556uBTC. If this situation happens frequently, defragmenting
>>> UTXOs is likely to cost more in additional fees than it saves.
>>>
>>> With RBF I'd simply doublespend t1 with a 2-in-2-out transaction 374
>>> bytes in size, paying 374uBTC. Even better, if one of the two inputs is
>>> sufficiently large to cover my costs I can doublespend t1 with a
>>> 1-in-2-out tx just 226 bytes in size, paying 226uBTC.
>>>
>>> Cost savings: 32% to 59%, or even infinite if defragmentation w/o RBF
>>>               costs you more than you save
>>>
>>> ------------------------------------------------------------------------------
>>> One dashboard for servers and applications across
>>> Physical-Virtual-Cloud
>>> Widest out-of-the-box monitoring support with 50+ applications
>>> Performance metrics, stats and reports that give you Actionable
>>> Insights
>>> Deep dive visibility with transaction tracing using APM Insight.
>>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>>>
>>> _______________________________________________
>>> Bitcoin-development mailing list
>>> Bitcoin-development@lists•sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Bitcoin-development mailing list
>> Bitcoin-development@lists•sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development



^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] Cost savings by using replace-by-fee, 30-90%
  2015-05-26 20:30         ` joliver
  2015-05-26 20:56           ` Mark Friedenbach
  2015-05-26 21:29           ` s7r
@ 2015-05-26 22:29           ` Jeff Garzik
  2 siblings, 0 replies; 45+ messages in thread
From: Jeff Garzik @ 2015-05-26 22:29 UTC (permalink / raw)
  To: joliver; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 523 bytes --]

That attitude and doxxing is not appropriate for this list.


On Tue, May 26, 2015 at 4:30 PM, <joliver@airmail•cc> wrote:

> You're the Chief Scientist of __ViaCoin__ a alt with 30 second blocks
> and you have big banks as clients. Shit like replace-by-fee and leading
> the anti-scaling mob is for your clients, not Bitcoin. Get the fuck out.
> <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>
>



-- 
Jeff Garzik
Bitcoin core developer and open source evangelist
BitPay, Inc.      https://bitpay.com/

[-- Attachment #2: Type: text/html, Size: 1071 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] Cost savings by using replace-by-fee, 30-90%
  2015-05-26 21:29           ` s7r
  2015-05-26 22:06             ` Adam Back
@ 2015-05-27  1:25             ` Peter Todd
  2015-05-27 19:28               ` s7r
  1 sibling, 1 reply; 45+ messages in thread
From: Peter Todd @ 2015-05-27  1:25 UTC (permalink / raw)
  To: s7r; +Cc: bitcoin-development

[-- Attachment #1: Type: text/plain, Size: 1385 bytes --]

On Wed, May 27, 2015 at 12:29:28AM +0300, s7r wrote:
> What is wrong with the man testing some ideas on his custom branch? This
> is how improvements come to life. I saw in the BIPs some really
> interesting ideas and nice brainstorming which came from Peter Todd.
> 
> Now, my question, if replace by fee doesn't allow me to change the
> inputs or the outputs, I can only add outputs... what can I do with this
> feature? If I sent a tx and want to replace it with a higher fee one,
> the higher fee one can only have maybe additional change addresses or
> another payment, if the inputs suffice? Do we have any real use cases?

You're a bit mistaken there: standard RBF lets you change anything, and
FSS RBF lets you modify inputs and add outputs and/or make the value of
outputs higher.

> P.S. is it planned to include this by default in bitcoin core 10.0.3 or
> it will remain just on Peter's branch?

Any significant change to mempool policy like RBF is very unlikely to be
incorporated in the Bitcoin Core v0.10.x branch, simply because it'd be
too large a change for a minor, mostly bugfix, release.

Having said that, I already maintain a standard RBF branch for v0.10.x,
and have been asked by a major minor to backport FSS RBF for v0.10.x as
well.

-- 
'peter'[:-1]@petertodd.org
00000000000000000b9e6c1ce35e6e06c01b1f381840bcd9297f307cb1e6aae8

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 650 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] Cost savings by using replace-by-fee, 30-90%
  2015-05-27  1:25             ` Peter Todd
@ 2015-05-27 19:28               ` s7r
  0 siblings, 0 replies; 45+ messages in thread
From: s7r @ 2015-05-27 19:28 UTC (permalink / raw)
  To: Peter Todd; +Cc: bitcoin-development

Hi Peter,

Thanks for your reply.

I know and bookmarked your branch - nice work.

So, to clarify:
- bitcoin core (official / default) 0.10.x currently has First-seen
mempool behavior
- your custom branch uses replace by fee mempool behavior which allows
an user to change anything in a tx (I guess it needs just to have at
least one same input, so it can link it to another previously signed tx
with lower fee and substitute it in the mempool, correct?).

- First Seen Safe Replace by Fee (FSF-RBF) mempool behavior which allows
an user only to add inputs and/or increase the value of outputs will be
in yet another branch, maintained by you, but not in default / official
bitcoin core?

Another thing, if FSF-RBF lets you change TXes in the manner described
above, how does the client know which tx needs to be replaced in the
mempool? Since the txid naturally changes. How does it map tx1 with tx2
(to know tx2 has a higher fee and needs to substitute tx1) if quite a
lot of params from the transaction structure can change?

Thanks!

On 5/27/2015 4:25 AM, Peter Todd wrote:
> On Wed, May 27, 2015 at 12:29:28AM +0300, s7r wrote:
>> What is wrong with the man testing some ideas on his custom branch? This
>> is how improvements come to life. I saw in the BIPs some really
>> interesting ideas and nice brainstorming which came from Peter Todd.
>>
>> Now, my question, if replace by fee doesn't allow me to change the
>> inputs or the outputs, I can only add outputs... what can I do with this
>> feature? If I sent a tx and want to replace it with a higher fee one,
>> the higher fee one can only have maybe additional change addresses or
>> another payment, if the inputs suffice? Do we have any real use cases?
> 
> You're a bit mistaken there: standard RBF lets you change anything, and
> FSS RBF lets you modify inputs and add outputs and/or make the value of
> outputs higher.
> 
>> P.S. is it planned to include this by default in bitcoin core 10.0.3 or
>> it will remain just on Peter's branch?
> 
> Any significant change to mempool policy like RBF is very unlikely to be
> incorporated in the Bitcoin Core v0.10.x branch, simply because it'd be
> too large a change for a minor, mostly bugfix, release.
> 
> Having said that, I already maintain a standard RBF branch for v0.10.x,
> and have been asked by a major minor to backport FSS RBF for v0.10.x as
> well.
> 



^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 20:38 ` Pieter Wuille
@ 2015-05-09 21:11   ` Jim Phillips
  0 siblings, 0 replies; 45+ messages in thread
From: Jim Phillips @ 2015-05-09 21:11 UTC (permalink / raw)
  To: Pieter Wuille; +Cc: Andreas Schildbach, Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 4274 bytes --]

Makes sense.. So with that said, I'd propose the following criteria for
selecting UTXOs:

1. Select the smallest possible set of addresses that can be linked in
order to come up with enough BTC to send to the payee.
2. Given multiple possible sets, select the one that has the largest number
of UTXOs.
3. Given multiple possible sets, choose the one that contains the largest
amount of total BTC.
4. Given multiple possible sets, select the one that destroys the most
bitcoin days.
5. If there's still multiple possible sets, just choose one at random.

Once the final set of addresses has been identified, use ALL UTXOs from
that set, sending appropriate outputs to the recipient(s), a new change
address, and a mining fee.

Miners should be cognisant of and reward the fact that the user is making
an effort to consolidate UTXOs. They can easily spot these transactions by
looking at whether all possible UTXOs from each input addresses have been
used. Since most miners use Bitcoin Core, and its defaults, this test can
be built into Bitcoin Core's logic for determining which transactions to
include when mining a block.

--
*James G. Phillips IV*
<https://plus.google.com/u/0/113107039501292625391/posts>
<http://www.linkedin.com/in/ergophobe>

*"Don't bunt. Aim out of the ball park. Aim for the company of immortals."
-- David Ogilvy*

 *This message was created with 100% recycled electrons. Please think twice
before printing.*

On Sat, May 9, 2015 at 3:38 PM, Pieter Wuille <pieter.wuille@gmail•com>
wrote:

> Miners do not care about the age of a UTXO entry, apart for two
> exceptions. It is also economically irrelevant.
> * There is a free transaction policy, which sets a small portion of block
> space aside for transactions which do not pay sufficient fee. This is
> mostly an altruistic way of encouraging Bitcoin adoption. As a DoS
> prevention mechanism, there is a requirement that these free transactions
> are of sufficient priority (computed as BTC-days-destroyed per byte),
> essentially requiring these transactions to consume another scarce
> resource, even if not money.
> * Coinbase transaction outputs can, as a consensus rule, only be spent
> after 100 confirmations. This is to prevent random reorganisations from
> invalidating transactions that spend young coinbase transactions (which
> can't move to the new chain). In addition, wallets also select more
> confirmed outputs first to consume, for the same reason.
> On May 9, 2015 1:20 PM, "Raystonn" <raystonn@hotmail•com> wrote:
>
>> That policy is included in Bitcoin Core.  Miners use it because it is the
>> default.  The policy was likely intended to help real transactions get
>> through in the face of spam.  But it favors those with more bitcoin, as the
>> priority is determined by amount spent multiplied by age of UTXOs.  At the
>> very least the amount spent should be removed as a factor, or fees are
>> unlikely to ever be paid by those who can afford them.  We can reassess the
>> role age plays later.  One change at a time is better.
>>  On 9 May 2015 12:52 pm, Jim Phillips <jim@ergophobia•org> wrote:
>>
>> On Sat, May 9, 2015 at 2:43 PM, Raystonn <raystonn@hotmail•com> wrote:
>>
>> How about this as a happy medium default policy: Rather than select UTXOs
>> based solely on age and limiting the size of the transaction, we select as
>> many UTXOs as possible from as few addresses as possible, prioritizing
>> which addresses to use based on the number of UTXOs it contains (more being
>> preferable) and how old those UTXOs are (in order to reduce the fee)?
>>
>> If selecting older UTXOs gives higher priority for a lesser (or at least
>> not greater) fee, that is an incentive for a rational user to use the older
>> UTXOs.  Such policy needs to be defended or removed.  It doesn't support
>> privacy or a reduction in UTXOs.
>>
>> Before starting this thread, I had completely forgotten that age was even
>> a factor in determining which UTXOs to use. Frankly, I can't think of any
>> reason why miners care how old a particular UTXO is when determining what
>> fees to charge. I'm sure there is one, I just don't know what it is. I just
>> tossed it in there as homage to Andreas who pointed out to me that it was
>> still part of the selection criteria.
>>
>>

[-- Attachment #2: Type: text/html, Size: 6355 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 20:20 Raystonn
@ 2015-05-09 20:38 ` Pieter Wuille
  2015-05-09 21:11   ` Jim Phillips
  0 siblings, 1 reply; 45+ messages in thread
From: Pieter Wuille @ 2015-05-09 20:38 UTC (permalink / raw)
  To: Raystonn; +Cc: Bitcoin Dev, Andreas Schildbach

[-- Attachment #1: Type: text/plain, Size: 2695 bytes --]

Miners do not care about the age of a UTXO entry, apart for two exceptions.
It is also economically irrelevant.
* There is a free transaction policy, which sets a small portion of block
space aside for transactions which do not pay sufficient fee. This is
mostly an altruistic way of encouraging Bitcoin adoption. As a DoS
prevention mechanism, there is a requirement that these free transactions
are of sufficient priority (computed as BTC-days-destroyed per byte),
essentially requiring these transactions to consume another scarce
resource, even if not money.
* Coinbase transaction outputs can, as a consensus rule, only be spent
after 100 confirmations. This is to prevent random reorganisations from
invalidating transactions that spend young coinbase transactions (which
can't move to the new chain). In addition, wallets also select more
confirmed outputs first to consume, for the same reason.
On May 9, 2015 1:20 PM, "Raystonn" <raystonn@hotmail•com> wrote:

> That policy is included in Bitcoin Core.  Miners use it because it is the
> default.  The policy was likely intended to help real transactions get
> through in the face of spam.  But it favors those with more bitcoin, as the
> priority is determined by amount spent multiplied by age of UTXOs.  At the
> very least the amount spent should be removed as a factor, or fees are
> unlikely to ever be paid by those who can afford them.  We can reassess the
> role age plays later.  One change at a time is better.
>  On 9 May 2015 12:52 pm, Jim Phillips <jim@ergophobia•org> wrote:
>
> On Sat, May 9, 2015 at 2:43 PM, Raystonn <raystonn@hotmail•com> wrote:
>
> How about this as a happy medium default policy: Rather than select UTXOs
> based solely on age and limiting the size of the transaction, we select as
> many UTXOs as possible from as few addresses as possible, prioritizing
> which addresses to use based on the number of UTXOs it contains (more being
> preferable) and how old those UTXOs are (in order to reduce the fee)?
>
> If selecting older UTXOs gives higher priority for a lesser (or at least
> not greater) fee, that is an incentive for a rational user to use the older
> UTXOs.  Such policy needs to be defended or removed.  It doesn't support
> privacy or a reduction in UTXOs.
>
> Before starting this thread, I had completely forgotten that age was even
> a factor in determining which UTXOs to use. Frankly, I can't think of any
> reason why miners care how old a particular UTXO is when determining what
> fees to charge. I'm sure there is one, I just don't know what it is. I just
> tossed it in there as homage to Andreas who pointed out to me that it was
> still part of the selection criteria.
>
>

[-- Attachment #2: Type: text/html, Size: 3718 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
@ 2015-05-09 20:20 Raystonn
  2015-05-09 20:38 ` Pieter Wuille
  0 siblings, 1 reply; 45+ messages in thread
From: Raystonn @ 2015-05-09 20:20 UTC (permalink / raw)
  To: Jim Phillips; +Cc: Bitcoin Dev, Andreas, Schildbach

[-- Attachment #1: Type: text/html, Size: 2511 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 19:43 Raystonn
@ 2015-05-09 19:52 ` Jim Phillips
  0 siblings, 0 replies; 45+ messages in thread
From: Jim Phillips @ 2015-05-09 19:52 UTC (permalink / raw)
  To: Raystonn; +Cc: Bitcoin Dev, Andreas Schildbach

[-- Attachment #1: Type: text/plain, Size: 1129 bytes --]

On Sat, May 9, 2015 at 2:43 PM, Raystonn <raystonn@hotmail•com> wrote:

> How about this as a happy medium default policy: Rather than select UTXOs
>> based solely on age and limiting the size of the transaction, we select as
>> many UTXOs as possible from as few addresses as possible, prioritizing
>> which addresses to use based on the number of UTXOs it contains (more being
>> preferable) and how old those UTXOs are (in order to reduce the fee)?
>
> If selecting older UTXOs gives higher priority for a lesser (or at least
> not greater) fee, that is an incentive for a rational user to use the older
> UTXOs.  Such policy needs to be defended or removed.  It doesn't support
> privacy or a reduction in UTXOs.
>
Before starting this thread, I had completely forgotten that age was even a
factor in determining which UTXOs to use. Frankly, I can't think of any
reason why miners care how old a particular UTXO is when determining what
fees to charge. I'm sure there is one, I just don't know what it is. I just
tossed it in there as homage to Andreas who pointed out to me that it was
still part of the selection criteria.

[-- Attachment #2: Type: text/html, Size: 1800 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
@ 2015-05-09 19:43 Raystonn
  2015-05-09 19:52 ` Jim Phillips
  0 siblings, 1 reply; 45+ messages in thread
From: Raystonn @ 2015-05-09 19:43 UTC (permalink / raw)
  To: Jim Phillips; +Cc: Bitcoin Dev, Andreas, Schildbach

[-- Attachment #1: Type: text/html, Size: 1387 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
  2015-05-09 19:25 [Bitcoin-development] A suggestion for reducing the size of the UTXO database Raystonn
@ 2015-05-09 19:33 ` Jim Phillips
  0 siblings, 0 replies; 45+ messages in thread
From: Jim Phillips @ 2015-05-09 19:33 UTC (permalink / raw)
  To: Raystonn; +Cc: Bitcoin Dev, Andreas Schildbach

[-- Attachment #1: Type: text/plain, Size: 602 bytes --]

On Sat, May 9, 2015 at 2:25 PM, Raystonn <raystonn@hotmail•com> wrote:

> Lack of privacy is viral.  We shouldn't encourage policy in most wallets
> that discourages privacy.  It adversely affects privacy across the entire
> network.
>
How about this as a happy medium default policy: Rather than select UTXOs
based solely on age and limiting the size of the transaction, we select as
many UTXOs as possible from as few addresses as possible, prioritizing
which addresses to use based on the number of UTXOs it contains (more being
preferable) and how old those UTXOs are (in order to reduce the fee)?

[-- Attachment #2: Type: text/html, Size: 917 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database
@ 2015-05-09 19:25 Raystonn
  2015-05-09 19:33 ` Jim Phillips
  0 siblings, 1 reply; 45+ messages in thread
From: Raystonn @ 2015-05-09 19:25 UTC (permalink / raw)
  To: Jim Phillips; +Cc: Bitcoin Dev, Andreas, Schildbach

[-- Attachment #1: Type: text/html, Size: 2293 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2015-05-27 19:29 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-09 17:09 [Bitcoin-development] A suggestion for reducing the size of the UTXO database Jim Phillips
2015-05-09 18:45 ` Peter Todd
2015-05-09 19:02   ` Jim Phillips
2015-05-09 19:00 ` Andreas Schildbach
2015-05-09 19:05   ` Jim Phillips
2015-05-09 19:06   ` Pieter Wuille
2015-05-09 19:16     ` Jim Phillips
2015-05-09 19:43       ` Ross Nicoll
     [not found] ` <3862E01F-FD0F-48F5-A6D9-F8E0FB0AB68F@newcastle.ac.uk>
     [not found]   ` <CANe1mWys1gAO1CgPEpD7rdtXF2KYfvXA6bc0q-rAzg9xOFc-5A@mail.gmail.com>
     [not found]     ` <8029969D-FD22-43F7-930D-CEC7A87CEAD5@newcastle.ac.uk>
2015-05-09 19:28       ` Jim Phillips
2015-05-10  2:11 ` Matt Whitlock
2015-05-10 12:11   ` Jim Phillips
2015-05-25 18:41   ` Mike Hearn
2015-05-25 20:03     ` Matt Whitlock
2015-05-25 20:29       ` Andreas Schildbach
2015-05-25 21:05         ` Peter Todd
2015-05-26 12:40           ` Andreas Schildbach
2015-05-25 21:14         ` Warren Togami Jr.
2015-05-25 21:12       ` Mike Hearn
2015-05-10 13:35 ` Bob McElrath
2015-05-10 14:33   ` Jeff Garzik
2015-05-10 14:42     ` Bob McElrath
2015-05-12 19:50 ` Danny Thorpe
2015-05-25 18:44 ` Mike Hearn
2015-05-25 21:26   ` Peter Todd
2015-05-25 22:03     ` Mike Hearn
2015-05-26  0:10       ` [Bitcoin-development] Cost savings by using replace-by-fee, 30-90% Peter Todd
2015-05-26 18:22         ` Danny Thorpe
2015-05-26 18:38           ` Allen Piscitello
2015-05-26 18:42           ` Aaron Voisine
2015-05-26 18:47           ` Adam Back
2015-05-26 20:18           ` Matt Whitlock
2015-05-26 20:30         ` joliver
2015-05-26 20:56           ` Mark Friedenbach
2015-05-26 21:29           ` s7r
2015-05-26 22:06             ` Adam Back
2015-05-27  1:25             ` Peter Todd
2015-05-27 19:28               ` s7r
2015-05-26 22:29           ` Jeff Garzik
2015-05-09 19:25 [Bitcoin-development] A suggestion for reducing the size of the UTXO database Raystonn
2015-05-09 19:33 ` Jim Phillips
2015-05-09 19:43 Raystonn
2015-05-09 19:52 ` Jim Phillips
2015-05-09 20:20 Raystonn
2015-05-09 20:38 ` Pieter Wuille
2015-05-09 21:11   ` Jim Phillips

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox