From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YrQ5S-0006rC-0A for bitcoin-development@lists.sourceforge.net; Sun, 10 May 2015 12:12:02 +0000 X-ACL-Warn: Received: from mail-wg0-f54.google.com ([74.125.82.54]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YrQ5Q-0002c6-50 for bitcoin-development@lists.sourceforge.net; Sun, 10 May 2015 12:12:01 +0000 Received: by wgin8 with SMTP id n8so106412722wgi.0 for ; Sun, 10 May 2015 05:11:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=CYjaIXSHWfdq6E9WBlBFMkxJUD9UCmSbpOkyQYNCHQg=; b=jHO40t0miwJWUStm/0j8mcJE3EFrkM39g9Rw4ciamXgeFtAuc6dBc/iegoKIu+afkx yg4YAmgt/CEhCHhGRcbTRehX7IG6jjn2KQiet3B+rppq/ISct5MA8hxS4FQo3OSK7I6p vZ99NAvedIm9adqrO6n16mAj8zXuh2DhV1gVqVi9v3AO1y9f+LSkg7k3yZjNLPlwjeuc q3wL6f1WphgBfwh5LlDOJM0G/4quabDuRfRWpKBdu5CHvp8gWaI2rZBLEHpd1XIGmwAZ OD20RvAmfJLUgZ/damy8NvjEb7gglbWM/vMXGO95dZ/HfC+B2gm4cjFRX/H/f2KEVlUl y/OQ== X-Gm-Message-State: ALoCoQnPN3eHqmZ7H9YHC6hSxJXdE+DHdBAMasMvSZDZPuueO5Ge7q9SZ0z4MbaYhMfWDG+4jTI3 MIME-Version: 1.0 X-Received: by 10.180.82.97 with SMTP id h1mr11346519wiy.26.1431259914027; Sun, 10 May 2015 05:11:54 -0700 (PDT) Received: by 10.194.246.69 with HTTP; Sun, 10 May 2015 05:11:53 -0700 (PDT) Received: by 10.194.246.69 with HTTP; Sun, 10 May 2015 05:11:53 -0700 (PDT) In-Reply-To: <2114827.D6GUhXtGkV@crushinator> References: <2114827.D6GUhXtGkV@crushinator> Date: Sun, 10 May 2015 07:11:53 -0500 Message-ID: From: Jim Phillips To: Matt Whitlock Content-Type: multipart/alternative; boundary=f46d04426730c1da400515b92a8e X-Spam-Score: 1.0 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 1.0 HTML_MESSAGE BODY: HTML included in message X-Headers-End: 1YrQ5Q-0002c6-50 Cc: Bitcoin Dev Subject: Re: [Bitcoin-development] A suggestion for reducing the size of the UTXO database X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2015 12:12:02 -0000 --f46d04426730c1da400515b92a8e Content-Type: text/plain; charset=UTF-8 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" 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* > > > > > > *"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.* > --f46d04426730c1da400515b92a8e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

I feel your pain. I've had the same thing happen to me i= n the past. And I agree it's more likely to occur with my proposed sche= me 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 smalles= t 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 t= he user. In fact, quite often I've wished for a configuration option li= ke "Try to maintain _[number]_ UTXOs in the wallet." This is beca= use I often want to make multiple spends from my wallet within one block, b= ut 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 ho= w aggravating it is to have to tell a friend, "Oh, oops, I can't p= ay 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 dea= l
> with it at the source of the problem -- the wallets. Right now, the ty= pical
> wallet selects only the minimum number of unspent outputs when buildin= g 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? W= hen
> selecting unspent outputs for a transaction, rather than choosing just= the
> minimum number from a particular address, why not select them ALL? Tak= e all
> of the UTXOs from a particular address or wallet, send however much ne= eds
> to be spent to the payee, and send the rest back to the same address o= r 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 data= base
> 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 wit= h
> spendable bitcoin. But this idea could limit the growth at least.
>
> The vast majority of users are running one of a handful of different w= allet
> 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 t= o one
> that reduces the UTXO database instead of growing it.
>
> >From the miners perspective, even though these types of transactio= ns would
> be larger, the fee could stay low. Miners actually benefit from them i= n
> 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 w= ith a
> higher priority despite a low fee.
>
> Relays could also get in on the action and enforce this type of behavi= or 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. Rela= ys
> are not only the ones who benefit the most from a reduction of the UTX= O
> database, they're also in the best position to promote good behavi= or.
>
> --
> *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 o= f immortals."
> -- David Ogilvy*
>
>=C2=A0 *This message was created with 100% recycled electrons. Please t= hink twice
> before printing.*
--f46d04426730c1da400515b92a8e--