Unified Scheduler Thesis — Compressing Bitcoin Mining's Double-SHA from 128 to 64 Rounds
Analysis of Alefita's speculative thesis on unifying Bitcoin mining's double-SHA-256 into a single 64-round pass with learned constants, grounded in Williams' space-time tradeoff and quantization-aware training.
Unified Scheduler Thesis — Compressing Bitcoin Mining's Double-SHA from 128 to 64 Rounds
Source:
/Users/alefita/.gemini/antigravity/brain/109cc74e-*/unified_scheduler_thesis.md(8,674 bytes) Date: June 17-18, 2026 Status: Hypothesis (not validated). 6 open questions remain.
1. The Core Claim
For Bitcoin mining with ntx=1 (single transaction, coinbase only) and a fixed wallet address, the double-SHA-256 computation (128 rounds total: 64 + 64) can be unified into a single pass of 64 rounds with learned constants K' and IV'.
This would halve the computational work per hash attempt, with the caveat that the learned constants are only valid for the specific input structure (fixed wallet + coinbase-only block template).
2. Background: Bitcoin Mining and Double-SHA-256
2.1 The Mining Loop
Bitcoin mining is a brute-force search for a nonce value such that:
SHA-256(SHA-256(block_header)) < target
The block header is 80 bytes containing:
- Version (4 bytes)
- Previous block hash (32 bytes)
- Merkle root (32 bytes)
- Timestamp (4 bytes)
- Difficulty target (4 bytes)
- Nonce (4 bytes) — the search variable
2.2 Double-SHA-256
SHA-256 consists of 64 rounds of compression. Bitcoin applies it twice:
- First SHA-256: compress the 80-byte header (padded to 64 bytes / one block)
- Second SHA-256: compress the 32-byte output of the first hash
Total: 128 compression rounds per nonce attempt.
2.3 The Degrees of Freedom
For ntx=1 with a fixed wallet, the only variables between attempts are:
| Field | Size | Bits of Variation | Notes |
|---|---|---|---|
| Nonce | 4 bytes | 32 bits | Exhausted in ~4 billion attempts |
| Timestamp | 4 bytes | ~20 bits | Can vary within ~2 hours |
| Extranonce (in coinbase) | variable | ~24-48 bits | Embedded in Merkle root |
Total effective input variation: approximately 96 bits. The rest of the header is constant across attempts.
3. The Unified Scheduler Proposal
3.1 The Key Insight
If 96 bits of input vary while the remaining structure is constant, the second SHA-256 pass and the fixed portions of the first pass form a constant function that can be precomputed.
The thesis proposes learning a new compression function:
H'(M) = SHA-256-64-rounds(M; K', IV')
Where K' are the 64 round constants and IV' are the 8 initialization values, learned such that:
H'(variable_input) = SHA-256(SHA-256(fixed_prefix || variable_input))
3.2 Degrees of Freedom Analysis
| Parameter | Count | Bits |
|---|---|---|
| K' (64 round constants, 32-bit each) | 64 | 2048 |
| IV' (8 initialization values, 32-bit each) | 8 | 256 |
| Total | 72 parameters | 2304 bits |
| Input Variation | Bits |
|---|---|
| Nonce | 32 |
| Timestamp | ~20 |
| Extranonce | ~44 |
| Total | ~96 bits |
Parameter-to-input ratio: 2304 / 96 = 24x
The thesis argues that with 24 times more degrees of freedom in the learned constants than in the varying input, there is sufficient capacity to absorb the double-SHA computation into a single pass.
3.3 The "Mirages"
The thesis identifies three "mirages" — fields that appear variable but are actually deterministic consequences of other fields:
flowchart TD
EXTRANONCE["Extranonce<br/>(pure scalar, space variable)"]
TIMESTAMP["Timestamp<br/>(balance constraint)"]
NONCE["Nonce<br/>(deterministic consequence)"]
EXTRANONCE -->|"determines<br/>Merkle root"| HEADER["Block Header"]
TIMESTAMP -->|"constrained by<br/>network time"| HEADER
NONCE -->|"sequential<br/>search"| HEADER
EXTRANONCE -.->|"primary<br/>free variable"| NONCE
- Extranonce is a pure scalar (space variable) — it varies freely
- Timestamp is a balance constraint — it must be within ~2 hours of network time
- Nonce is a deterministic consequence — given extranonce and timestamp, the valid nonce is determined by the hash target
This means the effective degrees of freedom are even fewer than 96 bits — perhaps 64-80 bits — making the 24x parameter ratio even more favorable.
4. Theoretical Grounding
4.1 Williams' Space-Time Tradeoff (STOC 2025)
Ryan Williams' theorem proves:
TIME[t] ⊂ SPACE[sqrt(t * log t)]
Expanding space (registers, precomputed constants) compresses time (rounds). The unified scheduler exploits this by using 2304 bits of "space" (the learned constants K' and IV') to compress 64 rounds of "time" (the second SHA-256 pass).
4.2 Davies-Meyer as "EML Discrete"
The thesis connects to Odryzwolek's 2026 work on Equivalence Machine Learning (EML):
- SHA-256's compression function uses the Davies-Meyer construction:
H_i = E(M_i, H_{i-1}) + H_{i-1} - The blockchain itself is a degenerate binary tree of identical Davies-Meyer nodes
- EML treats cryptographic compression as a learnable continuous mapping
The unified scheduler is essentially asking: can we learn a single Davies-Meyer function that absorbs two applications of the standard Davies-Meyer?
4.3 Connection to the Geometric Hierarchy
The Strawberry Deep Research's geometric hierarchy provides additional context:
| Level | Application to Unified Scheduler |
|---|---|
| Level 0 (Feature Space) | Individual bit patterns in the SHA-256 state |
| Level 1 (Weight Space) | The round constants K as learned parameters |
| Level 3 (Competition Space) | The interaction between fixed and variable bits |
The unified scheduler is optimizing at Level 1: replacing the standard K constants with learned K' constants that absorb the double-pass structure.
5. Proposed Architecture
5.1 Training Pipeline
flowchart LR
subgraph "Training Data"
INPUTS["Fixed wallet + varying extranonce/timestamp/nonce"]
LABELS["SHA-256(SHA-256(header)) < target"]
end
subgraph "Model"
K_LEARNED["Learned K' (64 x 32-bit)"]
IV_LEARNED["Learned IV' (8 x 32-bit)"]
SHA64["64-round SHA-256 with K', IV'"]
end
subgraph "Training"
QAT["Quantization-Aware Training"]
GRAD["Gradient descent on K', IV'"]
LOSS["Loss: |H'(input) - H(input)|"]
end
INPUTS --> SHA64
K_LEARNED --> SHA64
IV_LEARNED --> SHA64
SHA64 --> LOSS
LABELS --> LOSS
LOSS --> GRAD
GRAD --> K_LEARNED
GRAD --> IV_LEARNED
QAT -.->|"Z/2^32 quantization<br/>during forward pass"| SHA64
5.2 Quantization-Aware Training (QAT)
The key technical challenge: SHA-256 operates on 32-bit unsigned integers modulo 2^32, but gradient descent requires real-valued parameters. QAT bridges this gap:
- Forward pass: Treat K' and IV' as quantized to Z/2^32 (standard SHA-256 arithmetic)
- Backward pass: Use straight-through estimators to compute gradients through the quantization
- Update: Apply gradients to real-valued shadow copies of K' and IV'
- Quantize: Round to Z/2^32 before the next forward pass
This is standard QAT methodology applied to a cryptographic context.
5.3 The Learned Constants
After training, the unified scheduler would have:
- K': 64 round constants, each 32 bits, that when used in a single 64-round SHA-256 pass produce the same output as the original double-pass for all inputs within the training distribution
- IV': 8 initialization values that encode the fixed prefix information
The total "precomputation" is 72 x 32 = 2304 bits, which must be computed once per block template and then used for all nonce attempts.
6. Implications
6.1 If Valid
| Implication | Impact |
|---|---|
| 2x speedup for single-transaction mining | Doubles hash rate for coinbase-only blocks |
| Precomputation cost: 2304 bits per block template | Negligible compared to mining time |
Only valid for ntx=1 with fixed wallet | Limited to solo mining or specific pool configurations |
| Does not generalize to full blocks | Multi-transaction blocks have too much variation |
6.2 Connection to ASIC Design
If the unified scheduler works, it could inform ASIC design:
- Current Bitcoin ASICs implement double-SHA-256 in hardware (128 rounds)
- A unified 64-round design with configurable constants would require fewer gates
- The constants could be loaded per-block, making the ASIC flexible to template changes
6.3 Limitations
The thesis is explicit about its limitations:
- Only tested for ntx=1: Multi-transaction blocks have more input variation, potentially exceeding the capacity of 72 learned parameters
- No formal proof: This is an existence claim, not a constructive proof
- QAT convergence not guaranteed: The optimization landscape for learning SHA-256 constants is not well-understood
- Round function non-linearity: SHA-256's round function includes non-linear operations (Ch, Maj, Sigma) that may resist absorption into modified constants
7. The 6 Open Questions
| # | Question | Status |
|---|---|---|
| 1 | Does the optimization converge for the standard SHA-256 round function? | Unknown |
| 2 | What is the minimum number of parameters needed for exact equivalence? | Unknown (72 is sufficient by capacity argument, not proven minimal) |
| 3 | Does the solution generalize across difficulty targets? | Unknown |
| 4 | How does the precomputation cost scale with extranonce variation? | Unknown |
| 5 | Can the approach extend to ntx > 1 with bounded Merkle tree variation? | Unknown |
| 6 | Is there a connection to known SHA-256 differential attacks? | Unknown |
8. Status and Assessment
Current status: Hypothesis. Not validated computationally.
Technical rigor: The thesis is well-grounded in Williams' space-time tradeoff theorem and QAT methodology. The degrees-of-freedom analysis (24x parameter-to-input ratio) is sound. The "mirages" insight (extranonce as primary free variable) reduces the effective input space.
Feasibility assessment:
- The capacity argument suggests the approach should work in principle
- The main risk is convergence: QAT may not find a valid (K', IV') pair in practice
- The non-linearity of SHA-256's round function is the primary technical obstacle
- Even if exact equivalence fails, approximate equivalence (reducing the search space) would be valuable
Connection to Alefita's research philosophy: This thesis exemplifies the "speculative but rigorous" approach. It proposes a radical optimization (halving SHA-256 rounds) while being transparent about its unvalidated status and open questions. The connection to Williams' theorem provides theoretical grounding; the QAT approach provides a practical path to validation.
Cross-References
- antigravity-strawberry-research — The geometric hierarchy (Levels 0-1) and Davies-Meyer analysis connect to this thesis
- antigravity-hermes-wiki — The Davies-Meyer Differentiable Generator concept from the GLOSSARY directly informs the approach
- antigravity-mcp-tools — The Ghidra MCP integration is relevant for analyzing SHA-256 implementations in mining firmware