Bitcoin Forum
June 19, 2018, 01:47:45 AM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Good reference for converting Bitcoin public key to address  (Read 376 times)
pilotniq
Jr. Member
*
Offline Offline

Activity: 31
Merit: 0


View Profile
May 24, 2013, 08:37:49 AM
 #1

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
1529372865
Hero Member
*
Offline Offline

Posts: 1529372865

View Profile Personal Message (Offline)

Ignore
1529372865
Reply with quote  #2

1529372865
Report to moderator
1529372865
Hero Member
*
Offline Offline

Posts: 1529372865

View Profile Personal Message (Offline)

Ignore
1529372865
Reply with quote  #2

1529372865
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1529372865
Hero Member
*
Offline Offline

Posts: 1529372865

View Profile Personal Message (Offline)

Ignore
1529372865
Reply with quote  #2

1529372865
Report to moderator
JahPowerBit
Sr. Member
****
Offline Offline

Activity: 300
Merit: 250


Counterparty Developer


View Profile
May 24, 2013, 09:41:09 AM
 #2

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)

.
   █████▄▄▄▄
   ████████████▄▄▄            ▀██████
   ███ ▀▀▀▀█████████▄          ▀█████
   ███         ▀▀▀█████▄         ▀███
   ███              ▀▀████▄▄███    ▀▀
   ███                ▀███████▀
   ███                    █████
   ███     ███▄         ▄███████
   ▐██▌     ▀███▄     ▄███▀  ███
   ▐███       ▀███▄▄ ███▀     ███
    ███▌        ▀████        ▐██▌
     ███         ████         ███
      ███      ▄█████▄       ▐██
       ███   ▄████▀ ▀███▄     ▐██
        ███▄████▀     ▀███▄   ███
         █████▀         ▀███▄████
          ██▀             ▀█████▌
                            ▀███▌
  ██████                      ▀▀
  ▀▀▀███
     ███
█         █   ███
 █        ███  ███  █
███       ███   █  ███
███   █   ███   █  ███
███  ███   █       ███
███  ███   █       ███
 █   ███            █
 █    █             █
█         █   ███
 █        ███  ███  █
███       ███   █  ███
███   █   ███   █  ███
███  ███   █       ███
███  ███   █       ███
 █   ███            █
 █    █             █
             JOIN US             
TELEGRAM TWITTER FACEBOOK
LINKEDIN WHITEPAPER
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!