Author

Topic: how to verify seed (Read 824 times)

sr. member
Activity: 475
Merit: 252
May 16, 2014, 04:40:37 AM
#6
I am trying the following:

Code:

password = None;
  
seed="constant forest adore false green weave stop guy fur freeze giggle clock";
  
seed = pw_decode(seed, password).encode('utf8');
print seed;
oldseed = seed
for i in range(100000):
seed = hashlib.sha256(seed + oldseed).digest()
newseed=string_to_number( seed );

print newseed;
print "----";
curve = SECP256k1
master_private_key = ecdsa.SigningKey.from_secret_exponent( newseed, curve = SECP256k1 );
master_public_key = master_private_key.get_verifying_key().to_string().encode('hex');
print master_public_key;


However it doesn't give me the correct master public key.  What am I doing wrong?


The 12 words are not your encoded seed, they are your decoded seed. You must convert mnemonic to hex, no password needed.

Code:
from electrum import mnemonic

seed = mnemonic.mn_decode(["constant", "forest", "adore", "false", "green", "weave", "stop", "guy", "fur", "freeze", "giggle", "clock"])

will make seed your unencrypted seed. The rest should be fine.

Edit:
Actually the input to the mn_decode should be a dict of strings and not a single string
legendary
Activity: 1302
Merit: 1008
Core dev leaves me neg feedback #abuse #political
May 15, 2014, 10:07:12 PM
#5
I am trying the following:

Code:

password = None;
 
seed="constant forest adore false green weave stop guy fur freeze giggle clock";
 
seed = pw_decode(seed, password).encode('utf8');
print seed;
oldseed = seed
for i in range(100000):
seed = hashlib.sha256(seed + oldseed).digest()
newseed=string_to_number( seed );

print newseed;
print "----";
curve = SECP256k1
master_private_key = ecdsa.SigningKey.from_secret_exponent( newseed, curve = SECP256k1 );
master_public_key = master_private_key.get_verifying_key().to_string().encode('hex');
print master_public_key;


However it doesn't give me the correct master public key.  What am I doing wrong?

legendary
Activity: 3696
Merit: 1584
legendary
Activity: 1302
Merit: 1008
Core dev leaves me neg feedback #abuse #political
March 15, 2014, 05:16:23 PM
#3
I guess the real question is how does it create the private key from the seed?
legendary
Activity: 1106
Merit: 1016
090930
March 15, 2014, 12:30:34 PM
#2

If I want to encrypt the seed manually to verify that its the same private key
generated as electrum, uses, can I use something like this:

http://aes.online-domain-tools.com/

I assume I would put the key in the input text field, but
what would i put in the key field?

That's not how AES works - AES (when used in the most common way) never produces the same output twice.
Unfortunately I don't have much time to elaborate, but you can easily research that online.
legendary
Activity: 1302
Merit: 1008
Core dev leaves me neg feedback #abuse #political
March 15, 2014, 10:21:35 AM
#1
 
If I want to encrypt the seed manually to verify that its the same private key
generated as electrum, uses, can I use something like this:

http://aes.online-domain-tools.com/

I assume I would put the key in the input text field, but
what would i put in the key field?
Jump to: