Bitcoin Forum

Bitcoin => Electrum => Topic started by: panda9228 on February 19, 2014, 09:44:23 PM



Title: Question about Electrum seed and multiple addresses
Post by: panda9228 on February 19, 2014, 09:44:23 PM
Just a quick clarification.  Say I create an electrum wallet and it automatically generates me 5 addresses.  I save the seed.  I receive bitcoins at multiple addresses, causing electrum to automatically generate me new addresses.  In the end I have bitcoins stored at 30 addresses in my one Electrum wallet.

Now my computer gets fried.  I buy a new computer and install Electrum, and re-create my wallet using the seed.  Will all 30 of my addresses (and coins) be restored, or only the original 5?


Title: Re: Question about Electrum seed and multiple addresses
Post by: dreamspark on February 19, 2014, 09:56:05 PM
When you are recreating a wallet from scratch you do not know which is the last address used. So you start at the beginning and see what is on the blockchain. Then you look for the next one in the sequence. The gap limit is how many 'misses' you accept before you give up and stop looking. The coins would not be lost you just need to remember the gap limit that you used.


Title: Re: Question about Electrum seed and multiple addresses
Post by: panda9228 on February 20, 2014, 02:03:47 AM
Then you look for the next one in the sequence.

This is the part I don't understand.  Does my seed simply signify the start of an infinite, specific sequence of addresses?  Such that if I start from address 1 and generate up to address 100... I could delete my wallet and the seed would create that exact same sequence again?

To be more clear, is it already determined what the 500th address/key pair in my electrum wallet will be? (based on my seed)


Title: Re: Question about Electrum seed and multiple addresses
Post by: Abdussamad on February 20, 2014, 10:52:20 AM
Then you look for the next one in the sequence.

This is the part I don't understand.  Does my seed simply signify the start of an infinite, specific sequence of addresses?  Such that if I start from address 1 and generate up to address 100... I could delete my wallet and the seed would create that exact same sequence again?

Yes.

You can also independently generate all addresses with just the master public key. You will only get the addresses + public keys not their private keys so you won't be able to spend the coins sent to those addresses. But you can create a watch only wallet using the master public key.

Quote
To be more clear, is it already determined what the 500th address/key pair in my electrum wallet will be? (based on my seed)

Already determined by whom? This sounds like a philosophical question :) Private keys are basically really, really large numbers so they all already exist in that sense. The security stems from the fact that finding private keys with coins in them is hard because of the large number of possible keys.

Anyway your wallet doesn't calculate the 500th key until it needs to (say because you've received coins at number 496) or you tell it to.


Title: Re: Question about Electrum seed and multiple addresses
Post by: panda9228 on February 21, 2014, 07:18:01 AM

Quote
To be more clear, is it already determined what the 500th address/key pair in my electrum wallet will be? (based on my seed)

Already determined by whom? This sounds like a philosophical question :) Private keys are basically really, really large numbers so they all already exist in that sense. The security stems from the fact that finding private keys with coins in them is hard because of the large number of possible keys.

Anyway your wallet doesn't calculate the 500th key until it needs to (say because you've received coins at number 496) or you tell it to.

I mean determined by the seed, not in a philosophical sense.  Like if today I say "tomorrow I will create a paper wallet on bitaddress", there's no way to what that address/key will be yet.  Because there is still randomization to be done.  My question is whether there is any randomization done when Electrum starts expanding my wallet to include new addresses.

From what you're saying it sounds like all the randomizing occurs when the seed is created, and from there it's simply a matter of calculating a foregone conclusion.  Which would mean if I received coins at number 496 then lost my wallet, all my coins would be recoverable if I have my seed.  Is this correct?


Title: Re: Question about Electrum seed and multiple addresses
Post by: deepceleron on February 21, 2014, 07:21:17 AM
Electrum uses a deterministic wallet. All addresses it will ever create are based on the initial seed, using a cryptographic algorithm. Therefore, all addresses you will ever "create" can be recreated by a backup of just the seed.


Title: Re: Question about Electrum seed and multiple addresses
Post by: Abdussamad on February 21, 2014, 08:54:16 AM
Which would mean if I received coins at number 496 then lost my wallet, all my coins would be recoverable if I have my seed.  Is this correct?

Yes.