⚛ sha2.fail
Frontier progress

Published quantum-circuit frontier

Select a challenge below. SHA-256 is plotted as a 3-D plane: year × logical qubits × Toffoli-depth. ECDSA shows the qubit-Toffoli trajectory from ecdsa.fail.

Loading frontier data…

Can you lower the quantum cost of SHA-2?

sha2.fail is the SHA-256 analogue of ecdsa.fail: a public benchmark for the smallest clean reversible SHA-256 compression circuit, scored by qubits × Toffoli gates.

2¹²⁸Grover calls
256state bits
512message bits
64rounds
The challenge

Build a clean reversible SHA-256 compression

Compute SHA256Compress(state[256], message_block[512]) → state'[256] on a quantum computer using only reversible gates, with all ancilla uncomputed back to |0⟩.

Primitive

SHA-256 compression

One compression maps a 256-bit state and a 512-bit block to a new 256-bit state.

Quantum model

Grover oracle cost

SHA-256 is not attacked like ECDSA. The benchmark measures the oracle cost inside a Grover-style preimage search.

Correctness

Clean reversible circuit

The circuit must match the reference compression and cleanly reverse without garbage or borrowed phase.

Scoring

Qubit × Toffoli product

Clifford gates are free. Minimize Toffoli count and peak live qubits; lower product wins.

Leaderboard

Best known reversible SHA-256 circuits

Submissions are promoted only if they strictly beat the current best. First official entries will appear once the harness is live.

# Solver / approach Toffoli Qubits Score Status
1 Textbook ripple-carry baseline — — — Pending harness
2 Carry-save / Gidney adders — — — Open
3 Windowed uncompute + ancilla recycling — — — Open
Post-quantum migration

Background signatures: secp256k1 out, SLH-DSA-SHA2-128s in

This repository no longer treats secp256k1/ECDSA as the background signing profile. It remains a legacy comparison; new metadata uses a hash-based post-quantum standard.

LayerOld profileNew profileReason
Background signatures secp256k1/ECDSA SLH-DSA-SHA2-128s Hash-based, stateless, NIST FIPS 205 post-quantum standard.
Quantum benchmark secp256k1 point addition on ecdsa.fail SHA-256 compression on sha2.fail Measures Grover oracle cost rather than elliptic-curve discrete logs.
Public message Can you break ECDSA? Can you lower the quantum cost of SHA-2? Same progress framing, different primitive and risk model.
Frontier progress

What the frontier measures

The interactive chart at the top plots the best published reversible SHA-256 compression circuits in a 3-D plane: year × logical qubits × Toffoli-depth. The official sha2.fail score is Toffoli count × peak qubits; because not every paper reports Toffoli count, the visualisation uses qubits and Toffoli-depth. Lower is better in every direction.

Width

768 logical qubits

Best published minimum for one SHA-256 compression oracle (Lee et al. 2023, SHA-Z1).

Depth

4,418 Toffoli-depth

Lowest published Toffoli-depth for one SHA-256 compression oracle (Lee et al. 2023, SHA-Z4).

Physical scale

~1.39 × 10⁷ physical qubits

Amy et al. 2016 surface-code estimate for a full Grover preimage search on SHA-256.

AI consensus

2,402 logical qubits

Claude, Kimi and Codex all cited Amy et al. 2016 as the oracle baseline.

Download the full dataset (JSON), including related work from 2024–2026.

Academic evidence

Papers that published concrete improvements

Only papers that report an expected improvement in logical qubits, Toffoli-depth, or the qubit×depth time-area product are kept in the main frontier. Each title links to the paper.

Year Paper Best circuit Qubits Toffoli-depth Improvement
2016 Estimating the cost of generic quantum pre-image attacks on SHA-2 and SHA-3
Amy, Di Matteo, Gheorghiu, Mosca, Parent, Schanck
SHA-256 oracle 2,402 70,400 (T-depth) First concrete fault-tolerant cost estimate; baseline.
2018 Time-Space Complexity of Quantum Search Algorithms in Symmetric Cryptanalysis
Kim, Jeong, Han
SHA-C6 938 10,112 First time-space trade-offs; cut qubits by 61% vs baseline.
2023 T-depth reduction method for efficient SHA-256 quantum circuit construction
Lee, Lee, Lee, Choi
SHA-Z1 / SHA-Z4 768 / 962 32,895 / 4,418 Lowest published qubit count and lowest published Toffoli-depth.

Recent related work (2024–2026)

Lim et al. 2024 — SHA-2/SHA-3 quantum collision search (BHT), 5,715 qubits / 3,382 Toffoli-depth SHA-2-256.
Song et al. 2024 — Grover on Scrypt; SHA-256 in PBKDF2 stage uses 17,100 qubits and 58,448 Toffoli gates.
Lee et al. 2024 — Toffoli-depth reduction for SHA3-256 (1,600 qubits / T-depth 264).
Jang et al. 2025 — Quantum implementation and analysis of SHA-2 and SHA-3 (latest peer-reviewed IEEE study).
Dallaire-Demers 2026 — End-to-end physical-qubit and energy estimate for Grover Bitcoin mining; double-SHA-256 oracle at 833 qubits / 131,832 Toffoli gates.

AI model survey

What other AI models estimate

We asked several CLI-accessible AI assistants the same question: “How many logical qubits are needed for a reversible SHA-256 Grover oracle, and what is the academic evidence?” Their answers are included in the frontier chart with a star symbol.

Claude

2,402 logical qubits

Cites Amy et al. 2016 as the canonical reference; mentions newer 2021–2024 optimizations may reach 1,500–2,200 qubits but without naming a specific paper.

Kimi

2,402 / ~6,300

Distinguishes the oracle circuit (2,402 qubits) from the full fault-tolerant Grover engine (~2^12.6 ≈ 6,300 logical qubits). Cites Amy et al. arXiv:1603.09383.

Codex

2,402 / ~6,200

Confirmed the oracle figure against the local dataset. Cites Amy et al. 2016; distinguishes full fault-tolerant estimate (~2^12.6 ≈ 6,200).

Pi

Unavailable

CLI returned HTTP 429 (usage limit reached; resets 2026-06-22 19:02:46 local time).

Grok

Unavailable

No Grok CLI exists and grok.com requires web authentication; no API key was present in the environment.

Contribute

How to submit a circuit

Everything is open. Fork the repo, edit only the solver/ directory, run the local benchmark, and open a PR if you beat the frontier.

Fork & clone

gh repo fork febuz/sha256.fail --clone=true

Edit solver/

Implement your reversible circuit in the Rust solver area. Do not touch the harness.

Run the benchmark

./setup.sh && ./benchmark.sh

Open a pull request

Only submissions that strictly beat the current best are promoted. Tiny wins count.

FAQ

Frequently asked questions

No. This benchmark measures the theoretical quantum resource cost of a reversible SHA-256 oracle. It is a public-progress tracker, not a live exploit and not a claim that SHA-256 is broken today.
ecdsa.fail optimizes secp256k1 point addition, the inner loop of Shor attacks on ECDSA. sha2.fail optimizes SHA-256 compression, the inner oracle of Grover preimage attacks. Both ask: how small can the quantum circuit be?
Any reversible gate set. The score counts Toffoli (CCX/CCZ) executions and peak live qubits. Clifford gates (X, CX, SWAP, CZ, …) are free. Ancilla must be returned to |0⟩ cleanly.
No. The evaluator checks reversibility and ancilla cleanliness. A circuit with garbage or borrowed phase fails validation and does not score.
SLH-DSA is the NIST FIPS 205 stateless hash-based signature standard, based on SPHINCS+. The SHA2 parameter set keeps the site's story coherent: we study SHA-2 quantum costs and use SHA-2-based post-quantum signatures for metadata.