Glossary

Schnorr Nonce

A Schnorr nonce is the ephemeral random value used during Schnorr signature generation to ensure each signature is unique.

Key Takeaways

  • A Schnorr nonce is a secret, one-time scalar (k) that produces the public commitment point R = k·G in a Schnorr signature. Each signature requires a fresh nonce: reusing one across two signatures reveals the signer's private key.
  • BIP-340 generates nonces using a synthetic approach that mixes the private key, message, and auxiliary randomness through tagged hashes, providing both determinism and side-channel resistance.
  • Multi-party signing protocols like MuSig2 require additional nonce commitments and use two nonces per signer per session to prevent forgery attacks that exploit the interactive nonce exchange.

What Is a Schnorr Nonce?

A Schnorr nonce is the ephemeral random value used during Schnorr signature generation to ensure that every signature is unique and that the signer's private key remains hidden. In mathematical terms, the nonce is a secret scalar k chosen from the secp256k1 curve order. The signer computes a public nonce point R = k·G (where G is the generator point) and includes R as part of the final signature.

The word "nonce" stands for "number used once," and that constraint is absolute: using the same nonce value with two different messages creates two equations that an attacker can solve to extract the private key. This makes nonce generation one of the most security-critical operations in any digital signature scheme.

In Bitcoin, Schnorr nonces are central to Taproot signatures (defined in BIP-340), multi-party signing protocols like MuSig2, and threshold schemes like FROST. Each of these protocols places different requirements on how nonces are generated, committed to, and aggregated.

How It Works

In a standard Schnorr signature over elliptic curves, the signing process follows these steps:

  1. The signer generates a secret nonce scalar k
  2. The signer computes the public nonce point R = k·G
  3. The signer computes a challenge hash e = H(R || P || m), where P is the public key and m is the message
  4. The signer computes s = k + e·d (mod n), where d is the private key and n is the curve order
  5. The final signature is the pair (R, s)

A verifier checks that s·G = R + e·P. If the equation holds, the signature is valid. The nonce k never appears directly in the signature, but its public counterpart R does. The security of the entire scheme depends on k remaining secret and never being reused.

BIP-340 Nonce Derivation

Bitcoin's BIP-340 specifies a nonce derivation algorithm that uses tagged hashes for domain separation. The derivation proceeds as follows:

// BIP-340 nonce derivation (simplified pseudocode)
t = secret_key XOR TaggedHash("BIP0340/aux", aux_rand)
k = TaggedHash("BIP0340/nonce", t || x_only_pubkey || message) mod n
R = k · G

// If R has an odd y-coordinate, negate k
if R.y is odd:
    k = n - k
    R = k · G

The XOR masking step is deliberate: rather than hashing the private key together with the auxiliary randomness, the spec XORs the hashed randomness into the key. This minimizes the number of operations that directly touch the secret value, reducing the attack surface for side-channel analysis like power analysis or electromagnetic emanation monitoring.

The tagged hash construction (SHA-256 with a domain-specific tag prefix) ensures that nonces derived under BIP-340 can never collide with nonces from other protocols, even when the same key is used. This is a critical improvement over RFC 6979, which lacks explicit domain separation and could theoretically produce colliding nonces if the same key were used for both ECDSA and Schnorr signing.

Synthetic Nonces

BIP-340's approach is called a "synthetic nonce" because it blends determinism with randomness. The aux_rand parameter should ideally be 32 bytes of fresh randomness generated at signing time. However, the specification notes that the normal security properties of the signature do not depend on the quality of this randomness: even if aux_rand is set to all zeros, the nonce derivation remains deterministic and safe against nonce reuse.

The auxiliary randomness serves two purposes:

  • Non-repeating input guards against fault injection attacks where an attacker induces hardware faults during signing to produce a second signature with the same nonce
  • Unpredictable input provides additional protection against side-channel attacks that attempt to recover the nonce through timing analysis or power consumption patterns

If no random number generator is available (as on some embedded signing devices), a simple counter or even an all-zero value is an acceptable fallback. The deterministic core of the derivation still prevents nonce reuse for different messages signed with the same key.

Why Nonce Quality Matters

Nonce Reuse

The most catastrophic nonce failure is reuse. If the same nonce k is used to sign two different messages m₁ and m₂, an attacker obtains:

s₁ = k + e₁·d (mod n)
s₂ = k + e₂·d (mod n)

// Subtracting:
s₁ - s₂ = (e₁ - e₂)·d (mod n)

// Solving for the private key:
d = (s₁ - s₂) / (e₁ - e₂) (mod n)

The private key d is recoverable with simple modular arithmetic. This is not a theoretical concern: researchers have extracted hundreds of Bitcoin private keys from the blockchain by identifying signatures that share the same R value, indicating nonce reuse. The same linear relationship between nonce and private key applies to both ECDSA and Schnorr signatures.

Biased Nonces and Lattice Attacks

Even if nonces are never fully reused, partial information leakage is dangerous. If an attacker learns just a few bits of each nonce across multiple signatures, they can frame the problem as a hidden number problem and solve it using lattice reduction techniques.

Research has demonstrated that knowing as few as 2 to 3 bits of the nonce per signature can be sufficient to recover the full private key, given enough signatures. Sources of nonce bias include faulty random number generators, timing side channels that leak partial nonce information, and implementation bugs that zero out leading bits.

These attacks apply to Schnorr-like schemes because the linear relationship s = k + e·d is structurally identical to the ECDSA case that lattice attacks were originally developed against. Any nonuniformity in the nonce distribution gives the attacker a foothold.

Nonces in Multi-Party Signing

Nonce generation becomes significantly more complex in multi-party Schnorr signing protocols like MuSig2 and FROST. These protocols aggregate individual nonces into a combined public nonce, and the interaction creates new attack surfaces.

MuSig2 Nonce Protocol

In MuSig2 (specified in BIP-327), each signer generates two nonces per signing session rather than one. The protocol proceeds in two rounds:

  1. Each signer generates two secret nonces (k₁, k₂) and computes their public points (R₁, R₂). They broadcast commitments to these public nonces.
  2. After all commitments are received, signers reveal their public nonces. The aggregated nonce R is computed as a linear combination of all individual nonces, weighted by a challenge derived from the nonce set.

The two-nonce design exists specifically to prevent Wagner's algorithm, an attack that exploits the ability to choose nonces adaptively across concurrent signing sessions. With a single nonce, a malicious co-signer who can open multiple concurrent sessions can solve a generalized birthday problem to forge signatures. The second nonce, combined with challenge-based weighting, makes this computationally infeasible.

The nonce commitment round is equally critical. Without it, a malicious party can wait to see other signers' nonces before choosing their own, enabling a related attack. Protocols that skip the commitment step for efficiency sacrifice security guarantees.

Deterministic nonces are also unsafe in multi-party settings: a malicious co-signer can trigger the same deterministic derivation twice (for example, by requesting a re-sign of the same message after changing their own nonce), causing the honest signer to reuse their nonce and leak their key share. This is why MuSig2 and FROST mandate fresh randomness in nonce generation, with no deterministic fallback.

Use Cases

  • Single-signer Taproot transactions: every Taproot key-path spend uses a Schnorr nonce as part of the BIP-340 signature. Wallets generate a synthetic nonce for each transaction they sign.
  • Multi-signature wallets: protocols like MuSig2 use paired nonces with commitment rounds to produce a single aggregated signature from multiple signers, enabling efficient multisig that looks identical to single-sig on chain.
  • Threshold signing: in FROST threshold schemes (used by protocols like Spark), a subset of signers each contribute nonces that are aggregated through Lagrange interpolation, producing a valid signature without any single party knowing the full private key.
  • Adaptor signatures: these use a nonce point that is offset by a secret value, enabling atomic swaps and scriptless scripts where revealing one signature implicitly reveals a secret usable in another context.
  • Batch verification: when verifying multiple Schnorr signatures at once, the nonce points R from each signature are combined with random weights into a single elliptic curve equation, enabling faster verification than checking each signature individually.

Risks and Considerations

Implementation Sensitivity

Nonce generation is the most implementation-sensitive part of any Schnorr signing system. A single bug that causes nonce reuse, nonce bias, or nonce leakage can compromise private keys permanently and silently. Unlike many cryptographic failures that produce obviously wrong output, a flawed nonce generator produces valid-looking signatures while leaking key material that an attacker can extract from the public blockchain at any time.

Side-Channel Exposure

Even with correct nonce derivation, the computation itself can leak information through side channels. Power consumption, electromagnetic emissions, and execution timing during nonce generation can reveal partial nonce bits to a local attacker. This is especially relevant for hardware wallets and signing devices that may be physically accessible to adversaries. BIP-340's synthetic nonce design and XOR masking provide some defense, but constant-time implementations remain essential.

Multi-Party Complexity

In multi-party protocols, nonce handling introduces additional failure modes. A signer that goes offline after broadcasting nonce commitments but before completing the signing round forces the session to abort and restart with fresh nonces. Reusing nonces from a failed session in a new one can expose key shares to extraction. Protocols must track nonce state carefully and ensure that partially completed sessions are fully invalidated before beginning new ones.

Quantum Considerations

While Schnorr nonces themselves are not directly vulnerable to quantum attacks (they are ephemeral and discarded after signing), the underlying discrete logarithm problem that protects them is. A sufficiently powerful quantum computer running Shor's algorithm could compute k from R = k·G, breaking the scheme entirely. This is a long-term concern shared by all elliptic curve signature schemes, and research into post-quantum alternatives is ongoing.

This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.