• Welcome to forex.pm forex forum binary options trade. Please login or sign up.
 

Trying to validade a bitcoin block

Started by Bitcoin, Feb 22, 2022, 04:24 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bitcoin

Trying to validade a bitcoin block

So I'm trying to validade a bitcoin block just for curiosity, let's take for example bitcoin block #1 (https://bitpay.com/insight/#/BTC/mainnet/block/00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048)
So the header will be something like:



  • version = 0x00000001

  • hash of previous block = 0x0000000000000000000000000000000000000000000000000000000000000000

  • hash of merkle root = 0x0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098

  • time stamp = 0x49676521 (9th jan 2009, 12:54:25 GMT-2)

  • Target = 0x1d00ffff

  • Nonce = 0x9962E301 (2573394689 in hex)


So the final header is: "0x0000000100000000000000000000000000000000000000000000000000000000000000000e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098496765211d00ffff9962E301", but when I use this header here: "https://emn178.github.io/online-tools/sha256.html"
I get the first answer "0x8b35dccfcd6775827147594afa923bcc2b10645ef24aa3d22b22c2b0bed17ea2" and I use the first answer to get the double sha-256 but I'm getting "4d154a2d19d08ccc9328bcce8d965bdd3285035a40936fb43fd8da4d9dc5392e" instead of the "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048" that I was expecting. Does anyone have any idea of what I'm doing wrong? Maybe the site is wrong?


Source: Trying to validade a bitcoin block