SHA256 Hash doesn t match the one listed on Bitcoin Wiki

0 votes

I have been trying to create a bitcoin address but somehow, I am getting a different hash than the one shown in step 2.

Calculating the SHA256 hash on:

0250863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352


Gives me the output:

a9ce83de3a0ff3516b7c50cdd787e9f69f152f227d93c9512774231e7132e925


The problem is according to the Bitcoin wiki I should get the following hash:

0b7c28c9b7290c98d7438e70b3d3f7c848fbd7d1dc194ff83f4f7cc9b1378e98


Can someone explain why I am not getting the same hash as the wikipedia?

Feb 28, 2022 in Blockchain by Aditya
• 7,680 points
787 views

1 answer to this question.

0 votes

The problem occurring here is that you are treating the 0250863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352 value as an ASCII string, whereas you should be treating it as a hex representation of 32 bytes.

If you use it as a string, you will get the following result:

echo -n "0250863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352" | openssl sha256 
(stdin)= a9ce83de3a0ff3516b7c50cdd787e9f69f152f227d93c9512774231e7132e925

If you treat it as bytes, then you will get the accurate and precise result:

echo -n "0250863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352" | xxd -p -r | openssl sha256 
(stdin)= 0b7c28c9b7290c98d7438e70b3d3f7c848fbd7d1dc194ff83f4f7cc9b1378e98

answered Feb 28, 2022 by Soham
• 9,710 points

Related Questions In Blockchain

0 votes
1 answer

How to compute SHA256 hash for bitcoin header

header_hex = "02000000aaf8ab82362344f49083ee4edef795362cf135293564c4070000000000000000c009bb6222e9bc4cdb8f26b2e8a2f8d163509691a4038fa692abf9a474c9b21476800755c02e17181fe6c1c3" # Decode header hex into ...READ MORE

answered Aug 31, 2018 in Blockchain by digger
• 26,740 points
1,495 views
+1 vote
3 answers

Is it possible to store data about arbitrary objects on the blockchain using smart contracts?

Basically you implement requested logic on by ...READ MORE

answered Aug 30, 2018 in Blockchain by Artem
1,562 views
+1 vote
2 answers

Hyperledger - Can I have some instances on one network while on a Virtual Box?

Yes, you can connect multiple instances to ...READ MORE

answered Aug 1, 2018 in Blockchain by Omkar
• 69,220 points
913 views
+1 vote
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,460 points
1,459 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,942 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,468 views
0 votes
1 answer

Bitcoin Core on external SSD in OS X

 In order to do so, assuming you ...READ MORE

answered Feb 28, 2022 in Blockchain by Soham
• 9,710 points
1,439 views
0 votes
1 answer

(bitcoin) Calculate hash from getwork function - how to do it?

This is correct as there is a ...READ MORE

answered Feb 28, 2022 in Blockchain by Soham
• 9,710 points
727 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP