§ 07 · Blocks
Bits
A 256-bit target squeezed into 4 bytes
On this page 7 sections
The bits field tells you how hard the block was to win. It holds the targetTarget: The number a winning lottery ticket must not exceed. On Pearl the bar is the target times the work the ticket cost; the block hash is never compared with it.: a 256-bit number that a winning lottery ticket must not exceed. The smaller the target, the harder the block.
A 256-bit number takes 32 bytes, but this field is only 4. So the target is stored in a compact, scientific-notation-like form, the same one Bitcoin uses: an exponent and three digits of mantissa.
What’s different on Pearl is what the target is for. It’s never compared with the block hash. It judges a ticketTicket: A 256-bit BLAKE3 hash of a tile's transcript. It wins a block if, read as a number, it is at most the target times the work that tile cost. inside the block’s certificate, scaled by how much work that ticket cost.
Try it
Type a bits value and see the target it stands for, its difficulty, and how small a slice of all 256-bit numbers it is.
What does it look like?
- Size
- 4 bytes
- Type
- Compact number: exponent ‖ 3-byte mantissa
- Format
- Little-endian
| Field | Bytes | Value |
|---|---|---|
| Version header.version | 4 @0 | 0x20000000 int32 LE. BIP-9 style 0x20000000 since block 1; no consensus meaning in Pearl. |
| Previous block header.prevBlock | 32 @4 | eb555c52c695cfa0b2ad27f0d1f96ca55f1dc32d864e13218b4bd9041b969c99 Hash of the parent block, stored byte-reversed; shown in display order. |
| Merkle root header.merkleRoot | 32 @36 | c6c21c0c4204b9f39e17d7f79811aff53eac88ea0d80fcdeffdad96ba3fa8963 Root of the SHA256d Merkle tree of this block’s txids, stored byte-reversed. |
| Time header.timestamp | 4 @68 | 1792513562 (2026-10-20 16:26:02 UTC) uint32 LE Unix seconds. Must be at least 1 s after the parent and at most 5 min in the future. |
| Bits header.bits | 4 @72 | 0x176af3a6 Compact target. Difficulty 40157376.49334089. The certificate's jackpot hash (not this header's hash) must meet it. |
| Proof commitment header.proofCommitment | 32 @76 | 49e67ac73638201f2815a24689b8b1df672f9176df2ee232b00c1632fda3524d SHA256d(LE32(certificate version) ‖ public data). Replaces Bitcoin’s nonce: Pearl headers have no nonce. |
Bytes 72 to 75 of block 130,827 are a6 f3 6a 17. As a little-endianLittle-endian: Storing a number that spans several bytes with its smallest byte first. Pearl, like Bitcoin, stores numbers this way, and shows hashes with their bytes reversed. integer, that’s 0x176af3a6.
How do you decode it?
Split the four bytes into one byte of exponent and three of mantissa:
| Field | Size | Description |
|---|---|---|
| Exponent | 1 | 0x17 = 23: the target is 23 bytes long. |
| Mantissa | 3 | 0x6af3a6: the target’s first three bytes. (Its top bit is a sign bit, as in Bitcoin; targets are never negative.) |
Then shift the mantissa left by the remaining 20 bytes:
Written out as 32 bytes, that’s
0000000000000000006af3a60000000000000000000000000000000000000000
nine zero bytes, the three mantissa bytes, then twenty more zero bytes. Only three bytes of the target are ever free to vary. That’s the price of fitting it into 4 bytes.
What is difficulty?
Difficulty compares a target with the easiest one Pearl allows, the target of bits 0x1b00ffff:
That’s exactly what explorers show for block 130,827. A few more points along the chain’s history:
| Block | Bits | Target (32 bytes) | Difficulty |
|---|---|---|---|
| 0 and 1 | 0x1b00ffff |
000000000000ffff000… |
1.00000000 |
| 2 | 0x1b00ffea |
000000000000ffea000… |
1.00032054 |
| 10,000 | 0x1a0ab2a8 |
0000000000000ab2a8000… |
23.92961877 |
| 100,000 | 0x1800c4ef |
000000000000000000c4ef000… |
21,808,883.27997620 |
| 120,000 | 0x180089e0 |
00000000000000000089e0000… |
31,150,692.72892112 |
| 130,827 | 0x176af3a6 |
0000000000000000006af3a6000… |
40,157,376.49334089 |
What is the target compared with?
Not the block hash. On Pearl, the block hash 1df2f2c1…3c6d45b9 of block 130,827 is a big, random-looking number, nowhere near the target. See block hash.
The comparison happens inside the certificate. Its hash_jackpot, a BLAKE3 hash of one tile’s transcript, read as a little-endian number, must be at most the target times the work that tile cost:
For block 130,827 that bound is 00000000000006af3a6000…, the target shifted left by 20 bits, and the ticket 0000000000000436… is below it. The whole check, with every number, is on tickets and target.
A node checks two simple things about bits itself: the target must be positive and no larger than Pearl’s limit, and the bits must equal what the difficulty rule computes from the parent block.
How do bits change?
After every block. Pearl’s WTEMAWTEMA: Pearl's difficulty rule. After every block it nudges the target slightly: easier if that block took longer than 194 seconds, harder if it was quicker, with a one-week time constant. rule nudges the target up when the last block was slow and down when it was fast, measured against 194 seconds, then re-encodes it in compact form. Each block’s bits come from its parent’s bits and how long the parent took to arrive after the grandparent. Here are six real consecutive blocks:
| Block | Parent’s solve time | Bits |
|---|---|---|
| 130,822 | 204 s | 0x176adb49 |
| 130,823 | 29 s | 0x176ad3d2 |
| 130,824 | 29 s | 0x176acc5b |
| 130,825 | 295 s | 0x176ad0eb |
| 130,826 | 510 s | 0x176adf34 |
| 130,827 | 646 s | 0x176af3a6 |
A 29-second gap shrinks the target (harder); a 646-second gap grows it (easier). The details are on WTEMA.
Make a guess
A block with bits 0x176af3a6 arrives 300 seconds after its parent. Will the next block's difficulty go up or down?
Think of your answer first, then check it.
Answer Down, slightly: bits 0x176af872, difficulty 40,150,342.21.
300 seconds is slower than the 194-second target, so the target grows by about (300 − 194) ÷ 604,800 ≈ 0.0175%. Re-encoded, the mantissa goes from 0x6af3a6 to 0x6af872. Pearl’s own code gives exactly this. Because the compact form truncates, small changes can round away: the encoding always rounds the target down, a tiny bias toward higher difficulty.
How much work does a target represent?
On average, 2²⁵⁶ ÷ (target + 1) attempts’ worth. That’s the “work” a node adds up to pick the chain with the most work, as in Bitcoin. For block 130,827 it’s about 1.13 × 10²² (exactly 11,303,469,090,474,696,447,598).
On Pearl that number has a physical meaning: because tickets are scaled by their tile’s work, it is, roughly, the expected number of multiply-accumulates needed to win the block (at the standard noise rank of 128). That reading is an inference from the design, not a figure Pearl publishes. Divided by time, it’s Pearl’s hashrate. See hashrate.
Code: compact encoding and the difficulty number
pearld decodes bits exactly like btcd and Bitcoin Core, in
CompactToBig (node/blockchain/difficulty.go:23-57 at v1.5.2, on GitHub): mantissa = bits & 0x007fffff,
exponent = bits >> 24, and target = mantissa × 256^(exponent − 3) (shifted right instead when the exponent is 3 or
less), negated if bit 0x00800000 is set. The difficulty explorers show comes from
getDifficultyRatio (node/rpcserver.go:1034-1050 at v1.5.2, on GitHub):
max := blockchain.CompactToBig(params.PowLimitBits) // 0x1b00ffff on mainnet
target := blockchain.CompactToBig(bits)
difficulty := new(big.Rat).SetFrac(max, target)
outString := difficulty.FloatString(8) In JavaScript, with BigInt:
const bits = 0x176af3a6;
const target = BigInt(bits & 0x007fffff) << BigInt(8 * ((bits >>> 24) - 3));
// 0x6af3a6n << 160n