0

I'm not sure how to combine all of this information. https://blockchain.info/block/00000000096af43105123c499521e1d131d172e7e1bf2ed0843290a921f1f6a7

Version 1

Time Bits 470771548 (is this the right number to use for Time Bits?)

Merkle Root ff682ef66cd1b56213fd4db9462fb138f6d8c16d706d41969a7eacc819528038

Nonce 16641419

Hash of Current Block 00000000096af43105123c499521e1d131d172e7e1bf2ed0843290a921f1f6a7

Hash of Previous Block 00000000023bbab0e78a22d27fbd2d0cd13f8302fb3f560138e0e81d087ac7a1

2 Answers 2

1

take first 160 symbols from https://blockchain.info/block/00000000096af43105123c499521e1d131d172e7e1bf2ed0843290a921f1f6a7?format=hex

should I explain more? :))))

update:

01000000 version

a1c77a081de8e03801563ffb02833fd10c2dbd7fd2228ae7b0ba3b0200000000 prev hash

38805219c8ac7e9a96416d706dc1d8f638b12f46b94dfd1362b5d16cf62e68ff merkle hash

27b80a4c timestamp

5c670f1c bits

8bedfd00 nonce

2
  • Thank you for the reply! I do apologize, I am a still bit confused as to where all of those numbers come from in the link you attached. And why the first 160? Is that in anyway related to RIPE-MD 160? Thanks! Jun 7, 2018 at 16:33
  • this is block in hex format. first 160 symbols are block header (80 bytes)
    – amaclin
    Jun 7, 2018 at 20:29
0

As noted above, you should take the first 80 bytes from the serialized block. Since this data is hex-encoded, and each byte takes two hex-digit to encode, a block header is 80 * 2 = 160 digits.
You will notice that a few fields are inverted, it's because they are represented in little-endian format. Once you double-sha256 this data, you'll find a hash with trailing zeros and not leading, this is also because endianness.

Here is how the mentioned block looks like:
Take the first 160-digits serialized header
01000000a1c77a081de8e03801563ffb02833fd10c2dbd7fd2228ae7b0ba3b020000000038805219c8ac7e9a96416d706dc1d8f638b12f46b94dfd1362b5d16cf62e68ff27b80a4c5c670f1c8bedfd00
And parse:
Version: 01000000 (This is 1 in little-endian)
Previous block hash: a1c77a081de8e03801563ffb02833fd10c2dbd7fd2228ae7b0ba3b0200000000 (Notice the trailing zeroes)
Merkle Root: 38805219c8ac7e9a96416d706dc1d8f638b12f46b94dfd1362b5d16cf62e68ff
Timestamp: 27b80a4c
Bits: 5c670f1c
Nonce: 8bedfd00

A python 3 code that hashes it:

import hashlib
data = bytes.fromhex("01000000a1c77a081de8e03801563ffb02833fd10c2dbd7fd2228ae7b0ba3b020000000038805219c8ac7e9a96416d706dc1d8f638b12f46b94dfd1362b5d16cf62e68ff27b80a4c5c670f1c8bedfd00")
h1 = hashlib.sha256(data).digest()
h2 = hashlib.sha256(h1).digest()
print(h2.hex())

It results in a7f6f121a9903284d02ebfe1e772d131d1e12195493c120531f46a0900000000, that's precisely the little-endian version of 00000000096af43105123c499521e1d131d172e7e1bf2ed0843290a921f1f6a7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.