Title: Python brainwallet generation - hash160 problem Post by: Sukrim on March 10, 2013, 12:00:31 AM Code (Python 2.7):
Code: import hashlib I want to perform steps 2+3 from https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses The hexdigest of the sha256 hash is the correct one for an empty input. According to https://bitcointools.appspot.com/?s=&r=1 hash160 however should be b5bd079c4d57cc7fc28ecf8213a6b791625b8183, not the one I came up with. https://github.com/weex/addrgen/blob/master/addrgen.py from line 71 on does exactly the same thing I do here (just outputting the digest, not hexdigest) and does call the result from this "hash160" later in the code. Where/what is my error?! Title: Re: Python brainwallet generation - hash160 problem Post by: Joric on March 29, 2013, 05:49:51 PM Oh my. You should use hash160.update(hashlib.sha256(PUBLIC_KEY).digest()), and you can't calculate public key without using Elliptic Curve DSA.
Code: import hashlib |