shuijian-xu / bitcoin

0 stars 0 forks source link

Bits #200

Open shuijian-xu opened 4 years ago

shuijian-xu commented 4 years ago

Bits is a field that encodes the proof-of-work necessary in this block. This will be discussed more in the next section.

shuijian-xu commented 4 years ago

The bits field is actually two different numbers. The first is the exponent, which is the last byte. The second is the coefficient, which is the other three bytes in little-endian. The formula for calculating the target from these two numbers is:

target = coefficient × 256^(exponent–3)