OP from Zakura can be found on X HERE
(apologies if formatting is messed up a bit
)
The most famous problem in mathematics, the Riemann hypothesis, has been proven.
The rumor mill suggests that AI labs have also made breakthroughs in integer factorization.
This is leading to widespread concern about the security of RSA, which is rarely used in cryptocurrencies. The bigger issue is that
integer factorization is very related to breaking pairing-based cryptography.
The time to prepare for a cryptographic breakthrough is before it happens.
Zcash is particularly well-positioned for this situation:
- Transparent transactions do not rely on factoring or pairings.
- Ironwood, Zcash’s modern shielded pool, also does not rely on either of them.
- Sapling, Zcash’s older shielded pool, relies on pairings in the ZKP. Less than 2% of supply is in there, and there are recovery paths even if pairings are broken.
We want to explain our risk assessment for pairings, and what Zcash should do today to prepare for an era of accelerated mathematical discovery. TL;DR: Let’s deprecate Sapling faster, and if you’re in that last 2% please migrate to Ironwood!
Assume pairings are broken, then what?
Before assessing the likelihood of a pairing break, let’s examine the consequences.
Pairings were first deployed in cryptocurrency by Zcash! They now secure the consensus algorithms of many blockchains (Ethereum, Solana, BNB, etc.), as well as many ZK proof systems. (User accounts are not typically secured with pairings.) Blockchains using pairings for consensus would need to urgently migrate to alternative signature schemes.
In Zcash’s legacy Sapling pool, neither users’ private keys nor their note commitments rely on pairings. Only the proof system does. A pairing break enables an attacker to forge proofs, putting the 400,000 ZEC in Sapling at risk.
Fortunately, Sapling’s proof system can be replaced without replacing its note commitments. By freezing Sapling before its state is compromised, users can later recover their funds using a new ECDLP-based or hash-based SNARK.
What should Zcash do?
Concretely, all Zcash users should know that:
- Transparent funds are safe
- Ironwood funds are safe
- Sapling funds can be pairing-break recoverable, even if the rumors are substantiated
Practical pairing breaks are highly speculative. Still, our recommendation is to accelerate Sapling’s planned deprecation. This means that payments into Sapling should be disabled by a network upgrade.
While most wallets support both Sapling and Ironwood, the impact should be minimal. In practice, most recipients of Sapling transactions are miners who can use Ironwood instead. Less than 2.6% of all transactions in the last 30 days use Sapling, and of those, 66% are known miner flows, and it’s highly likely most of the remainder are miners as well.
As a community, we must remain on standby for complete pool freezing upon credible risk to pairing security. After a hypothetical freeze, work should begin on a ZKP that re-uses the same circuit to restore recoverability of those Sapling funds.
Security in the age of advanced AI
The AI math breakthroughs are likely not going to stop. All communities should proactively raise their security targets to 192 bit or 256 bit levels, which leaves buffer room for improved attacks. When possible, we should use more conservative cryptographic assumptions, like hashes and non-pairing elliptic curves.
Raising security by 64 bits is relatively cheap, and it raises the cost to attack by a factor of a quintillion. If you imagine an aggressive speedup where an attacker gets a quadratic advantage over best known attack, that’s still a billion times improvement. Raising security levels is the simplest way to protect against future concerns.
In this regard, we have been working on a proposal for the Zcash community to integrate 192-bit secure SPHINCS+ (SLH-DSA-192), to accomodate post-quantum transparent transactions under hash-based cryptography.
Technical: How practical is an attack?
The best attacks on pairings use the Number Field Sieve (NFS) algorithm. NFS has a very expensive one-time computation per field, and then much cheaper operations to break each key. This differs from typical quantum attacks, where keys must be broken independently at roughly equal cost.
NFS attacks are often estimated in terms of abstract arithmetic complexity, which significantly underestimates their real-world attack cost. Memory access and data movement are major bottlenecks, even with custom hardware architectures.
Comparing the asymptotic complexity of the pairing vs. RSA NFS variants, BLS12-381 is roughly equivalent to RSA-2630. When accounting for the concrete cost of arithmetic and other operations, using recent instruction-level estimates from CurveSmash, we arrive at something closer to RSA-3072.
In September, Cognition factored RSA-260 (an 862-bit integer), developing a GPU implementation of NFS that reduced costs by 10x relative to the previous public state-of-the-art. Based on actual GPU usage, they estimate that breaking RSA-2048 would cost $37.7 quadrillion. Extrapolating their estimates to RSA-3072 puts the cost of breaking BLS12-381 on the order of $100 sextillion, and RSA-2630 at $323 quintillion.
Even if factoring turns out to be in P, there is no indication of what the exponent would be, nor if the algorithm would be practical at cryptographic sizes. A polynomial-time algorithm with an exponent of 100 would be practically useless. Most AI breakthroughs to date have been galactic algorithms that are not relevant at practical sizes.
If we assume that the unpublished rumors suggest a billion-times improvement at practical sizes, we’d see this cost brought into the $1 trillion to $300 trillion range to break. This costs months to years of high-opportunity cost computing clusters. The aggressively low estimates are comparable to the combined market capitalization of the entire cryptocurrency industry (and frontier labs). This leaves beyond-sufficient time to upgrade swiftly. We just have to start now.
In addition, we would expect to see BN-254 (with its far smaller field) be broken first, before BLS12-381.
Should we believe the rumors in the first place?
There is a well-established connection between the Riemann Hypothesis and “smooth numbers.” There is a folklore belief that RH’s proof would contain insights that lower the time complexity of factoring. This provides some context for the rumors that labs have discovered polynomial-time factoring, though it is far from evidence that the rumors are true.
Integer factorization (RSA), finite-field discrete logarithms, and attacks on pairing-based cryptography all rely on variants of the Number Field Sieve (NFS) for their best-known attacks. A major component of NFS’s complexity is finding smooth numbers that satisfy particular algebraic constraints.
The Riemann Hypothesis has direct implications on counting smooth numbers in a range. There is a possibility that the RH proof could lead to better ways to sample constrained smooth numbers. This might reduce the “sieving” cost, and lower the time complexity of factoring.
Such a breakthrough could significantly reduce the complexity of NFS and transfer across both factoring and pairing-based cryptography. However, the connection between counting and efficient construction remains unknown. Furthermore, there are reasons that one could get a factoring-only improvement; factoring has different NFS relations than pairings, enabling distinct speedups, and there could be an entirely non-factoring attack!
Summary:
There is rumor that the labs have broken factoring-based assumptions.
There is speculation that this could apply to pairings.
If you assume a billionfold speedup, it costs more than the entire crypto market cap to exploit.
Standard elliptic-curve cryptography is unaffected.
Zcash’s Ironwood pool is therefore safe.
Zcash’s legacy Sapling pool (2% of supply) could be affected, as would Ethereum & Solana consensus signatures and other ZK deployments.
Zcash should disable Sapling deposits faster.
Zcash should add post-quantum transparent ASAP.