+
+ {:else if step.kind === "merkle-init"}
+ {step.ch + 1} / {CHAPTERS.length}
+ {CHAPTERS[step.ch]}
+
+
+ {:else if step.kind === "merkle-fold"}
+ The coinbase transaction this pool built, hashed twice, gives its txid:
+ {step.txid}
+ internal byte order — the form used while hashing
+
+
+ {:else if step.kind === "merkle-done"}
+
+ Level {step.i} of {step.total} — join with the branch hash and hash the pair
+
+
+
+ current{step.left}
+ branch {step.i}{step.right}
+ SHA-256d ↓
+ result{step.result}
+ {@html MATH_MERKLE}
+
+ each branch hash b stands in for every other transaction in its subtree
+
+
+
+ {:else if step.kind === "padding"}
+ Merkle root reproduced from the coinbase alone:
+ {step.root}
+
+ {step.matches
+ ? "matches the merkle root committed in the header"
+ : "does NOT match the header's merkle root"}
+
+
+
+ {:else if step.kind === "init-h"}
+
+ 80 header bytes, a 0x80 marker, 39 zero bytes and the
+ 640-bit length — exactly two 512-bit blocks
+
+ {#each padBlocks as blk, bi}
+
+
+ {/each}
+ message block {bi + 1} · 512 bits
+
+ {#each blk as s, i (i)}{s.hex}{/each}
+
+
+ {#each fields as f (f.key)}
+ {f.name}
+ {/each}
+ padding
+ message length
+
+
+ the merkle root straddles the boundary — SHA-256 takes
+ 64 bytes at a time, indifferent to where fields begin and end
+
+
+
+ {:else if step.kind === "schedule"}
+ Eight 32-bit registers, seeded from the SHA-256 constants:
+
+ {#each INIT_H as v, i (i)}
+
+ H{i}{v}
+ {/each}
+
+ the fractional parts of the square roots of the first eight primes — "nothing up
+ my sleeve" numbers, chosen so nobody could have picked them to hide a weakness
+
+
+
+ {:else if step.kind === "round"}
+
+ Block {step.block} of {step.blocks} expands into sixteen 32-bit words
+
+
+ {#each step.words as w, i (i)}
+
+ w{i}{w}
+ {/each}
+ {@html MATH_SCHEDULE}
+
+ rounds 17–64 consume words expanded from the first sixteen by this recurrence
+
+
+
+ {:else if step.kind === "add-h"}
+
+ pass {step.pass} · block {step.block}/{step.blocks}
+ round {String(step.round).padStart(2, "0")} / 64
+ W[t] {step.wt} K[t] {step.kt}
+
+
+
+
+
+
+
+ bit is 1
+ bit is 0
+ flipped on this round
+ rows are registers a–h, 32 bits each
+
+
+ {#each step.hexRegs as r, i (i)}
+
+
+ {"abcdefgh"[i]}{r}
+
+ {/each}
+
+
+
+
+ {@html MATH_ROUND}
+ {@html MATH_UPDATE}
+
+
+ {@html MATH_DEFS}
+
+ every lit cell above is a real bit of this share's working state
+
+
+
+ {:else if step.kind === "digest"}
+
+ 64 rounds done — the result is added into the running state, chaining
+ this block into the next
+
+
+ {#each step.state as v, i (i)}
+
+ H{i}{v}
+ {/each}
+
+ addition, not replacement — the Davies–Meyer construction, which is what makes
+ the compression one-way
+
+
+
+ {:else if step.kind === "reverse"}
+ {step.label}
+ {step.hex}
+
+
+ {:else if step.kind === "target"}
+ Bitcoin prints hashes in reverse byte order
+ {digest2Hex}
+ ↓ reverse all 32 bytes
+
+ {#each finalChars as ch}{ch.c}{/each}
+
+
+ leading zeros — the visible sign of the work done
+
+
+
+ {:else}
+
+
+
+ your hash
+ {#each finalChars as ch}{ch.c}{/each}
+
+
+ share target{shareTarget}
+
+
+ network target{netTarget}
+
+
+ leading zeros of your hash
+ a hash counts when it is numerically below the target
+
+ {@html MATH_TARGET}
+
+ the hash is below the share target — that is what made it a
+ {formatDifficulty(share.sdiff)} share. The network target sits another
+ {targetGapX >= 1000 ? formatDifficulty(targetGapX) : targetGapX.toFixed(1)}×
+ lower: clear that, and this exact header would have been block
+ #{share.height.toLocaleString()}.
+
+
+
+ {/if}
+
+ {allOk ? "Proof of work verified" : "Verification failed"}
+
+
+ {#each finalChars as ch}{ch.c}{/each}
+
+ -
+ {#each checks as c, i (c.name)}
+
- + {c.ok ? "✓" : "✗"} + {c.name}{c.detail} + + {/each} +