In blockchain, particular bitcoin why is difficulty not part of the Block but merkleroothash is

2

After some consideration I came up with two assumptions, please correct me if I am way off here.

  • The merkleroot being part of the block information is a validation shortcut?

  • Difficulty not being part of the block information is due to the fact this can be derrived from the version header? (but this would require to have all difficulties being hardcoded forever into the code? This doesn't rhyme with dynamic difficulty, so basically I am wondering how a block can be validated without seemingly "knowing" its difficulty)

JX. Unit

Posted 2017-10-02T09:14:39.570

Reputation: 23

Answers

1

The merkleroot being part of the block information is a validation shortcut?

No. It is to commit all of the transactions included in the block. Otherwise the transactions would not be part of the block hash (which is really the hash of the block header).

Difficulty not being part of the block information is due to the fact this can be derrived from the version header? (but this would require to have all difficulties being hardcoded forever into the code? This doesn't rhyme with dynamic difficulty, so basically I am wondering how a block can be validated without seemingly "knowing" its difficulty)

The difficulty is included in the block header as part of the nBits field. The nBits field is a compact representation of the target that the block hash must be less than.

Andrew Chow

Posted 2017-10-02T09:14:39.570

Reputation: 40 910

1

Actually it kinda is, the nBits field encodes the target threshold in the block header, which is directly related to, and more directly useful than, the difficulty itself.

MeshCollider

Posted 2017-10-02T09:14:39.570

Reputation: 8 735