Bonsai ZPQ-SHA2-160
A post-quantum signature for Zcash transparent spends
Quantum computers pose a risk to ECDSA. Bonsai is a hash-based replacement for Zcash transparent spends, derived from SLH-DSA and pruned until it is practical on a hardware wallet.
Ledger Nano S Plus, 30 signatures. Security is bits against forgery after 2²⁶ signatures, for 999 of 1,000 keys.
Motivation
Configurations offered by the NIST standard are impractical: the 128-bit sets have hashes that are too short; the 192-bit sets are too slow on the device or too large.
We separate two security arguments: hash width, which we set at 160 bits, and FORS-resistance, placed at 2²⁶ lifetime at 132.4 bits for 99.9% of keys.
This granularity allows us to achieve speed-ups and bandwidth reductions while maintaining security levels practically safe.
160-bit hashes
Hash width sets how hard it is to forge. We size it against an attacker doing 2¹¹⁸ hashes a year, about six million times Bitcoin's mining network.
Change the attacker
SHA-2
It is standardized for SLH-DSA, already used in Zcash, and as fast as anything we measured on the Ledger device.
All options considered
How a signature is built
A FORS forest signs the message. A stack of one-time-key trees, the hypertree, links that forest to the public key.
- Pick a position. The message hash picks a position and one leaf in each FORS tree.
- Sign with FORS. Reveal those leaves and the hashes that rebuild each tree's root.
- Climb the hypertree. Each layer signs the root of the layer below.
- Reach the public key. The top tree's root is the public key. It is built once, at key setup.
Point at a part to see its role and its share of the signature.
The lifetime of a key
Each signature reveals a few FORS secrets, so security slowly drops as a key signs more. Keys are sized for 2²⁶, about 67 million signatures. The busiest Zcash key ever would still hold 145 bits.
All keys measured
Choosing the layout
The chosen layout is the smallest signature that passes four checks:
- 1At least 132 bits of security after 2²⁶ signatures.
- 2Key setup under 40 seconds on the device.
- 390% of signatures within 20 seconds.
- 4A smaller signature may cost at most twice its saving in extra verifier work. Every node stores every signature, so bytes count double.
How layouts were screened
Size is exact. Device time comes from constants fitted to 18 device runs: 0.66 s, plus 0.56 ms per FORS leaf, 42.2 ms per lower-layer one-time key (59 ms at width 16) and 1.14 ms per grinding try. Measured values replace predictions where they exist.
Try another layout
Two changes to SLH-DSA
Fixed digit sum
The 54 digits of each one-time signature must add up to 229. Raising one forces lowering another, which means inverting a hash. This replaces the checksum and saves 224 bytes.
Grinding
Only 1 in 256 message hashes is usable. The signer pays once, about 0.3 s; a forger pays on every try. That adds 8 bits of security.
Why not leanSPHINCS?
leanSPHINCS is built for Ethereum, where signatures are aggregated into one proof and never sent to the chain on their own. Zcash relays every signature, so signature size matters more.
- 1128-bit hashes. Below our security requirement.
- 2Tuned for aggregation. Optimizes for verification work rather than signature size.