Bitcoin Forum
March 08, 2021, 07:14:24 AM *
News: Latest Bitcoin Core release: 0.21.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Address Generation Procedure  (Read 111 times)
guitarplinker
Legendary
*
Offline Offline

Activity: 1694
Merit: 1024



View Profile WWW
November 21, 2020, 01:09:10 AM
Merited by suchmoon (4), o_e_l_e_o (2)
 #1

I'm trying to understand the steps for generating a bitcoin address on this wiki page, but the step 2 (SHA256 hash of ECDSA pub key) value isn't lining up:

Code:
user@computer:~$ echo -n "0250863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352" | sha256sum
a9ce83de3a0ff3516b7c50cdd787e9f69f152f227d93c9512774231e7132e925  -


The expected value is 0b7c28c9b7290c98d7438e70b3d3f7c848fbd7d1dc194ff83f4f7cc9b1378e98. I tried following the steps on this page but encountered the same behavior. Does anyone see where I'm going wrong in following these guides?
1615187664
Hero Member
*
Offline Offline

Posts: 1615187664

View Profile Personal Message (Offline)

Ignore
1615187664
Reply with quote  #2

1615187664
Report to moderator
1615187664
Hero Member
*
Offline Offline

Posts: 1615187664

View Profile Personal Message (Offline)

Ignore
1615187664
Reply with quote  #2

1615187664
Report to moderator
1615187664
Hero Member
*
Offline Offline

Posts: 1615187664

View Profile Personal Message (Offline)

Ignore
1615187664
Reply with quote  #2

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

Posts: 1615187664

View Profile Personal Message (Offline)

Ignore
1615187664
Reply with quote  #2

1615187664
Report to moderator
1615187664
Hero Member
*
Offline Offline

Posts: 1615187664

View Profile Personal Message (Offline)

Ignore
1615187664
Reply with quote  #2

1615187664
Report to moderator
Entontothekeseczi
Newbie
*
Offline Offline

Activity: 6
Merit: 9


View Profile
November 21, 2020, 02:07:07 AM
Merited by suchmoon (4), o_e_l_e_o (2), ETFbitcoin (1), guitarplinker (1), nc50lc (1)
 #2

Code:
echo -n "0250863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352" | xxd -r -p | sha256sum
sha256sum needs the bytes not the ascii representation of the hex-encoded, compressed public key.
xxd takes care of the conversion and should come with vim package in case you don't have it yet.
ranochigo
Legendary
*
Offline Offline

Activity: 2268
Merit: 1945

@ me if you need my response


View Profile
November 21, 2020, 02:17:21 AM
Merited by guitarplinker (1)
 #3

Your SHA256 value, are you calculating it using ASCII or hex? Most online converters tend to treat the value that you've entered as ASCII while Bitcoin treats it as hex.

guitarplinker
Legendary
*
Offline Offline

Activity: 1694
Merit: 1024



View Profile WWW
November 21, 2020, 02:31:52 PM
 #4

Thank you both for clarifying, converting the hex values to their corresponding character values before hashing did the trick!
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!