Bitcoin Forum
July 06, 2024, 02:46:18 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Electrum Reusing Change Addresses  (Read 1309 times)
fireduck (OP)
Sr. Member
****
Offline Offline

Activity: 392
Merit: 251



View Profile
December 13, 2013, 07:34:43 PM
 #1

Can you tell which output is the payment and which is the change?

https://blockchain.info/tx/f0404453e61351cdec2e0ad849df4624536d1c0ef62ae5dcb2253a3bddca6013

Yes, of course you can.  Electrum is sending the change back to one of its change addresses (18hvXvux6gvDqWac2Lyi5vwp75fZK3jEUY).

I think this is a problem and Electrum should use a new change addresses rather than reusing one.

Bitrated user: fireduck.
btcven
Hero Member
*****
Offline Offline

Activity: 715
Merit: 500


Bitcoin Venezuela


View Profile WWW
December 13, 2013, 07:48:01 PM
 #2

I don't understand well what you say, but I think this is related

http://bitcoin.stackexchange.com/questions/17148/how-can-i-stop-electrum-re-using-change-addresses/17155#17155

Admin: rdymac (PGP) | contacto@bitcoinvenezuela.com | @cafebitcoin | Electrum, lightweight bitcoin client
If I've been helpful tip me a coffee! Cheesy1rdymachKZpA9pTYHYHMYZjfjnoBW6B3k Bitrated user: rdymac.
fireduck (OP)
Sr. Member
****
Offline Offline

Activity: 392
Merit: 251



View Profile
December 13, 2013, 07:58:07 PM
 #3


Interesting.  If there is a time/confirmations component I don't mind as much but I'm not sure there is.

For example: https://blockchain.info/tx/6d97e06863799c1b868199a7a774a88a1e7c6a6c5e5a22b2959a9c50ef4ebe63

This one is using Electrum and nothing changed on that wallet for a long time before.


Bitrated user: fireduck.
fireduck (OP)
Sr. Member
****
Offline Offline

Activity: 392
Merit: 251



View Profile
December 14, 2013, 01:30:58 AM
 #4

Offending bit seems to be:

wallet.py, line 1206:

change_addr = self.accounts[account].get_addresses(1)[-self.gap_limit_for_change]

Read that as, get address from chain 1 (change chain) and go 3 from the end of the list (gap_limit_for_change defaults to 3).

This seems fine, if a transaction is confirmed the list will be extended so -3 should generally be an unused change address.

However, this doesn't jive with my testing.  So I'm guessing that there is some code explicitly reusing a change address if all the funds come from a single change address.  I haven't found that yet.


Bitrated user: fireduck.
fireduck (OP)
Sr. Member
****
Offline Offline

Activity: 392
Merit: 251



View Profile
December 14, 2013, 01:53:28 AM
 #5

commands.py 260:

        for k, v in self.wallet.labels.items():
            if change_addr and v == change_addr:
                change_addr = k

This is probably it.  I think this is saying if one of the inputs is a change address, just use it as the output change address.

Bitrated user: fireduck.
fireduck (OP)
Sr. Member
****
Offline Offline

Activity: 392
Merit: 251



View Profile
December 14, 2013, 05:02:01 AM
 #6

It is entirely possible that I should look at bitcoin addresses beyond the first three characters and everyone should ignore this thread.

168JPchhq3U8GMj89ht21FYPV9eX3Xf3kp != 168hbE5b23GprdVS1xovBXfUhpXGVJyKhX

Bitrated user: fireduck.
Abdussamad
Legendary
*
Offline Offline

Activity: 3640
Merit: 1571



View Profile
December 14, 2013, 07:21:05 AM
 #7

It is entirely possible that I should look at bitcoin addresses beyond the first three characters and everyone should ignore this thread.

168JPchhq3U8GMj89ht21FYPV9eX3Xf3kp != 168hbE5b23GprdVS1xovBXfUhpXGVJyKhX


LOL yeah human nature to do that! Whenever I see a bitcoin address I wonder whether I've seen it before because the first few digits look familiar!
btcven
Hero Member
*****
Offline Offline

Activity: 715
Merit: 500


Bitcoin Venezuela


View Profile WWW
December 14, 2013, 12:11:19 PM
 #8

It is entirely possible that I should look at bitcoin addresses beyond the first three characters and everyone should ignore this thread.

168JPchhq3U8GMj89ht21FYPV9eX3Xf3kp != 168hbE5b23GprdVS1xovBXfUhpXGVJyKhX


Do you think this was the case? I've seen change addresses being reused, but it is a matter of the time between the txs.

I always look at the first three and the last three characters Cheesy There was a proposition to add colors to addresses in the client side of webpages so they are easier to differentiate. I wonder where that is.

Admin: rdymac (PGP) | contacto@bitcoinvenezuela.com | @cafebitcoin | Electrum, lightweight bitcoin client
If I've been helpful tip me a coffee! Cheesy1rdymachKZpA9pTYHYHMYZjfjnoBW6B3k Bitrated user: rdymac.
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!