Bitcoin Forum
May 06, 2024, 04:25:12 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Where is the code that convert public key to address?  (Read 221 times)
Eildosa (OP)
Member
**
Offline Offline

Activity: 572
Merit: 10


View Profile
June 17, 2018, 09:07:32 PM
 #1

Hi,

I can't find where in the bitcoin core code is the public key -> address conversion code.
My C++ being very rusty it might be just in front of me.

If any of you know, I'm all ears Smiley

Thanks.

PS : I know how it is done, but I'd like to see the actual cpp code

1715012712
Hero Member
*
Offline Offline

Posts: 1715012712

View Profile Personal Message (Offline)

Ignore
1715012712
Reply with quote  #2

1715012712
Report to moderator
"Your bitcoin is secured in a way that is physically impossible for others to access, no matter for what reason, no matter how good the excuse, no matter a majority of miners, no matter what." -- Greg Maxwell
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
June 18, 2018, 02:45:27 AM
Merited by Lutpin (1), RGBKey (1)
 #2

The addresses are encoded here: https://github.com/bitcoin/bitcoin/blob/da9a2f5cd9032ee22acc5c2dc175e6934f63132c/src/key_io.cpp#L19. The specific functions that do the encoding are https://github.com/bitcoin/bitcoin/blob/ad823178e85aa070e5ec62799c17c36210b0dd7a/src/base58.cpp#L133 and https://github.com/bitcoin/bitcoin/blob/1d4662f5dcf64bd8cbab7386616461b570e93e67/src/bech32.cpp#L146

Eildosa (OP)
Member
**
Offline Offline

Activity: 572
Merit: 10


View Profile
June 18, 2018, 05:45:04 PM
 #3

Thank you very much Cheesy

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!