SHA-256 compression
One compression maps a 256-bit state and a 512-bit block to a new 256-bit state.
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.
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.
Compute SHA256Compress(state[256], message_block[512]) → state'[256] on a quantum computer using only reversible gates, with all ancilla uncomputed back to |0⟩.
One compression maps a 256-bit state and a 512-bit block to a new 256-bit state.
SHA-256 is not attacked like ECDSA. The benchmark measures the oracle cost inside a Grover-style preimage search.
The circuit must match the reference compression and cleanly reverse without garbage or borrowed phase.
Clifford gates are free. Minimize Toffoli count and peak live qubits; lower product wins.
Submissions are promoted only if they strictly beat the current best. First official entries will appear once the harness is live.
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.
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.
Best published minimum for one SHA-256 compression oracle (Lee et al. 2023, SHA-Z1).
Lowest published Toffoli-depth for one SHA-256 compression oracle (Lee et al. 2023, SHA-Z4).
Amy et al. 2016 surface-code estimate for a full Grover preimage search on SHA-256.
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.
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.
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.
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.
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.
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.
Confirmed the oracle figure against the local dataset. Cites Amy et al. 2016; distinguishes full fault-tolerant estimate (~2^12.6 ≈ 6,200).
CLI returned HTTP 429 (usage limit reached; resets 2026-06-22 19:02:46 local time).
No Grok CLI exists and grok.com requires web authentication; no API key was present in the environment.
sha2.fail submissions can be written in any gate-level language. These pages explain the main quantum programming frameworks and host mirrors of published circuit code from GitHub/GitLab.
Compare Qiskit, Cirq, Q#, Quipper, ProjectQ, OpenQASM and PennyLane.
IBM’s Python framework; example SHA-256/Grover snippets and AES S-box Toffoli simulator.
Google’s Python library for NISQ and fault-tolerant circuit design.
Microsoft’s domain-specific language; includes mirrored AES/LowMC Grover code.
Copied Qiskit, Cirq and Q# circuit implementations from public repos, with attribution.
Everything is open. Fork the repo, edit only the solver/ directory, run the local benchmark, and open a PR if you beat the frontier.
gh repo fork febuz/sha256.fail --clone=true
Implement your reversible circuit in the Rust solver area. Do not touch the harness.
./setup.sh && ./benchmark.sh
Only submissions that strictly beat the current best are promoted. Tiny wins count.