Tari L1 / post-quantum contingency

Tari L1 Quantum Findings

What a quantum attacker could do to Tari L1, what the current code lets us do about it today, and what still needs consensus changes. Every claim is labelled with how well it is supported.

Code analysed
tari-project/tari e1eb873 (2026-11-30); tari-crypto 2309df8
Method
Source reading, unit tests in local clones, one micro-benchmark
Written
December 2026
Draft, not an audit. This is independent analysis, not reviewed by the Tari maintainers. Nothing has been pushed upstream. No exploit was built. Where a claim rests on reading the code and not on a test, it says so.
Verified read in code or passed a test Measured benchmark on one machine Design reasoning, untested Unverified not yet checked

Summary

Theft of funds can largely be prevented for people who prepare, using tools that already exist. Inflation cannot be prevented once discrete log is cheap. It can only be limited and undone, and that needs consensus changes. The findings that shape the plan:

Covenants are disabled on mainnet Verified

max_covenant_length is 0 in the base constants for mainnet, nextnet, stagenet and Esmeralda, and the code treats 0 as disabled. Only localnet and Igor allow covenants. A destination-pinning vault therefore needs a constants change at an activation height. No new code is needed, because covenants are already enforced in body validation and the mempool.

Payments to a published address are fully exposed Verified by reading

For one-sided and stealth outputs, the commitment mask comes from a Diffie-Hellman shared secret, and a derived script key is Blake2b(mask) + root spend key. The sender-offset key is on chain and addresses publish the view and spend public keys. A quantum attacker who knows an address could derive everything needed to spend, with no earlier exposure. No end-to-end exploit was run.

A 35-byte hash-lock holds even if every key is forged Verified

The script HashSha3 PushHash(H) EqualVerify was run inside a real transaction input with genuine signatures. The right preimage verifies. A wrong or missing preimage is rejected by the script alone, with all keys and signatures valid.

Wallet keys come from one Blake2b step Verified

Spend and view keys are Blake2b-512 over (seed entropy, branch, account index). Argon2 only encrypts the stored seed file and is not in the key path. Entropy is 16 bytes. That makes a hash-only proof of seed knowledge feasible in principle.

Inflation is not solved by any of this Design

An attacker who can compute discrete logs can satisfy every balance equation and open any commitment to any value. A vault does not touch that. Containment needs a public-amount pool, a capped turnstile, rate-limited exits and chokepoint freezes. See the inflation section.

The P-384 / P-521 stopgap is slow and not quantum-safe Measured

Even with OpenSSL and the best build flags, verification was about 10 times slower than Ristretto, and keys and signatures grew 53% (P-384) or 109% (P-521). Shor's algorithm breaks these curves just as it breaks Ristretto.

Threat model

A quantum attacker running Shor's algorithm breaks discrete log. Hash functions only lose about half their strength to Grover's algorithm, so 256-bit hashes stay usable. Four kinds of harm need different defences.

HarmWhat breaksCan it be prevented?
TheftSchnorr signatures (kernel, script, metadata) and key pairsMostly, for people who move funds into vaults beforehand
InflationPedersen binding, Bulletproofs+ soundness, kernel balanceNo. Only limit and undo
Retroactive privacy lossDiffie-Hellman keys used to encrypt amounts, masks and memos in recorded outputsNo, for data already on chain
Network compromiseX25519 in the Noise_XX_25519_ChaChaPoly_BLAKE2b peer handshakePartly, with a hybrid post-quantum handshake

Proof of work is not threatened by Shor and Grover gives only a small speedup. Merge mining depends on Monero's own migration. These two points are expectations, not tested here.

What is exposed on chain

Every output carries its commitment, script, sender-offset public key, covenant, encrypted data, metadata signature and range proof. Every input carries input data and a script signature. Verified

Output kindWhat a quantum attacker getsStatus
Non-stealth, PushPubKey(spend key)The script key is on chain permanently. Easiest target.Verified
One-sided / stealth to a published addressShared secret from the on-chain sender-offset key plus the address view key gives the mask and encryption key. The address spend key gives the script key.Verified by reading
Stealth with Nop scriptBelieved to reveal the script key only at spend time, but exposed anyway when the recipient address is known.Unverified
Encrypted amounts, masks, memosRecorded chain data can be decrypted later when the encryption key comes from a Diffie-Hellman secret.Verified by reading
Block headersCommit to the output set, kernel set, sizes, offsets and proof of work, so a block hash is a complete checkpoint.Verified

Consequences for the plan

  • The vault campaign should target PushPubKey outputs and payments to reused or published addresses first.
  • Address reuse guidance becomes a headline item.
  • Checkpoints need no new data structure.

Hash-lock vault

The existing opcodes HashSha3, PushHash and EqualVerify express a spend condition that depends only on a hash. Consensus runs the script, so an attacker who forges every key and signature still needs the preimage.

HashSha3  PushHash(H)  EqualVerify      // 35 bytes, 3 opcodes
                                         // limits: 512 B on mainnet, 128 opcodes
TestResultStatus
Script alone: right, wrong and missing preimage
infrastructure/tari_script/tests/quantum_vault.rs
Right passes and leaves the script key on the stack. Wrong and missing are rejected.Verified
Real transaction input with genuine script signature
transaction_components/quantum_vault_test.rs
Right preimage verifies and returns the script key. Wrong or missing is rejected with all keys valid.Verified
Covenant pinning the destination
covenants/covenant.rs, vault_covenant_pins_destination
A spend without the pinned output fails. With it, one match. Extra outputs beside it are allowed. A look-alike output is rejected.Verified
Full block body, script offset, balance, live networkNot run.Unverified

What it does and does not do

  • The secret becomes public when the spend is broadcast. Without a covenant, a fast attacker could copy it into a replacement transaction. A covenant that pins the destination output limits the copy to completing the owner's own move.
  • Covenants are evaluated over the whole aggregate body, and each output can satisfy the covenant of at most one input. The rule is "at least one matching output", so extra outputs are allowed. Theft is then blocked only because the balance equation must hold. A forger who can break commitments is not stopped. That is the inflation problem.
  • Pinning fixes the amount and fee at lock time. It suits cold storage and planned moves, not flexible payments.
  • Scripts are fixed when an output is created, so existing unmoved outputs cannot be retrofitted.
  • TariScript cannot verify a post-quantum signature because a script cannot see the transaction. Its context holds only the block height, the previous block hash and the output's own commitment.

Vault v1 is the hash-lock alone and works on mainnet today. Vault v2 adds the covenant pin and needs covenants enabled.

P-384 and P-521 as a stopgap

Moving to a larger NIST curve was suggested in the community thread as a simple interim step. A micro-benchmark outside the Tari code compared Schnorr signing, verification and Pedersen commitment on Ristretto (curve25519-dalek) against P-384 and P-521, in pure Rust and with OpenSSL 3.5. Measured

Schnorr verification, lower is better. Bars share one linear scale.

BackendSignVerifyCommitPublic keySignatureEst. BP+ proof
Ristretto (dalek)23 µs31 µs33 µs32 B64 B576 B
P-384 RustCrypto407 µs728 µs649 µs49 B97 B879 B
P-384 OpenSSL169 µs391 µs388 µs49 B97 B879 B
P-521 RustCrypto568 µs924 µs983 µs67 B133 B1203 B
P-521 OpenSSL137 µs323 µs336 µs67 B133 B1203 B

Reading the numbers

  • Best realistic case is about 10 times slower to verify than Ristretto. Sizes grow 53% (P-384) or 109% (P-521).
  • OpenSSL helps most for P-521, which has a dedicated 64-bit implementation. It is a C dependency, so it would work for the node but not for the WASM builds.
  • The Bulletproofs+ column is a size formula (15 points plus 3 scalars for one 64-bit proof), not a measurement. No Bulletproofs+ implementation exists for these curves, so a port would be needed.
  • Verification and commitment in the OpenSSL runs use two separate multiplications. A combined multi-scalar multiplication would save roughly a quarter. Batch verification would help more.
  • The second Pedersen generator in the benchmark has a known discrete log, so commitment timings are valid but the commitments are not secure.
  • Machine: AMD Ryzen 5 7500F, release build, fat LTO, native CPU flags.

Conclusion. The stopgap raises the cost of a classical or AI-assisted attack on the curve. It gives no quantum resistance. Its cost is high and it needs a Bulletproofs+ port, so it is worth doing only if the classical threat is judged near.

Inflation

Once discrete log is cheap, an attacker can forge signatures, open any commitment to any value, forge range proofs, and satisfy the kernel balance equation with arbitrary excess points. They can mint outputs of any size. Pedersen hiding is unaffected, so the chain looks normal. Supply cannot be audited from hidden amounts. Design

The defences have to move the audit somewhere discrete log cannot reach.

1. Public-amount pool

Outputs with public amounts authorised by hash-based proofs. Supply there is a plain sum. Costs privacy until a private post-quantum pool exists. The RevealedValue range-proof type is a format building block but still relies on Pedersen balance, so it is not safe by itself.

2. Capped turnstile

After an activation height, legacy outputs can leave only by a claim into the public pool. Total claims are capped using the public emission schedule (supply_at_block). Only outputs in the checkpoint block are eligible.

3. Rate-limited exits

Claims reveal amounts, so exit volume per window can be capped, for example 1% of the cap per day. This buys time to detect and roll back.

4. Chokepoint freezes

Inflated coins only hurt if they can be sold. Exchanges and the L1 to L2 bridge accept only public-pool value after the flag and can pause earlier.

The hard parts

The amount-lie problem Design

After binding breaks, a claimant can open a genuine pre-attack commitment to a larger value. Nothing on chain authenticates the original amount. Encrypted data is not authoritative either, because a sender could have written any value into it and consensus does not check it against the commitment.

Mitigations: move funds into the public pool before Q-day while binding still holds (exact, and the main defence); scale claims pro rata if unattested claims exceed the remaining cap; delay and add evidence requirements for large claims.

Lost coins give slack Design

The emission schedule counts coins that are lost forever. Inflated claims can hide inside that share, so the bound on inflation is the lost-coin fraction, not zero.

Quiet inflation before detection Design

Coins minted before anyone notices can sit inside the checkpoint. Canaries, dormancy monitoring and a conservative checkpoint help, at the cost of rolling back honest transactions.

Consensus changes involved

ChangeWhere in the codeRisk
Enable covenantsconsensus constants, mainnetLow: already enforced and tested
Public-amount output type and balance ruleoutput type, range proof type, body validatorMedium
Turnstile claim and legacy-spend banbody validator, mempoolHigh
Claim proof verifiernew consensus-critical componentHigh, research
Cap and rate-limit statechain stateHigh
Emergency ruleconstants, validatorsHigh, governance

Everything consensus-critical needs a testnet period and an external audit before an activation height is set.

Claims without elliptic curves

A claim has to prove ownership without any signature on the legacy curve, since the attacker can forge it. Design built on verified key derivation.

  • A quantum attacker can already compute every curve private key from the public keys. So the claim can simply reveal the output's private key, and the verifier checks d·G = P natively and cheaply.
  • A zero-knowledge proof then only has to show that the revealed scalars were derived from entropy the claimant knows. That is a few Blake2b evaluations, with no curve arithmetic inside the proof.
  • The proof's public inputs include a hash of the destination output, so a claim cannot be redirected or front-run.
  • Cost: revealing keys exposes that wallet's outputs to everyone. A wallet should claim all its outputs together.

Unverified Proof size and verification cost. Hardware (Ledger) wallets derive keys on the device by a different scheme and need their own path. With 16-byte entropy, Grover leaves about 264 security, which is fine now but worth tracking.

Plan

Two tracks. Track A is the contingency if quantum arrives first and uses only what the protocol can do. Track B is the real migration to post-quantum cryptography.

Track A, contingency

WorkstreamContent
AnalysisExposure map, key derivation, covenant behaviour, harvest-now-decrypt-later survey. Mostly done, see above.
VaultsHash-lock script, optional covenant pin, wallet flow (derive the secret from the seed, move to vault, reveal at spend), end-to-end tests.
DetectionCanary outputs with destroyed keys and a public bounty, dormancy monitor, agreed hardware-progress milestones.
ResponseAlert levels, checkpoint tooling using the header roots, recovery fork prepared and dormant, governance rule agreed in advance.
RecoveryClaims through the seed-knowledge proof, vault preimages as fallback.
EcosystemExchange runbook, L2 bridge circuit breaker, pre-written communications.

Alert levels

LevelTriggerActions
1 WatchPublished hardware milestonesMonitoring up, public guidance
2 AlertCredible evidence of a capable attackerVault campaign, exchanges and bridge notified, bridge claims paused
3 EmergencyConfirmed forgeryHalt spends, choose checkpoint
4 RecoveryCommunity ratifiedFork activates, claims open

Track B, migration

  • Replace every discrete-log primitive: Pedersen commitments, Schnorr signatures, offsets, key pairs, range proofs.
  • Candidates are hash-based or lattice signatures, plus lattice commitments and range proofs. Range proofs are the hard part, since no Bulletproofs+ equivalent exists.
  • Measure size, speed and bandwidth for each candidate before choosing.
  • Add a hybrid post-quantum handshake for peer connections, which can ship independently of consensus.
  • Hard fork with a deadline for old outputs, a testnet period and an external audit.

Order of work

  1. Weeks 0 to 4: finish the open checks and post a governance proposal.
  2. Months 1 to 3: vault wallet flow and end-to-end tests, canaries and monitoring, exchange contacts.
  3. Months 3 to 9: checkpoint tooling, dormant fork code, bridge breaker, claim-proof prototype, hybrid handshake work.
  4. Ongoing: rehearsals on a testnet and handoff to Track B.

Open items

ItemStatus
Vault through a full block body (script offset, balance, kernel) and on a live networkUnverified
Whether later mainnet heights change the covenant setting (only part of that block was read)Unverified
Whether stealth Nop-script outputs hide the script key until spendUnverified
Which encrypted data are keyed by a Diffie-Hellman secret versus a private derivationPartly traced
Hardware wallet key derivation and claim pathUnverified
Proof size and cost of the seed-knowledge proofUnverified
L2 (Ootle) review and the L1 to L2 bridge behaviour under inflationNot reviewed
Post-quantum hybrid handshake options for peer connectionsNot surveyed
Hardware timeline assumption: early quantum machines are too slow to win a block-time raceAssumption

Decisions needed from the community

  1. Who may declare an emergency, and by what voting rule?
  2. Is a public-amount pool acceptable, given its privacy cost, until a private post-quantum pool exists?
  3. Which amount-lie mitigation: early migration plus pro-rata scaling, or something else?
  4. Claim window length and exit rate limit.
  5. Priority rule under the rate limit: age, size or lottery.
  6. What happens to coins nobody claims?
  7. Who attests and ratifies a checkpoint, and is a rollback acceptable?
  8. Should covenants be enabled on mainnet now, as a low-risk prerequisite?
  9. Who funds and runs the canaries, monitoring and rehearsals?