Bitcoin Forum
May 29, 2024, 08:41:21 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Address Generation Procedure  (Read 121 times)
guitarplinker (OP)
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?
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), ABCbits (1), nc50lc (1), guitarplinker (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: 2982
Merit: 4193



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.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
guitarplinker (OP)
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!