WOTS+C (Winternitz One-Time Signature with Compression) is a one-time hash-based signature scheme with very compact signatures. Each keypair can sign at most one message.
In vanilla WOTS, each keypair signs a message by revealing certain preimages in a set of hash chains. The exact locations of those preimages are determined by the message, which is mapped to a set of indexes among those hash chains. At least one checksum hash chain is needed to prevent forgery. This checksum increases the signature size and must be verified for the scheme to be secure.
The WOTS+C scheme improves over stock WOTS by appending a small grinding counter to the signature, such that when the message and grinding counter are hashed, the resulting hash chain indexes sum to a constant value, fixed as part of the scheme. This prevents forgeries and removes the need for a checksum, resulting in faster verification and smaller signatures.
WOTS+C signing can fail depending on the parameters used. Most WOTS+C instances use a fixed-size counter so the signature size is constant. This means given a message to sign, the signer has a finite number of attempts to find a counter which which maps the message to a constant-sum set of hash chain indexes. For some messages, no such valid fixed-size counter may exist. In this case, signing fails, and the message cannot be signed.
This attached Python script computes the exact probabilities involved with WOTS+C grinding counter failures, using dice theory. It computes the failure probability for different bit-sizes of counters, and as a bonus, computes the expected number of invalid WOTS+C keys across a SPHINCS+C hypertree (which uses WOTS+C as a crucial component).
Namely, we can compute the exact probability of a WOTS+C key failing to sign a given message by reframing it into the following question:
If we repeatedly roll
$n$ dice with$s$ sides each, what is the probability that the faces of those dice do not sum to a fixed target$p$ over$v$ consecutive rolls?
The parameters are equivalent as follows:
| Parameter | Dice theory | WOTS+C equivalent |
|---|---|---|
| Number of dice | Number of WOTS chains | |
| Sides per die | Length of each WOTS chain | |
| Target sum | hash chain index constant-sum target | |
| Number of consecutive rolls | Number of possible counters, typically a power of two if counters are encoded as bits. |