Bitcoin Forum
November 01, 2024, 11:10:38 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to convert seed into the random entropy?  (Read 433 times)
RealBitcoin (OP)
Hero Member
*****
Offline Offline

Activity: 854
Merit: 1009


JAYCE DESIGNS - http://bit.ly/1tmgIwK


View Profile
August 07, 2016, 08:48:20 AM
 #1

I'm curious how does electrum convert the seed words into the random entropy that is used to generate the private keys. Obviously the 13 word seed format is not the correct format because the private keys are a number not text, so does how electrum does this.

Can somebody post here the code?

btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
August 07, 2016, 06:30:44 PM
 #2

Take a look at the pseudocode in the second half of this response on StackExchange, it may answer your question.
Abdussamad
Legendary
*
Offline Offline

Activity: 3682
Merit: 1580



View Profile
August 08, 2016, 05:28:37 AM
 #3

You can see the function here:

https://github.com/spesmilo/electrum/blob/10d26806d9eb88d063e53ac5acd4a89582e83538/lib/mnemonic.py#L127
RealBitcoin (OP)
Hero Member
*****
Offline Offline

Activity: 854
Merit: 1009


JAYCE DESIGNS - http://bit.ly/1tmgIwK


View Profile
August 10, 2016, 04:32:41 PM
 #4


I`m not sure if I can decypher it correctly, but it seems like the wallet password is added there too into the calculation.

Does this mean that if you don't set a wallet password initially (when you create the wallet), then you will get different private keys?

So the wallet password is an additional source of entropy to the private key or not?

Abdussamad
Legendary
*
Offline Offline

Activity: 3682
Merit: 1580



View Profile
August 11, 2016, 10:54:34 AM
 #5

So the wallet password is an additional source of entropy to the private key or not?

No it's not because then your seed would change everytime you changed the password. Even though the code says passphrase we have to follow the actual function calls to see what's being passed in there:

https://github.com/spesmilo/electrum/blob/f061fe047d9a6ac82ccca5e6d0911b7e088bf2f0/lib/wallet.py#L1757

You can see that calls to mnemonic_to_seed have a blank passphrase argument.
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!