pq-transparent Measurements ↗

Draft Zcash Improvement Proposal · not yet submitted

A post-quantum signature for Zcash transparent spends

A hash-based signature derived from SPHINCS+ (standardized as SLH-DSA), with parameters chosen so a hardware wallet can sign in under 20 seconds and a key stays secure for tens of millions of signatures. This page shows how it is built and why each parameter has its value, using the measurements behind the draft.

Device figures are from a Ledger Nano S Plus, 30 signatures, including the USB transfer. Security is the resistance to FORS forgery, in bits, after one key has signed 2²⁶ (about 67 million) messages, for 999 of 1,000 keys.

The problem

Transparent Zcash payments are authorized with ECDSA. A large enough quantum computer could recover an ECDSA private key from its public key. A spend reveals the public key, and any other coins still locked to that key could then be stolen. Hash-based signatures rely only on the hash function being hard to invert, which quantum computers weaken but do not break.

The cost is size and time. A hash-based signature is thousands of bytes, and producing one on a hardware wallet takes seconds. The rest of this page is about keeping both within reach.

Why not a standard parameter set?

NIST's SLH-DSA comes in fixed sets. Each set applies one security level, 128 or 192 bits, to every part of the scheme. The "s" (small) sets have short signatures but are slow to sign; the "f" (fast) sets sign quickly but are large.

Signature sizeBytes per signature. The two 192-bit sets are 2× and 4.4× this proposal.

On the hardware wallet, SHA2-192s took 651.9 s to produce one signature, against 19.1 s for this proposal. SHA2-192f signatures, at 35,664 bytes, would make every spend four times heavier for every node that relays and stores it. SHA2-128s is smaller than this proposal, but its 128-bit hashes are too thin a margin, as the next sections show.

Signing times on a laptop

So the draft keeps the SLH-DSA structure and chooses its own sizes: a hash width between the two NIST levels, and a forest sized for how often real keys sign.

How a signature is built

The scheme has two parts. At the bottom, a FORS forest signs the message. Above it, a stack of trees of one-time keys, the hypertree, proves that the FORS forest belongs to the public key. Point at a part of the diagram, or a step, to see what it does.

  1. Pick a position. The message and a random value, the randomizer, are hashed. Part of the result picks one of 2²⁹ positions; the rest picks one leaf in each of the 16 FORS trees there.
  2. Sign with FORS. The signature reveals the 16 chosen leaf secrets and the neighbouring hashes that rebuild each tree's root.
  3. Climb the hypertree. In each layer, a one-time key signs the root of the tree below it, and neighbouring hashes link that key to its own tree's root.
  4. Reach the public key. The top tree's root is the public key. The signer builds the top tree once, at key setup, and keeps it.

Point at a part to see its role and its share of the signature.

Where the 8,136 bytes go

The scheme is stateless: every secret and tree comes from one secret seed, and positions come from the message hash, not a counter. The wallet keeps no record of what it has signed. The price is that a busy key eventually lands on some positions more than once, which slowly wears down FORS (see Key lifetime).

Why 160-bit hashes?

Every value inside a signature is a hash. Its width sets how much work it takes to find a matching input, a preimage, which is what a forger needs. The draft sizes it against a well-funded attacker: Bitcoin's whole mining network does about 295.6 hashes a year; the attacker spends 625 times as much, on electricity 10× cheaper and chips 1,000× more efficient.

Chance the attacker finds one preimage in a yearDrag to change the attacker's yearly hash budget.

At 128 bits the modeled attacker has about a 1 in 1,000 chance a year. At 160 bits that falls to about 1 in 4 trillion. Going to 192 bits buys another 32 bits of margin but costs a third more bytes: at the same forest, signatures grew from 8,536 to 11,200 bytes.

Inside each step the scheme still computes full SHA-256 and SHA-512 and keeps only the first 20 bytes. The wide internal state protects against attacks that look for collisions between intermediate values; the truncation keeps the signature short.

Why SHA-2?

The draft stays with hash functions NIST evaluated for SLH-DSA and, among those, the fastest and most widely used. SHA-2 is already part of Zcash and has the best hardware-wallet times of the standardized options.

Against SHAKE256Seconds to sign one SLH-DSA-128f signature on the device
Against BLAKESeconds to sign on the device, earlier 15×10 prototype

BLAKE3 signed about as fast as SHA-256 but is not standardized for this use. BLAKE2s beat the optimized SHA-256 only when both were hand-written assembly, and on verifiers with SHA instructions SHA-256 was about three times faster.

All options considered

How long a key lasts

FORS is a few-time signature: each signature reveals some secrets, and a key that signs very often slowly gives a forger more to work with. So security is not one number; it depends on how many messages a key has signed. The draft sizes the key for 2²⁶, about 67 million signatures, after looking at how much real keys sign.

Signatures per key, on a doubling scaleEach step to the right is twice as many signatures. The line is the per-key budget.

Half of all Zcash transparent keys have signed once. The busiest key ever, a development-fund multisig, signed about 4.2 million times, 16× under the budget. The busiest ordinary key leaves 78× headroom. One Ethereum mining pool exceeded 45 million transactions, within 1.5× of the budget: a reminder that the budget is not generous for exchange-style use, which the draft expects to be spread over many addresses.

FORS security as a key signs moreBits of resistance for 999 of 1,000 keys, computed by the occupancy model. The dashed line is the 132-bit target.

Security does not fall off a cliff: each doubling of the signature count costs about 4 to 5 bits. A key that signs past 2²⁶ is weaker, not broken. The 132 bits include 8 bits from grinding.

Choosing the layout

With the hash width and the security target fixed, the remaining choice is how to shape the trees. The draft sets three limits and takes the smallest signature that meets all of them:

Each setting pulls on these differently. Key setup builds only the top layer, so it fixes the top height at 9. Signing rebuilds the lower layers, so they must stay short. More FORS trees, taller trees and more grinding add security, but also bytes or seconds. Try it:

How predictions are made

Signature size is exact: 20 bytes of randomizer, 20 × (height + 1) bytes per FORS tree, 20 bytes per hypertree level and one one-time signature per layer (54 chains of 20 bytes at width 8, 40 at width 16, plus a 4-byte counter).

Device time uses constants the draft fitted to 18 device runs, which predicted six further layouts to within 0.4 s: signing takes about 0.66 s, plus 0.56 ms per FORS leaf, 42.2 ms per one-time key in the lower layers (59 ms at width 16) and 1.14 ms per grinding try; the 90th percentile of grinding tries is about 2.3× their mean. Key setup builds the top layer at the same cost per one-time key. Where the exact layout was measured, the measured value is shown instead.

Security comes from the occupancy model behind the workbench. Verifier work counts hash blocks relative to the chosen layout, with a SHA-512 block weighted as 1.7 SHA-256 blocks, which reproduces both measured width comparisons; measured values are shown where they exist.

The draft's searchLayouts surviving each limit, out of every combination of width, layer count and heights, FORS trees and tree height.

Among width-8 layouts the smallest survivor is the chosen one, 8,136 bytes; the next is 180 bytes larger. The smaller survivors all use Winternitz width 16, which leads to the last trade-off.

Bytes against verifier work

A wider Winternitz chain makes signatures smaller but makes every verifier hash more. The draft weighs bytes more heavily: every node relays and stores every signature, and every hardware wallet sends the whole signature over USB or QR. Verifier time matters only at the worst case per block (an 8 MB block of signatures verifies in about 20–30 ms on an 8-core laptop) and for a future proof of verification, where an SP1 experiment found no meaningful difference.

The rule is 2:1: a signature 10% smaller may cost up to 20% more verifier work.

Every smaller alternative costs too much verifier workSize saved and extra verifier work, each against the chosen layout. Below the line is allowed.

Width 16 everywhere saves about 12% for a third more work. The closest call is width 16 in the top layer only: it saves 280 bytes (3.4%), which allows 6.9% more work, and it measured 7.95%. A rate slightly more favourable to bandwidth would flip that one.

Two departures from SLH-DSA

Fixed digit sum

A one-time signature turns a hash into 54 digits from 0 to 7, and reveals that many steps along each of 54 hash chains. Anyone can hash a revealed value further, so a forger could raise a digit. SLH-DSA blocks this with extra checksum chains. Here the 54 digits must add up to exactly 229, so raising one digit forces lowering another, which means inverting a hash.

The signer finds a valid sum by trying about 700 counter values per layer, well under a second. Dropping the checksum chains saves 224 bytes.

Grinding

A forger can try many messages hoping one selects only FORS leaves already revealed. Grinding taxes every attempt: a signature counts only if 8 chosen bits of its hash are zero, so 1 in 256 hashes is usable.

The signer pays once, about 256 tries or 0.3 s on the device. The forger pays on every attempt, which adds 8 bits of security.

Limits of this analysis

Every Ledger run behind these figures, with its raw timings, is in the measurements view of the research workbench, alongside the full search and setup validation.