Bitcoin Forum

Other => Beginners & Help => Topic started by: paduser on November 11, 2017, 07:54:35 PM



Title: How dows wallet seed restore work?
Post by: paduser on November 11, 2017, 07:54:35 PM
Hi,

I'm looking for some anwsers that I can't figure out my self.

Type 1 deterministic wallet use SHA256(string + n) n=numbers of adress since creation to restore adresses.
Does a Type 2 hierarchical deterministic wallet the same? Just with a seed generated from 12 words out of a list and some mechanics to slow down bruteforce?

Hope someone can help me or point me in the right direction.
Thanks


Title: Re: How dows wallet seed restore work?
Post by: odolvlobo on November 12, 2017, 04:39:32 AM
Hi,

I'm looking for some anwsers that I can't figure out my self.

Type 1 deterministic wallet use SHA256(string + n) n=numbers of adress since creation to restore adresses.
Does a Type 2 hierarchical deterministic wallet the same? Just with a seed generated from 12 words out of a list and some mechanics to slow down bruteforce?

Hope someone can help me or point me in the right direction.
Thanks

The 12 word seed is used directly to generate all the private keys that the wallet will ever use. It works something like this: the first private key is generated by SHA256(seed). The second private key is generated by SHA256(first private key). The third private key is generated by SHA256(second private key), and so on ... but in reality, it is more complicated than that.

There is no need for "some mechanics to slow down bruteforce". Each word is from a list of 2048 words, so each word represents 11 bits of entropy, for a total of 132 bits. However 4 bits are a checksum so the actual entropy is 128 bits.


Title: Re: How dows wallet seed restore work?
Post by: paduser on November 12, 2017, 12:05:37 PM
Thanks for the anwser. You really helped me out.

Quote
but in reality, it is more complicated than that.

So I can't calculate all the private keys manually outside of the wallet software?


Title: Re: How dows wallet seed restore work?
Post by: odolvlobo on November 12, 2017, 07:20:10 PM
Thanks for the anwser. You really helped me out.
Quote
but in reality, it is more complicated than that.
So I can't calculate all the private keys manually outside of the wallet software?

This is exactly how it works (for wallets using BIP-32): https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki


Title: Re: How dows wallet seed restore work?
Post by: paduser on November 13, 2017, 07:43:09 PM
Thanks for the anwser. You really helped me out.
Quote
but in reality, it is more complicated than that.
So I can't calculate all the private keys manually outside of the wallet software?

This is exactly how it works (for wallets using BIP-32): https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki

Thanks