Hyquard Docs
Post-quantum

One-time key tree

How the Winternitz keys, the checksum and the Merkle root fit together.

Parameters

ParameterValue
Hashkeccak256
Winternitz w16 (one hex digit per chain)
Chains per key67 = 64 message digits + 3 checksum digits
Chain length15 hash steps
Keys per tree2^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.

Scheme (same as hyquard-vault/sdk/wots.mjs)
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)
In progress · Never sign twice with the same leaf. The vault rejects reuse, but a second signature with one leaf leaks key material.

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.