Bitcoin Forum

Other => Beginners & Help => Topic started by: pilotniq on May 24, 2013, 08:37:49 AM



Title: Good reference for converting Bitcoin public key to address
Post by: pilotniq on May 24, 2013, 08:37:49 AM
I was debugging some code to convert a bitcoin public key to an address, and had great use of this diagram posted by etothepi:

http://dl.dropbox.com/u/1139081/BitcoinImg/PubKeyToAddr.png


Title: Re: Good reference for converting Bitcoin public key to address
Post by: JahPowerBit on May 24, 2013, 09:41:09 AM
Look at this code : https://github.com/weex/addrgen

you can do something like this:

pubkey = ".........".decode('hex')
hash160 = rhash(pubkey)
addr = base58_check_encode(hash160, self.version)