One-time key tree
How the Winternitz keys, the checksum and the Merkle root fit together.
Parameters
| Parameter | Value |
|---|---|
| Hash | keccak256 |
| Winternitz w | 16 (one hex digit per chain) |
| Chains per key | 67 = 64 message digits + 3 checksum digits |
| Chain length | 15 hash steps |
| Keys per tree | 2^height, 1,024 at height 10 |
Sign
The digest of the withdrawal is split into 64 hex digits. The checksum is the sum of (15 − digit) over these 64 digits, written as 3 more digits. For each of the 67 digits d, the signer runs the secret chain value d hash steps forward and reveals it.
Verify
The verifier runs each revealed value the remaining 15 − d steps and hashes the 67 results into the leaf. A Merkle proof links the leaf to the root that the vault stores. The checksum stops an attacker from moving any digit forward: a larger message digit makes the checksum smaller, which would need a step backward through the hash.
chain(seed, leaf, i, x, from, to):
for j in from..to: x = keccak256(seed, (leaf << 16) | (i << 8) | j, x)
sign: sig[i] = chain(sk(secret, leaf, i), 0, d[i])
verify: pk[i] = chain(sig[i], d[i], 15)
leaf = keccak256(pk[0] … pk[66])
root == merkle(leaf, proof)Rotation
Key tree rotation starts a new tree before you use all keys in the old tree. Your funds stay in the vault. The design is In progress: the plan is a root change signed by a one-time key.