Open ghost opened 8 years ago
Whereas this (as in example in readme)
priv=sha256("blah") # add "01" flag
pub = privtopub(priv) # or compress(privtopub(priv) )
Hex SEC keys require the appended "compressed" byte.
The first example does this automatically when you call wif_compressed
in encode_privkey
Ah, I assumed, due to the example, that it was handled/ a problem with old-timey python. Just looked through main.py.
I think your code deserves more comprehensive documentations. Some really cool stuff in there.
This gives a good address:
priv=sha256("blah") wif = encode_privkey(priv, 'wif_compressed') pub = privtopub(wif) addr = pubtoaddr(pub)
Whereas this (as in example in readme) priv=sha256("blah") pub = privtopub(priv) addr = pubtoaddr(pub)
Gives an incorrect address. (running python2)