SysTutorials

XMSS: Stateful Hash-Based Signatures

XMSS (the eXtended Merkle Signature Scheme), specified in RFC 8391, is the stateful hash-based signature scheme: WOTS+ one-time signatures at the leaves of a Merkle tree, with a persisted counter tracking which leaf comes next. NIST endorses XMSS and LMS in SP 800-208 for firmware signing and other constrained, single-signer uses.

How it works

An XMSS key pair spans 2^h WOTS+ one-time key pairs (h is the tree height, typically 10 to 20). Each message is signed with the next unused leaf, and the signature includes that leaf’s WOTS+ signature plus the Merkle authentication path that certifies it against the root, which anchors the public key.

The signature sizes stay small: a WOTS+ signature (~2.1 KB) plus an authentication path of h hashes. For h = 16, a signature is roughly 2.7 KB with a 64-byte public key (the Merkle root plus a seed). Multi-tree variants (XMSS^MT) stack several layers to get up to billions of signatures with slightly larger signatures.

The state discipline

XMSS is stateful: the signer must persist the one-time leaf counter and never reuse a leaf. Signing two different messages with the same leaf reveals enough chain values for an attacker to forge signatures from it. This is the scheme’s defining operational property:

SLH-DSA (SPHINCS+) is the stateless answer to this: pseudo-random leaf selection removes the counter at the cost of much larger signatures.

Where it fits

XMSS is not a natural fit for multi-device wallets or blockchains where many clients sign concurrently without shared state. For those, the stateless schemes win despite their sizes.

← All posts