Bitcoin Forum
April 19, 2024, 12:45:35 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Where is the code that convert public key to address?  (Read 220 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

1713487535
Hero Member
*
Offline Offline

Posts: 1713487535

View Profile Personal Message (Offline)

Ignore
1713487535
Reply with quote  #2

1713487535
Report to moderator
1713487535
Hero Member
*
Offline Offline

Posts: 1713487535

View Profile Personal Message (Offline)

Ignore
1713487535
Reply with quote  #2

1713487535
Report to moderator
1713487535
Hero Member
*
Offline Offline

Posts: 1713487535

View Profile Personal Message (Offline)

Ignore
1713487535
Reply with quote  #2

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

Posts: 1713487535

View Profile Personal Message (Offline)

Ignore
1713487535
Reply with quote  #2

1713487535
Report to moderator
1713487535
Hero Member
*
Offline Offline

Posts: 1713487535

View Profile Personal Message (Offline)

Ignore
1713487535
Reply with quote  #2

1713487535
Report to moderator
1713487535
Hero Member
*
Offline Offline

Posts: 1713487535

View Profile Personal Message (Offline)

Ignore
1713487535
Reply with quote  #2

1713487535
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3374
Merit: 6505


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!