Bitcoin’s security relies on the strength of ECDSA over the secp256k1 curve, and consensus itself is defined solely by the code of the reference client—”The code is the spec.” Shor’s quantum algorithm theoretically threatens the first pillar, while the second makes any discussion of migration non-rigorous: it is impossible to verify a change to something that has no independent specification. This paper analyzes the Hornet Node preprint—a compact, declarative, executable C++ Bitcoin consensus specification and the Hornet DSL—and tests the hypothesis: can such a specification become a formal substrate for modeling a post-quantum signature rule and differential migration verification. We do not claim that a quantum hack of Bitcoin has occurred or is imminent; we show where exactly in the specification the vulnerable primitive is “hardwired,” what a pure post-quantum signature rule would look like, and what verifiable experiments separate the risk assessment from the demonstrated attack.
Content
- Intrigue: two fragility in one point
- Statement of the problem and the hypothesis being tested
- Mechanism: from discrete logarithm to pure rule
- History: From a 2013 fork to a declarative specification
- Hornet architecture as an object of research
- What does a post-quantum signature rule look like?
- Specification Robustness: Errors and Differential Testing
- A Fair Comparison: What Exactly Does the Quantum Algorithm Promise?
- Reproducibility: What’s Already Working
- Cryptography and Security: Where is secp256k1 “Hidden”?
- Practical value, economics and risks
- The Future, Open Questions, and Synthesis
- Work Linkage Matrix
- Checklist before publication
- Sources
1. Intrigue: two fragility that meet at one point
Imagine two statements, each of which is known to experts individually, but together they form an awkward paradox.
First, Bitcoin signatures are ECDSA over the secp256k1 curve. The security of this scheme is based on the difficulty of the discrete logarithm problem on a set of points on an elliptic curve. Shor’s algorithm solves the discrete logarithm in polynomial time on a quantum computer—provided the device is large enough and reliable enough.
Second, the Bitcoin consensus lacks an independent formal specification. As Hornet’s author explicitly states, “The code is the spec”—the specification is the reference client code. This code contains side effects, mutable state, concurrency, and historical design, making it unsuitable for formal verification.
The paradox is that the most significant consensus change in Bitcoin’s history —the hypothetical transition to post-quantum signatures—would have to be discussed, tested, and verified against a specification that doesn’t exist in its purest form. The 2013 response to the BerkeleyDB fork was reactive: an implicit rule was made explicit retroactively. Quantum migration requires a systematic approach, not a post-factum reaction.
The research question of this paper is: Can a declarative executable consensus specification (Hornet Node + Hornet DSL) serve as a formal substrate on which to (a) accurately model the quantum threat to signatures and (b) verifiably design post-quantum consensus migration?
It is this question that makes the article interesting: it connects quantum computing, cryptanalysis, and consensus engineering into one verifiable line, without promising either a “hack tomorrow” or “universal quantum speedup.”
2. Statement of the problem, object and hypothesis being tested
2.1. Object and boundaries
The object of the study is the set of Bitcoin consensus rules as expressed by the Hornet Node, and the Hornet DSL language as a means of canonically describing these rules.
What’s not covered: building a quantum computer, specific timelines for the development of a cryptanalytically significant device, market forecasts, and legal aspects. The article also doesn’t claim that Hornet is a complete specification: the preprint explicitly lists unfinished parts—full script execution, UTXO set evolution, disk storage, and peer management.
2.2. Hypothesis and refutation criterion
H1. Hornet’s pure rules and its DSL reduce the consensus behavior space to a statically analyzable form sufficient to (a) precisely express a post-quantum signature verification rule without side effects and (b) differentially verify migration between implementations.
Refutation criterion. If a DSL fails to express verification of a post-quantum signature without violating purity, state locality, and dependency layers; or if differential testing fails to distinguish the behavior of two implementations given identical inputs, then H1 should be considered false.
2.3 Why this is not an idle question
Hornet’s author formulates the motivation through the risk of consensus splits: client diversity is a sign of healthy decentralization, but without a formal specification, a faulty client can cause a consensus split. The preprint estimates that approximately 22% of network nodes run Knots, a derivative of Core. The more independent implementations, the more valuable the specification against which they can be verified. Quantum migration is a scenario in which the number of simultaneously changing implementations and rules is maximized.
Separation of Epistemic Statuses. In this article, facts (the preprint content, historical events, NIST standards) are separated from estimates (resource estimates for a quantum attack) and hypotheses (H1, illustrative code examples). The DSL and C++ illustrations in Section 6 are the author’s own constructions, not citations from the preprint.
3. Mechanism: from discrete logarithm to pure rule
3.1. Physical and mathematical basis
ECDSA relies on the fact that Q = k·G it is computationally difficult to find a scalar from a point on the secp256k1 curve k. Shor’s algorithm reduces the problem to finding the period of a special function; the quantum Fourier transform extracts the period in a polynomial number of operations. The key ingredients are superposition, interference, and measurement; entanglement in the canonical formulation is not a necessary “fuel,” although it is often cited as the primary reason in popular descriptions.
What’s important for our topic isn’t the conclusion “a quantum computer breaks ECDSA,” but the form in which this conclusion is presented : in the Hornet specification, cryptographic primitives— uint256, SHA256, secp256k1 —are declared as built-in types and functions. That is, the vulnerable primitive is included in the specification as a named building block, rather than being disseminated in the imperative code.
3.2. A minimal example without analogies
The preprint describes a proof-of-work verification rule: the header hash is compared to an extended compact target; if exceeded, a typed error is returned. This rule is a pure function of the context, without reference to global state. Similarly, a signature verification rule can be a pure function of the transaction, the public key, the signature hash, and the signature itself. Purity here is not cosmetic: it enables reasoning about the rule separately from the rest of the consensus .
3.3 Model Assumptions
Any quantum threat assessment relies on an error model and the distinction between logical and physical qubits. These concepts are also critical for a fair comparison: a resource estimate of “logical qubits” without taking error correction and execution time into account is not an attack assessment. In this article, we consistently label such numbers as estimates , not experimental results.
4. History: From a 2013 fork to a declarative specification
4.1 Lesson of 2013
In March 2013, an incompatibility between BerkeleyDB and Core led to a consensus split: v0.7 nodes running BerkeleyDB rejected a block that exceeded the database lock limit, while v0.8 nodes running LevelDB accepted it. The resolution was sociotechnical: a minority of v0.8 miners reverted to v0.7, effectively canonizing the BerkeleyDB limit as a consensus rule. In subsequent releases, Core made this implicit rule explicit by adding a check rejecting blocks with more than 10,000 UTXO changes.
Hornet’s author draws a principle from this episode: the safest approach is to explicitly specify consensus rules, regardless of implementation details. What was done reactively for a single rule in 2013, Hornet aims to do systematically for the entire protocol.
4.2 Competing approaches
- libbitcoinkernel is an incremental refactoring of existing imperative code, encapsulating consensus and validation in a separate library. This is a move away from modularity, rather than a declarative specification.
- BitML – Transaction-level contract reasoning, limited scope.
- Simplicity is a verifiable language for scripting, but not for all consensus.
- Informal community documentation efforts have failed to achieve executable semantics.
Hornet is conceived differently: declarative in style, implementation-independent, and pure from the start. In this sense, it inherits the spirit of 2013, but changes the scope: not just one rule, but the entire protocol.
5. Hornet architecture as an object of research
5.1 Layers and One-Way Dependencies
Hornet enforces a strict one-way dependency graph between layers: hornet::protocol it defines protocol types and hornet::consensus can access the protocol, but hornet::data sits above consensus, so the consensus logic knows nothing about storage details. This discipline limits the dependency surface and keeps consensus compact.
A minimal abstraction is particularly important HeaderAncestryView: it allows the Median Time Past rule (BIP113) to query precisely the required ancestor information without violating layer boundaries. This is an important architectural technique: the purity of the rules is preserved even when dependent on the dynamic state of the chain.
5.2. Rulesets
Validation in Hornet is defined as an ordered set of rules: a list of pure, composable, testable functions, each responsible for a single invariant. Each rule returns either a typed error or a success. Rules can be marked with a BIP tag for conditional application based on activation height. Header rules are expressed in fewer than 50 lines; the author claims that the full set of header, transaction, and block rules is also expressed very compactly.
5.3. Chain-tree and sidecars
The chain’s data structure is a hybrid of a linear array (the main chain) and a fork forest. The memory footprint for all mainnet headers is approximately 69 MB. During reorganization, a branch is promoted from the forest to the array, and an array segment is promoted to the forest; the invariant “every node is either in the array or in the forest” is preserved.
Sidecars ( Sidecar<T>) are metadata that mirror the chain-tree structure and are synchronized during reorganizations. KeyframeSidecar<T> They encode piecewise constant metadata: since validation is linear, there are typically one or two status changes per chain, and the entire validation status occupies several integers in memory.
Why is this a key element for quantum migration? Sidecar is a ready-made mechanism for tracking the migration state across blocks : which signature scheme was used, whether the PQ height was activated, and which inputs carry the PQ witness. The metadata resides in the application layer, without polluting the consensus data, and accurately tracks reorganizations.
6. What does a post-quantum signature rule look like in a declarative model?
6.1 DSL Capabilities
The Hornet DSL is intended to be a canonical, implementation-independent consensus language for Bitcoin. Its stated properties include determinism, local and explicit state, single-threading, immutability by default, mandatory return value and no side effects, built-in protocol types and cryptographic primitives, a rule as a “success or typed error” function, statically analyzed rule sets, keywords, require and annotations @bip.
6.2. Illustration (designed by the author of the article, not from the preprint)
// ИЛЛЮСТРАЦИЯ. Не цитата из препринта.
// Гипотетическое правило проверки постквантовой подписи.
@rule
@phase("transaction")
@bip(BIP_XX_PQ)
rule ValidatePostQuantumSignature(tx: Transaction, ctx: PQContext) -> TransactionError? {
// Каждый вход несёт либо классическую, либо PQ-подпись
// в зависимости от высоты активации.
require ValidateSignatureSchemePresent
require ValidatePQPublicKeyFormat
require ValidatePQLatticeSignature
return
}
This notation satisfies the DSL constraints: there is no global state, no side effects, the function is deterministic, and returns a typed error. The rule is composed with others via require, and @bip allows for inclusion by height.
6.3. The same meaning in C++ Hornet style
// ИЛЛЮСТРАЦИЯ. Не цитата из препринта.
[[nodiscard]] inline auto ValidatePQSignature(const TxContext& ctx)
-> std::expected<void, TxError> {
if (!ctx.tx.HasPQWitness()) return TxError::MissingPQWitness;
if (!crypto::MLDSA::Verify(ctx.pq_pubkey, ctx.sighash, ctx.pq_sig))
return TxError::InvalidPQSignature;
return {};
}
Note the symmetry with the proof-of-work rule from the preprint: pure function, typed error, no access to global state. It is this symmetry that makes formal reasoning about the PQ rule possible, separate from the rest of the consensus.
6.4 What should be taken into account in the resource model
- Logical qubits – an estimate of the number of qubits before error correction.
- Physical qubits – taking into account the correction code and error threshold.
- The depth of the circuit and the number of runs are analogous to the “cost of preparing and loading data” in classical computing.
- Execution time and acceptable error – without them, the assessment is not comparable with classical methods.
7. Specification Robustness: Errors and Differential Testing
7.1. Typed errors as the first barrier
In Hornet, every rule returns either a success or a typed error ( HeaderError, TransactionError, BlockError). This isn’t just cosmetic: typed errors make the specification’s behavior observable and distinguishable. When migrating, it’s not just “a block is rejected” that matters, but why it’s rejected—otherwise, differential testing loses its resolution.
7.2 Differential testing and LLM adversarial checks
The preprint outlines the verification framework: generate C++ from the DSL, continuously compare the Hornet DSL backends with Hornet Node and Bitcoin Core, and use LLM in the test framework to analyze specification agreement and generate differential adversarial tests. The author estimates that after verifying a billion blocks, approximately 20,000 years of consensus validation behavior will be simulated.
This is an estimate , not a proof: the space of all blocks is too large to be exhaustively searched, but the space of paths in the structured specification is significantly smaller. The goal of this approach is not to “prove everything,” but to make the probability of consensus error arbitrarily small and quantifiable.
7.3. The Error Correction Analogy and Its Limits
Be careful with the analogy. Typed errors and differential testing resemble error correction: fault detection and isolation. But this is an analogy, not an identity. Quantum error correction deals with physical qubits and thresholds; specification reliability deals with rule semantics. Mixing these levels in this article is strictly prohibited by the question builder checklist.
Nevertheless, the analogy is useful as a heuristic: in both cases, gains are achieved through structure—the redundancy of the correction code in one case, decomposition into pure rules in the other.
8. A Fair Comparison: What Exactly Does the Quantum Algorithm Promise?
This section follows the discipline of questions 37–42 of the designer: comparison must be made with the best suitable classical method, with the same accuracy, probability of success, and consideration of all costs.
| What is stated | Status | What is needed for a fair comparison? |
|---|---|---|
| Shor’s algorithm solves the discrete logarithm in polynomial time. | Theoretical result | Error model, number of logical and physical qubits, circuit depth |
| ECDSA over secp256k1 is vulnerable to Shore | Theoretical consequence | Resource estimation for 256-bit curve, execution time |
| Public demonstration of ECDSA cracking | Not confirmed | Reproducible experiment on a real device |
| Classical comparison method | Pollard rho for DLP | Taking into account memory, time and probability of success |
The key takeaway from this section is that we’re dealing with an assessment of future risk, not a demonstrated attack . This doesn’t weaken the motivation for the specification—on the contrary, the less certain the timeframe, the more important it is to have a formal model of what exactly needs to be changed.
Why isn’t “quantum advantage” the primary concern here? For a cryptanalytic threat, it’s not the speed of a specific test that matters, but the resource estimation of the full attack. For consensus migration, it’s not the synchronization speed that matters, but the correctness of the rules. Hornet’s value lies precisely in the latter: it provides a language in which migration becomes verifiable.
9. Reproducibility: what already works and what doesn’t yet
9.1 What is confirmed by the work
- Synchronization and validation of all mainnet headers takes less than 3 seconds; all blocks take several hours in a single thread (according to the preprint and UI screenshot: 915,069 headers, 751,868 blocks).
- Memory for all mainnet headers is about 69 MB.
- The code is open, without external dependencies; the rules fit into a compact set of lines.
- Support for chain reorganizations is implemented through branch promotion in the chain-tree.
9.2. What else is missing
- Full script execution (opcode runtime is implemented, but not integrated into block validation).
- UTXO set evolution and disk storage.
- Peer management: The client connects to one peer.
- Formal Correctness Proof and DSL Compiler in C++.
For our hypothesis, this means that reproducibility is still partial . The specification is reproducible in terms of headers, transactions, and block structure; full consensus reproducibility is a task for future versions. This is important for quantum computing: an unfinished specification cannot be relied upon as “proven”; it can be used as a working framework for future testing.
10. Cryptography and security: where is secp256k1 “hidden” in the specification?
10.1 Statement of the cryptanalysis problem (questions 49–52)
Problem: Discrete logarithm in a secp256k1 point group. Algorithm: Shor, with error correction assumptions. Resources: Estimates of logical and physical qubits, time, and permissible error vary by orders of magnitude. Threat model: What initial data is available to the attacker.
10.2 When the public key is available to an attacker (question 54 – central)
In Bitcoin, the public key is not always revealed. In a P2PKH output, it is hidden behind the hash until spent; upon spending, the key is revealed in the signature script. In P2PK outputs, the key is immediately revealed. Address reuse increases exposure. This leads to a practical consequence: the quantum threat is heterogeneous across time and output types , and a formal specification allows this heterogeneity to be expressed as a property of the rule, rather than as oral tradition.
The strength of Hornet’s approach to this task is that it has a built-in primitive in the DSL secp256k1 . This means that the vulnerability is named and localized in the specification . The post-quantum rule isn’t “smeared” across the imperative code, but is added alongside it, with an explicit annotation @bip and an explicit height activation model.
10.3 QKD versus post-quantum cryptography (question 53)
Quantum key distribution solves the symmetric key distribution problem, but it doesn’t solve the signature problem. Signatures require post-quantum cryptography: in August 2024, NIST approved FIPS 203 (ML-KEM, key establishment), FIPS 204 (ML-DSA, signatures), and FIPS 205 (SLH-DSA, hash signatures). Practical migration is being considered in the NCCoE project. For Bitcoin, this means: migration is not “enabling QKD,” but changing the signature verification rules, i.e., changing the consensus.
10.4 Hashing and proof-of-work (question 54, part two)
Proof-of-work in Hornet is expressed by a separate hash-to-target comparison rule. Grover’s quantum algorithm provides a quadratic speedup in searches but doesn’t catastrophically break SHA-256; the threat to signatures is fundamentally different. Distinguishing these mechanisms isn’t pedantic, but a prerequisite for proper risk assessment: “quantum PoW” and “quantum signatures” cannot be mixed in the same statement.
10.5. Transition cost (question 55)
The migration cost is determined by the size of PQ signatures and keys (their impact on block weight), the complexity of verification, the need for a new witness type, the coexistence period of the schemes, and the risk of a split upon activation. Each of these points in the declarative model becomes a separate verifiable rule or parameter—which is the practical value of the specification.
11. Practical value, economics and risks
11.1 Who needs this?
For node operators—to verify independent implementations against the specification. For institutions with large Bitcoin treasuries—the preprint explicitly states that formal proof of consensus correctness is potentially imperative for such organizations. For researchers—to simulate hypothetical forks and stress-test invariants in a controlled environment.
11.2 Minimum persuasive demonstration
Not “full formal verification,” but a smaller, yet verifiable step: a PQ signature rule in the DSL, the C++ code generated from it, a differential test against a modified version of Core with the same rule, and a reproducible discrepancy report. This step verifies H1 directly.
11.3. Risks
- Dual-use: Consensus analysis tools are applicable both to finding and attacking inconsistencies.
- Vendor Dependency: The specification must remain independent of the implementation, otherwise it loses its meaning.
- Maturity Reassessment: Unfinished parts of Hornet cannot be passed off as completed.
- Hype over data: Claims of “quantum readiness” without resource assessments are marketing, not science.
12. The Future, Open Questions, and Synthesis
12.1. Open questions
- Can a DSL express a PQ-rule without violating purity and layers? (Direct test of H1.)
- Are typed errors sufficient to differentiate migration behavior?
- How does the attack resource estimate relate to the PQ scheme parameters (key size, signatures, verification cost)?
- What parts of the consensus remain outside the specification and how does this affect the completeness of the threat model?
12.2 The following experiments distinguishing explanations
- Implement the PQ signature rule in DSL and generate C++.
- Run a differential test against a mock version of Core with the same rule on synthetic blocks.
- Measure the proportion of blocks where behavior differs and classify the discrepancies by typed errors.
- Repeat with optimistic and conservative resource estimates of the quantum attack.
Measurable milestones: number of rules covered by the DSL; number of rules for which the generated C++ matches Hornet Node; number of blocks in the differential run; number of error types distinguished by the test. None of the milestones require a promise of a precise breakthrough date.
12.3. Synthesis
The quantum threat and the lack of a pure specification are two distinct brittlenesses, but they reinforce each other. The former makes migration necessary, the latter makes it lax. Hornet doesn’t eliminate either of these brittlenesses alone, but it creates a language that makes both verifiable. This is the main conclusion of the paper: the value of a declarative consensus specification isn’t that it “proves Bitcoin,” but that it enables honest conversation about its future—including the post-quantum one .
Work Linkage Matrix
The table shows how the Hornet preprint elements relate to the designer’s questions and what exactly needs to be checked when combining.
| Hornet Element | Designer questions | What to check |
|---|---|---|
| Clean rulesets | 1–6, 25–30 | Is a PQ rule expressible without side effects and global state? |
DSL: require, @bip | 49–56 | Is height activation and rule composition modeled? |
Built-in secp256k1 | 49–52, 54 | Where is the vulnerable primitive located and when is the key available to the attacker? |
| Typed errors | 31–36 | Does the specification differentiate reasons for migration failure? |
| Sidecars | 63–68 | Is the migration status tracked by block during reorganizations? |
| Chain-tree | 19–24 | Is there enough memory and speed for experiments? |
| Differential testing | 43–48 | Is the comparison of implementations reproducible? |
| Unfinished parts (scripts, UTXO, storage) | 69–75 | What parts of the consensus are not yet covered by the specification? |
Checklist before publication
- Observations, evidence, estimates and forecasts are separated.
- Each significant statement has a source or is marked as a hypothesis/illustration.
- Physical qubits are not replaced by logical ones; simulation is not passed off as an experiment.
- The quantum threat is compared under an explicit error model and full cost accounting.
- There are no promises of an exact hack date or universal speedup without proof.
- Hornet’s limitations (unfinished parts) are clearly stated.
- The reader understands what new information the article provides and how to verify it.
Sources
- T. Sharp. Hornet Node: A Declarative, Executable Specification of Bitcoin Consensus. arXiv:2509.15754v2. URL: arxiv.org/abs/2509.15754 .
- S. Nakamoto. Bitcoin: A Peer-to-Peer Electronic Cash System. 2008. URL: bitcoin.org/bitcoin.pdf .
- Bitcoin Core Developers. Bitcoin Core. URL: github.com/bitcoin/bitcoin .
- Bitcoin Core Developers. libbitcoinkernel. URL: github.com/bitcoin/bitcoin/tree/master/src/kernel .
- De Filippi, P., & Loveluck, B. Analyzing the 2013 Bitcoin fork: centralized decision-making saved the day. Princeton CITP Blog, 2015.
- Bartoletti, M., Zunino, R. BitML: A Calculus for Bitcoin Smart Contracts. arXiv:1804.07574.
- Russell O’Connor et al. Simplicity: A New Language for Blockchains. 2017.
- NIST. FIPS 203, 204, 205 approved, 13 August 2024. URL: csrc.nist.gov .
- NIST NCCoE. Migration to Post-Quantum Cryptography. URL: nccoe.nist.gov .
- National Quantum Initiative. URL: quantum.gov .
- McKeeman, W. M. Differential Testing for Software. Digital Technical Journal, 1998.
- Chen et al. Automated Fuzzing with Large Language Models. arXiv:2302.08530.
- Question constructor on quantum technologies (internal methodological document, 75 questions).
Source status note: The Hornet preprint is a single-author work that was not peer-reviewed at the time of writing; individual claims about code compactness and rule coverage should be verified against the project’s code.
