Author

Topic: Electrum Reusing Change Addresses (Read 1310 times)

hero member
Activity: 715
Merit: 500
Bitcoin Venezuela
December 14, 2013, 07:11:19 AM
#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.
legendary
Activity: 3710
Merit: 1586
December 14, 2013, 02: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!
sr. member
Activity: 392
Merit: 251
December 14, 2013, 12: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
sr. member
Activity: 392
Merit: 251
December 13, 2013, 08:53:28 PM
#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.
sr. member
Activity: 392
Merit: 251
December 13, 2013, 08:30:58 PM
#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.

sr. member
Activity: 392
Merit: 251
December 13, 2013, 02: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.

hero member
Activity: 715
Merit: 500
Bitcoin Venezuela
December 13, 2013, 02:48:01 PM
#2
sr. member
Activity: 392
Merit: 251
December 13, 2013, 02: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.
Jump to: