SPB Git

Repository Public

QUANTUM_RESISTANCE.md 27.1 KB

# Quantum resistance: what QYVORA protects and what it cannot

Status: draft for version 1, 2026-12-04. The engine is not audited; the application is restricted to test networks until an independent audit (MainnetPolicy in Sources/QyvoraCore/Networks.swift).

# 0. The distinction this document exists to make

"Post-quantum wallet" can be read in three ways. They are different properties with different answers:

Layer Question Answer for QYVORA
A. The local vault and backups Can a quantum attacker who obtains the vault file, a backup file or a recorded device-to-device transfer recover the secrets? Designed to resist: 256-bit symmetric cryptography, and ML-KEM / ML-DSA / SLH-DSA where a public-key step is needed. Subject to password strength and to the unaudited status of the implementation.
B. Exposure of public keys on chain Has the public key behind an address been revealed, so that a quantum attacker could compute its private key? Depends on how the funds are held and used. QYVORA can measure and reduce exposure. It cannot remove it.
C. The networks themselves Are Bitcoin and Ethereum signatures quantum-resistant? No. secp256k1 ECDSA and Schnorr are broken by Shor's algorithm on a sufficiently large fault-tolerant quantum computer. No wallet can change this.

QYVORA's post-quantum algorithms act in layer A only. They do not sign Bitcoin or Ethereum transactions and do not make funds on those chains quantum-safe.

No statement is made here about when, or whether, a cryptographically relevant quantum computer will exist. The analysis is conditional on one existing.


# 1. Background: the two quantum algorithms that matter

Shor's algorithm (Shor, 1994) solves integer factorisation and the discrete logarithm problem in polynomial time on a quantum computer. The elliptic-curve discrete logarithm problem falls with it: given a public key $Q = dG$ on secp256k1, a sufficiently large fault-tolerant machine recovers $d$. This breaks ECDSA, Schnorr signatures, ECDH (including X25519) and RSA, whatever the key size in practical use. Published resource estimates for a 256-bit prime curve are of the order of a few thousand logical qubits (Roetteler, Naehrig, Svore and Lauter, 2017, give 2330 logical qubits for their circuit), each logical qubit requiring many physical qubits under error correction. Estimates continue to be revised; this document relies on none of them.

Grover's algorithm (Grover, 1996) searches an unstructured space of $N$ candidates in about $\frac{\pi}{4}\sqrt{N}$ evaluations of the function instead of $N/2$ on average. For a $k$-bit key this is about $2^{k/2}$ sequential quantum evaluations of the cipher. Three facts limit its practical effect:

  1. The speed-up is quadratic, not exponential, and it is optimal for unstructured search (Bennett, Bernstein, Brassard and Vazirani, 1997; Zalka, 1999).
  2. It parallelises poorly: $P$ machines give a speed-up of only $\sqrt{P}$, so $2^{k/2}$ becomes $2^{k/2}/\sqrt{P}$ per machine rather than $2^{k/2}/P$.
  3. Each evaluation is a deep reversible circuit executed under error correction.

For collisions, the Brassard–Høyer–Tapp algorithm finds a collision of an $n$-bit hash in about $2^{n/3}$ queries, but with a quantum memory of comparable size; whether this beats classical parallel collision search in a realistic cost model is disputed (Bernstein, 2009).

Primitive Classical security Generic quantum attack Assessment
AES-256 key search $2^{256}$ about $2^{128}$ Grover iterations Adequate margin
AES-128 key search $2^{128}$ about $2^{64}$ Grover iterations Not used by QYVORA for secrets
SHA-256, SHA3-256, Keccak-256 preimage $2^{256}$ about $2^{128}$ Adequate margin
SHA-256, SHA3-256, Keccak-256 collision $2^{128}$ $2^{85}$ queries with comparable quantum memory (BHT) Adequate margin
SHA-512 preimage $2^{512}$ about $2^{256}$ Adequate margin
HMAC-SHA-256 / HKDF with a 256-bit key $2^{256}$ about $2^{128}$ Adequate margin
HASH160 = RIPEMD-160(SHA-256(·)) preimage $2^{160}$ about $2^{80}$ Fixed by Bitcoin; smaller margin (section 3.1)
secp256k1 discrete logarithm about $2^{128}$ (Pollard rho) polynomial (Shor) Broken by a large quantum computer
X25519, P-256 about $2^{128}$ polynomial (Shor) Broken by a large quantum computer

These are generic attacks. They assume no structural weakness in the primitive, and say nothing about implementation errors.


# 2. Layer A — security of the local vault and of backups

# 2.1 What is protected and with what

Design of version 1; the vault module is being implemented.

Object Mechanism Quantum-relevant property
Vault records (recovery phrase, Quantum Identity private keys, settings) AES-256-GCM, unique random 96-bit nonce, authenticated header; subkeys from a random 256-bit master key by HKDF-SHA256 Symmetric, 256-bit: Grover leaves about 128 bits
Master key under the master password $\mathrm{KEK}=\mathrm{HKDF}(\mathrm{Argon2id}(pw,salt),\Vert,\mathrm{PBKDF2\text{-}HMAC\text{-}SHA512}(pw,salt))$, then AES-256-GCM key wrap Symmetric. The limiting factor is the entropy of the password, not the cipher
Master key under the device slot Random key in the iOS Keychain, device-bound, biometric access control; optional additional wrap by a Secure Enclave P-256 key The Keychain protection is Apple's. The P-256 wrap is not quantum-resistant and is not counted as such
Exported backup file Same password combiner, AES-256-GCM Symmetric only: no public key for Shor to attack
Device-to-device transfer Hybrid KEM: X25519 (system) and ML-KEM-1024 (engine), both shared secrets into HKDF; payload under AES-256-GCM; signed with ML-DSA-87, optionally also SLH-DSA-SHAKE-256f Confidentiality against a quantum attacker rests on ML-KEM-1024; authenticity on ML-DSA-87 (and on hash functions alone when SLH-DSA is added)

# 2.2 Why the symmetric margins hold

  • Keys are 256 bits. A Grover search of a 256-bit key space needs about $2^{128}$ sequential evaluations of AES, each a fault-tolerant quantum circuit. Even granting the algorithm its full quadratic advantage and ignoring the parallelisation penalty, $2^{128}$ operations are out of reach.
  • Hash outputs are 256 bits or more wherever a hash protects a secret or an integrity property chosen by QYVORA (HKDF-SHA256, HMAC-SHA512 in BIP-32 and PBKDF2, SHA3/SHAKE inside the post-quantum schemes).
  • GCM authentication has a 128-bit tag. Forging a tag is not a search problem that Grover accelerates in the offline sense: each forgery attempt must be submitted to a party holding the key. Within the vault there is no online oracle available to a remote attacker.
  • Password-based key derivation is the weak point of any vault, classical or quantum. Grover applies in principle to a password search (square root of the number of candidates), but each iteration must run the entire memory-hard Argon2id computation and the PBKDF2 computation coherently, inside the quantum computer. Memory-hardness makes that circuit extremely large. QYVORA does not rely on this argument to excuse weak passwords: a password with little entropy is weak against a classical attacker today.

# 2.3 Where public-key post-quantum algorithms are used, and why

QYVORA follows one rule: an algorithm is used only where it has a function. None is added to carry a label.

  • ML-KEM-1024 (FIPS 203) has a function when two devices that share no secret must agree on a key over a channel that may be recorded: the device-to-device transfer. It is combined with X25519 so that the result is at least as strong as the stronger of the two: a classical or implementation break of ML-KEM leaves X25519; a quantum break of X25519 leaves ML-KEM.
  • ML-DSA-87 (FIPS 204) has a function when a device must check that a transfer or a backup comes from a known wallet: the Quantum Identity. A forged transfer could otherwise plant a recovery phrase chosen by an attacker.
  • SLH-DSA-SHAKE-256f (FIPS 205) is offered as an optional second signature because its security rests only on the hash function, an assumption different from, and more conservative than, the lattice assumptions of ML-DSA. The cost is a signature of 49 856 bytes, acceptable for an occasional transfer.
  • Nothing post-quantum is used to encrypt the vault records themselves. A local vault has no key agreement to perform; AES-256-GCM under a 256-bit key is already the appropriate tool. Wrapping the master key with ML-KEM to a key stored next to it would add no security.

The Secure Enclave implements none of ML-KEM, ML-DSA or SLH-DSA. These algorithms run on the application processor, in the QYVORA process, with the private keys protected at rest by the vault. They do not have the hardware isolation that a Secure Enclave P-256 key has.

# 2.4 Harvest now, decrypt later

An attacker can record ciphertext today and wait for a quantum computer. The exposure depends on what the ciphertext was protected with:

Recorded object Protected by Exposure to a future quantum attacker
A QYVORA backup file Password-derived symmetric key Password guessing only, as today
A QYVORA device-to-device transfer Hybrid X25519 + ML-KEM-1024 Requires breaking ML-KEM-1024; X25519 alone would fall
The same data sent through a channel protected only by classical key agreement ECDH or RSA Decryptable once Shor's algorithm is practical
TLS sessions between the wallet and blockchain endpoints The system TLS stack Contains no secret of the wallet: only public addresses, public transactions and public state. The privacy of which addresses belong together is exposed to the endpoint in any case

The recovery phrase is the long-lived secret: a phrase captured from a decrypted backup in twenty years is as damaging as one captured today, if the funds are still controlled by it. This is why backups do not use a classical public-key step.

# 2.5 Limits of layer A

  • The engine is written from scratch and is not audited. For the secrets at rest this is mitigated by using the system AES-256-GCM as the default AEAD (cross-checked against the engine's own implementation of the same algorithm at start-up) and by combining the engine's Argon2id with the system PBKDF2. For the post-quantum algorithms there is no system fallback inside the vault design, which is why the transfer KEM is hybrid.
  • ML-KEM and ML-DSA are recent standards. Their underlying problems (Module-LWE, Module-SIS) have been studied for years, but far less than factoring or discrete logarithms, and implementations have a history of side-channel findings. The hybrid construction and the optional SLH-DSA signature are the design's answer; they are not a guarantee.
  • A weak password defeats everything in this layer.
  • A compromised device defeats everything in this layer (docs/THREAT_MODEL.md, section 5.2).

# 3. Layer B — quantum exposure of public keys

Shor's algorithm needs the public key. An address that is a hash of a public key hides the key until the key is published. The question for every unit of value is therefore: is the public key that controls it already known, and if not, when will it become known?

# 3.1 Bitcoin

Output type What the output contains Public key revealed Exposure
P2PK (pay to public key) The public key itself When the output is created Exposed at rest, for as long as the output is unspent
Bare multisig The public keys themselves When the output is created Exposed at rest
P2PKH HASH160 of the public key When the output is spent (the key is in the input script) Hidden until first spend from that address
P2WPKH HASH160 of the public key When the output is spent (the key is in the witness) Hidden until first spend from that address
P2SH HASH160 of the redeem script When spent: the script and the keys or signatures it requires Hidden until first spend
P2WSH SHA-256 of the witness script When spent Hidden until first spend
P2TR (Taproot, BIP-341) The 32-byte x-only output key When the output is created Exposed at rest: the output key is a secp256k1 public key, and the key path can spend with a signature for it, whatever script tree it also commits to

Consequences:

  1. Address reuse turns a hashed output into an exposed one. After the first spend from a P2PKH or P2WPKH address, its public key is on chain permanently. Any funds that remain at, or later arrive at, that address are controlled by an exposed key. The same holds for a reused P2SH or P2WSH script.
  2. Taproot outputs are exposed from creation. In the quantum model a P2TR output is in the same position as P2PK. This is a property of the output type, not of a wallet.
  3. The mempool window. Spending any output, including a never-reused hashed one, publishes the public key in the transaction. Between broadcast and sufficient confirmation, an attacker able to compute the private key within that time could sign a conflicting transaction paying themselves, with a higher fee. No wallet can close this window: it is inherent in publishing a signature for a key-based output. Whether an attack fits within minutes or hours depends on the speed of a future machine, which is unknown.
  4. Extended public keys. An extended public key (BIP-32) gives every non-hardened child public key of the account. Whoever holds it — a watch-only service, an indexer queried by extended key, a leaked export — sees the public keys of all addresses, including never-used ones. A quantum attacker holding it needs no on-chain exposure. Further, in BIP-32 one child private key together with the parent extended public key yields the parent private key, by classical arithmetic.
  5. Signed messages made with an address key reveal that key.
  6. The 160-bit hash. P2PKH, P2WPKH and P2SH hide the key behind a 160-bit hash. A generic quantum preimage search would take about $2^{80}$ Grover iterations, each including an elliptic-curve scalar multiplication and two hashes: far beyond Shor in cost, and not considered a practical route, but the margin is smaller than for the 256-bit P2WSH hash.
  7. What hashing does not provide. A hashed, never-spent output is protected only until it is spent. If the signature scheme were broken and no migration path existed at the protocol level, moving those funds would itself expose them (point 3). Hashing buys time for a protocol upgrade; it is not a solution.

# 3.2 Ethereum

Object Public key revealed Exposure
Externally owned account that has never sent a transaction or signed a published message No: the address is the last 20 bytes of Keccak-256 of the public key Hidden
Externally owned account that has sent at least one transaction Yes: the public key is recoverable from the signature of any of its transactions Exposed permanently
Externally owned account that has signed an off-chain message later published (permits, orders, sign-in messages) Yes, by the same recovery Exposed
Contract account It has no key of its own Depends on its code and on the keys that control it

Consequences:

  1. Ethereum's account model makes exposure the normal state. An account keeps one address; its first outgoing transaction reveals its public key, and every asset the account holds afterwards — ether, tokens, positions — is controlled by an exposed key. There is no equivalent of the fresh change address. The practical rule "nonce greater than zero means exposed" is the metric QYVORA uses.
  2. Receive-only accounts stay hidden as long as they never send and never sign a published message. Moving funds out exposes the key at that moment, with the same mempool window as in Bitcoin.
  3. Approvals extend exposure to other keys. An ERC-20 allowance lets the approved spender move the owner's tokens up to the approved amount. If the spender is an externally owned account with an exposed key, or a contract whose controlling keys are exposed, then breaking that key gives access to the allowance, independently of the owner's own key. Unlimited allowances ($2^{256}-1$) make the whole balance, present and future, subject to it.
  4. Contract accounts are only as safe as their logic and their controlling keys. A multisignature contract whose owners are exposed secp256k1 accounts is exposed. A contract account can, in principle, verify a different signature scheme (section 4.2); that is a property of specific contracts, not of the network.
  5. Other parts of the protocol also rely on discrete-logarithm assumptions, among them the BLS signatures of validators and the KZG polynomial commitments used for blob data. These are outside the scope of a wallet but belong to the honest picture of layer C.

# 3.3 What QYVORA does in layer B

The Quantum Shield and the migration engine are modules of version 1 whose implementation is in progress; this is their specification.

  • Never reuse a Bitcoin address. A new receiving address for each payment request and a new change address for each transaction (BIP-84 derivation, native SegWit P2WPKH by default).
  • Classify every output and account by exposure, from public data: script type, whether the address has already spent (the Esplora client exposes hasSpent for this purpose), Ethereum nonce, outstanding allowances.
  • Report exposure as numbers, not as a badge: the share of value held under keys that are already public, listed item by item (definitions in docs/WHITEPAPER.md).
  • Recommend consolidating long-term funds onto never-spent-from hashed outputs, and explain that the movement itself reveals the old keys.
  • Flag approvals, especially unlimited ones, and offer to revoke them.
  • Query endpoints by address, not by extended public key, and treat the export of an extended public key as a sensitive operation.
  • State on the relevant screens that Taproot addresses, reused addresses and any Ethereum account that has transacted are exposed in the quantum model.

# 4. Layer C — quantum resistance of the networks

# 4.1 The fact

Bitcoin authorises spending with ECDSA and, since Taproot, BIP-340 Schnorr signatures, both over secp256k1. Ethereum authorises transactions from externally owned accounts with ECDSA over secp256k1. Both schemes rest on the elliptic-curve discrete logarithm problem and are broken by Shor's algorithm on a sufficiently large fault-tolerant quantum computer. Schnorr signatures are not more quantum-resistant than ECDSA.

Neither Bitcoin nor Ethereum is quantum-resistant today. Neither network accepts ML-DSA, SLH-DSA or any other post-quantum signature as a native way to authorise a transaction from an ordinary address or account. A wallet cannot sign a Bitcoin or Ethereum transaction with a post-quantum algorithm and have the network honour it, because validity is defined by consensus rules, not by wallets.

Hash functions used by the networks (SHA-256, RIPEMD-160, Keccak-256) and Bitcoin's proof of work are affected by Grover's algorithm only quadratically; they are not the weak point.

# 4.2 State of proposals

The following are proposals and research directions, not deployed consensus rules (with the exception noted for account abstraction, which is deployed but does not by itself provide quantum resistance). Their content evolves; the current text of each proposal is authoritative, not this summary. No activation date is implied for any of them.

Bitcoin.

  • BIP-360 is a draft that originated as "pay to quantum-resistant hash". Its central idea is a new output type that commits to a script tree in the manner of Taproot but without a key-path public key in the output, so that the output does not expose a secp256k1 key at rest; post-quantum signature verification in scripts is discussed alongside it. The draft has been revised more than once, including its name and scope. It is not part of Bitcoin's consensus rules.
  • Related discussions on the development mailing list concern which post-quantum signature schemes could be added to Script (hash-based schemes such as SLH-DSA and lattice schemes such as ML-DSA are the usual candidates), the cost of their much larger signatures in block space, and what should happen to outputs whose keys are already exposed (migration periods, and the contested question of restricting or freezing spends from quantum-vulnerable outputs). There is no consensus on these questions.
  • Any such change would require a soft fork and then a migration by every holder: funds do not become safe by themselves.

Ethereum.

  • Account abstraction (ERC-4337) is deployed as an application-level standard: a smart-contract account validates its own operations with logic written in the contract, which is not required to be ECDSA. A contract account could therefore verify a post-quantum signature, at the gas cost of doing so in the EVM. This moves the choice of signature scheme to the account, but the accounts that hold most value today are ordinary externally owned accounts, and bundlers and the base protocol still use classical signatures.
  • EIP-7702 lets an externally owned account designate contract code to execute as its own. The account remains controlled by its original secp256k1 key, so EIP-7702 does not by itself remove the quantum exposure of that key.
  • Post-quantum signature research in the Ethereum community includes hash-based and lattice-based schemes for accounts and for validators, proposals for precompiled contracts that would make their verification affordable, and recovery ideas for a sudden quantum emergency. These are research and proposals; none is the network's current rule for ordinary accounts.

QYVORA takes no position on which proposal will, or should, be adopted.


# 5. What QYVORA can and cannot do

QYVORA can

  • protect the recovery phrase and keys at rest and in backups with 256-bit symmetric cryptography;
  • protect a device-to-device transfer against a recording attacker with a hybrid classical/post-quantum KEM, and authenticate it with post-quantum signatures;
  • avoid creating unnecessary exposure: no address reuse, hashed output types by default, no extended public key sent to endpoints;
  • measure the exposure of each output and account and show it plainly;
  • help the user reduce exposure: consolidation to fresh hashed outputs, revocation of approvals;
  • keep its formats algorithm-agile, so that new algorithms or new chain rules can be adopted without breaking existing vaults;
  • follow the proposals of section 4.2 and implement a migration path when a network actually deploys one.

QYVORA cannot

  • make a Bitcoin or Ethereum transaction quantum-resistant;
  • protect funds controlled by a public key that is already exposed, against an attacker with a sufficiently large quantum computer;
  • close the window between the broadcast of a transaction and its confirmation;
  • un-expose a key: once a public key is published, it stays published;
  • protect an Ethereum account that needs to transact repeatedly from having an exposed key;
  • guarantee that ML-KEM, ML-DSA or SLH-DSA, or its own implementation of them, will remain unbroken;
  • predict when a quantum computer capable of these attacks will exist.

# 6. What "post-quantum wallet" means and does not mean

It means:

  1. The secrets stored by the wallet, and the backups and transfers it produces, are protected by algorithms for which no efficient quantum attack is known, with parameters chosen for the highest standard security category where a choice exists.
  2. The wallet contains, tested against the official vectors, implementations of the NIST post-quantum standards (FIPS 203, 204, 205), and uses them for a defined purpose.
  3. The wallet treats quantum exposure of on-chain keys as a measurable property and helps manage it.
  4. The wallet is built to migrate when the chains do.

It does not mean:

  1. That Bitcoin or ether held with the wallet is safe from a quantum computer.
  2. That transactions are signed with post-quantum algorithms.
  3. That the wallet is certified, validated under FIPS 140 or audited. It is none of these at the date of this document.
  4. That the post-quantum algorithms run in the Secure Enclave. They do not.
  5. That using the wallet removes the need for the networks to upgrade.

# 7. Practical guidance given to users

  1. Never reuse an address. Receive each payment on a new address. Do not publish a single static Bitcoin address for repeated use.
  2. Keep long-term Bitcoin on never-spent-from hashed outputs (P2WPKH or P2WSH). An address you have spent from is exposed; do not leave or receive funds there. Understand that Taproot addresses reveal their key from the start.
  3. On Ethereum, separate holding from activity. An account that only receives keeps its key hidden; an account that transacts does not. Keep long-term holdings on an account that has never sent a transaction or signed a message, and accept that moving them will expose it.
  4. Minimise approvals. Approve exact amounts rather than unlimited ones, and revoke approvals that are no longer needed.
  5. Do not share extended public keys with services you do not control.
  6. Do not sign messages with keys that hold long-term funds.
  7. Protect the backup. A strong, unique password for exported backups; the paper recovery phrase kept offline. Layer A is only as strong as these.
  8. Plan migration. When a network deploys a quantum-resistant way to hold funds, moving to it will be the user's decision and action. Keep the wallet updated, follow the announcements of the networks themselves, and do not wait for an emergency: a migration made under attack conditions exposes keys in the mempool at the worst moment.
  9. Be sceptical of any product claiming that coins are quantum-safe today.

# References

  • P. W. Shor, "Algorithms for quantum computation: discrete logarithms and factoring", Proceedings of the 35th Annual Symposium on Foundations of Computer Science, 1994.
  • L. K. Grover, "A fast quantum mechanical algorithm for database search", Proceedings of the 28th Annual ACM Symposium on Theory of Computing, 1996.
  • C. H. Bennett, E. Bernstein, G. Brassard, U. Vazirani, "Strengths and weaknesses of quantum computing", SIAM Journal on Computing 26(5), 1997.
  • C. Zalka, "Grover's quantum searching algorithm is optimal", Physical Review A 60, 1999.
  • G. Brassard, P. Høyer, A. Tapp, "Quantum cryptanalysis of hash and claw-free functions", LATIN'98, 1998.
  • D. J. Bernstein, "Cost analysis of hash collisions: will quantum computers make SHARCS obsolete?", SHARCS'09, 2009.
  • M. Roetteler, M. Naehrig, K. M. Svore, K. Lauter, "Quantum resource estimates for computing elliptic curve discrete logarithms", ASIACRYPT 2017.
  • NIST FIPS 203, Module-Lattice-Based Key-Encapsulation Mechanism Standard, 2024.
  • NIST FIPS 204, Module-Lattice-Based Digital Signature Standard, 2024.
  • NIST FIPS 205, Stateless Hash-Based Digital Signature Standard, 2024.
  • BIP-32, BIP-84, BIP-141, BIP-340, BIP-341; BIP-360 (draft).
  • ERC-4337, EIP-7702.
Files main
Menu

Theme