Bonsai Measurements ↗

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.

Device signing time, relative to SHA-2Two experiments, each against SHA-2 in the same run.
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.

  1. Pick a position. The message hash picks a position and one leaf in each FORS tree.
  2. Sign with FORS. Reveal those leaves and the hashes that rebuild each tree's root.
  3. Climb the hypertree. Each layer signs the root of the layer below.
  4. 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.

Breaking down the 8,136 bytes

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.

Security as a key signs more, and where real keys sitDoubling scale. Dashed lines: the 132-bit target and the 2²⁶ budget. Dotted line: 128 bits, for reference.
All keys measured

Choosing the layout

The chosen layout is the smallest signature that passes four checks:

Every smaller layout fails a checkThe chosen layout and its nearest smaller alternatives.

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.

Even at our 160-bit width, it is larger or slower

And SPHINCS-G?