Bitcoin Forum
May 28, 2024, 01:26:39 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: 25MB wallet with 16,915 addresses  (Read 1423 times)
tuaris (OP)
Hero Member
*****
Offline Offline

Activity: 771
Merit: 500



View Profile WWW
October 19, 2014, 03:53:34 PM
 #1

I have a wallet that has grown to 25 MB and has 16,915 addresses due to the amount of transactions being made each day.

Why does this happen?  I understand the technical behavior behind it.  Bitcoin will send 'change' back to a new address in the keypool.  But why does it do that?  Besides 'anonymity' what is the benefit of breaking up my Bitcoins into smaller and smaller outputs?  Is their a technical reason for this? Can it be 'turned off'?

How do I clean this up without having to spend money on fees?  It is going to be a very complex transaction if I want to send all these tiny outputs to a single input, and that will probably end up costing a very large transaction fee.  Also from what I understand, it might not get mined due to the large amount of small inputs.

CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
October 19, 2014, 04:03:51 PM
 #2

You need to do some learning about how Bitcoin works first I think (change addresses are *essential* due to the fact that all UTXOs are fully spent when you create a tx that uses them).

Your issue with tiny amounts will be undoubtedly due to the way you have received your BTC (either via tiny pool payouts, ad-sigs or faucets I would guess).

You can use "coin control" to try and "reduce the UTXO bloat" but seemingly you have gone too far to want to do this all manually so you might want to look into using a script to help you (there are at least one or two available).

In short you *can't clean it up without paying fees* as you have too many very small UTXOs (lesson to be learned - don't get so many small amounts - they are more of a hassle than they are really worth).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
tuaris (OP)
Hero Member
*****
Offline Offline

Activity: 771
Merit: 500



View Profile WWW
October 19, 2014, 04:20:31 PM
 #3

Thanks for the fast response.

change addresses are *essential* due to the fact that all UTXOs are fully spent when you create a tx that uses them.

I understand that it must fully spend.  My question is why does it need to send a new address?  Can't it send back to the original address, the wallet's first address?

Quote
Your issue with tiny amounts will be undoubtedly due to the way you have received your BTC

It's the reverse. I started out with for example 1 BTC in my wallet and sent out several small payments over a period of several months.

Quote
In short you *can't clean it up without paying fees* as you have too many very small UTXOs (lesson to be learned - don't get so many small amounts - they are more of a hassle than they are really worth).

Lesson indeed learned.  Would have using the 'sendmany' function prevented this situation?

CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
October 19, 2014, 04:23:20 PM
 #4

It doesn't really matter much if you *re-use* addresses for change (the address is not the relevant thing - the UTXO *is* so each change UTXO is still another UTXO regardless of what address it is tied to).

You are indeed much better off to use "sendmany" in order to reduce your tx fees (and to reduce your number of *change* UTXOs at the same time).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
tuaris (OP)
Hero Member
*****
Offline Offline

Activity: 771
Merit: 500



View Profile WWW
October 19, 2014, 09:26:48 PM
 #5

It doesn't really matter much if you *re-use* addresses for change (the address is not the relevant thing - the UTXO *is* so each change UTXO is still another UTXO regardless of what address it is tied to).

Thanks for explaining this, now I get it.   Smiley

Bitsky
Hero Member
*****
Offline Offline

Activity: 576
Merit: 514


View Profile
October 20, 2014, 06:31:00 PM
 #6

It doesn't really matter much if you *re-use* addresses for change
For you. It causes bloat. Bitcoin could/should by default just send change back to the origin.

Bounty: Earn up to 68.7 BTC
Like my post? Feel free to drop a tip to 1BitskyZbfR4irjyXDaGAM2wYKQknwX36Y
tuaris (OP)
Hero Member
*****
Offline Offline

Activity: 771
Merit: 500



View Profile WWW
October 20, 2014, 09:58:45 PM
 #7

send change back to the origin.

Thanks to CIYAM above, I now understand why this is not possible.  You can't modify existing UTXO's, that's the reason for the blockchain's existence  Grin.

bitnanigans
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250


View Profile
October 25, 2014, 12:32:46 AM
 #8

Like CIYAM said, the change output address is actually essential, as all the input Bitcoins have to be spent. If no change output is specified, the remaining input value will be considered as fees. The initial reason for creating new addresses for change output was anonymity, but as more people have adopted Bitcoin, that is not very practical and it should be able to evolve. It would be nice if Bitcoin Core had an option to set it to return change to the same address. An alternative option would be to use the createrawtransaction, signrawtransaction and sendrawtransaction Bitcoin RPC calls, but that would require some coding knowledge.

I'm working on an Android wallet which sends change back to one of the original input addresses instead of creating new ones. Hope it have it released soon enough.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!