Cryptography / Distributed Systems
Blockchain & Distributed Ledger Cryptography
Distributed ledgers do not eliminate trust — they redistribute it, replacing a single central authority with protocol-specific consensus assumptions: honest-majority effective hashpower for Nakamoto-style proof of work, or, for Ethereum's Casper FFG, votes representing at least two-thirds of total stake to finalize a checkpoint, while safety separately assumes fewer than one-third of stake behaves Byzantine. This is a fault-tolerance boundary on how much adversarial stake finality can withstand, not the honest-participation level finality itself requires; see the Ethereum proof-of-stake documentation and its attack and defense thresholds. These systems also depend on correctly implemented client software and the security of the underlying cryptography. Blockchains coordinate hash-linked data chains, Merkle-tree transaction inclusion proofs, public-key digital signatures (secp256k1 / Ed25519), BLS signature aggregation, and Zero-Knowledge Proofs (ZK-SNARKs) into tamper-evidence and authorization primitives that support — rather than themselves enforce — the consensus protocols that let peer-to-peer nodes agree on ordering and finality without a central operator.
Cryptographic Layering in Blockchains
Distributed ledgers compose cryptographic primitives across three core layers, with more advanced zero-knowledge techniques building on top of them (covered separately in section 4 below):
Blockchain Cryptography Layering: hash chains make tampering evident; Merkle trees enable light client proofs; signatures authorize state transitions
1. Hash-Linked Chains: Tamper-Evident Ordering
Cryptography’s role here is narrower than it might appear: hashing and signatures give you tamper-evident commitments and authorization over what a node holds, but they do not by themselves decide which chain of blocks is “the” chain when nodes disagree, or when a block is final — that ordering and finality guarantee comes from the consensus protocol (Nakamoto longest/heaviest-chain PoW, Casper FFG finality, Tendermint BFT, and so on) layered on top of the cryptographic primitives, not from the hashes and signatures alone.
The block-header field layout below and the “80-byte header” figure are Bitcoin-specific — other chains define their own header layouts, and some (e.g., Ethereum post-Merge) do not have a literal proof-of-work Nonce field in the block header at all. Bitcoin blocks are linked sequentially by embedding the double-SHA-256 hash of block n-1’s header into the header of block n, as one of six fixed fields:
Headern = Version ∥ Hash(Headern-1) ∥ Merkle_Rootn ∥ Time ∥ nBits ∥ Nonce Hash(Headern) = SHA256(SHA256(Headern))
The block’s own hash — used as the “previous block hash” field in block n+1 — is computed by double-SHA-256-hashing the fully serialized 80-byte header, not embedded as a field inside itself. nBits encodes the current proof-of-work difficulty target. Altering a single transaction in block n-10 changes its Merkle root and therefore its header’s hash, invalidating the hash pointer stored in block n-9 and breaking the hash chain up to the current tip.
This makes silent tampering computationally impractical to conceal, but “immutability” here is probabilistic, not absolute — and the threshold for rewriting history is protocol-specific, not one universal number. In Nakamoto-style PoW (Bitcoin), an attacker controlling a majority of hashpower can, given enough time, outrun the honest chain and rebuild an alternative history from a past point — the classic “51% attack.” PoS protocols vary far more, and this is where the page’s later distinction between probabilistic and deterministic finality (below) actually matters here: a PoS chain using BFT-style deterministic finality (Casper FFG, Tendermint) cannot have its already-finalized blocks rewritten by an attacker who stays under the protocol’s specific safety threshold — and that threshold is a much smaller bar than “a majority.” For Ethereum’s Casper FFG, reverting an already-finalized block requires provably double-voting (and thereby destroying, via slashing) more than one-third of total staked ETH. An attacker controlling less than one-third of total stake cannot revert Ethereum finality under the stated model. Crossing the threshold triggers slashing in protocols that implement it, though the exact mechanism and threshold value are protocol-specific, not universal across all deterministic-finality designs. Weakly-subjective PoS designs, chains without deterministic finality, and the unfinalized tail of any chain remain more analogous to the PoW case. Communities have, in extreme cases, chosen to fork away from an already-published chain regardless of the underlying consensus mechanism (e.g., Ethereum’s 2016 DAO fork, a PoW-era social/hard-fork decision, not a cryptographic rewrite). Deeper confirmation depth or higher finality thresholds raise the cost of rewriting history; they don’t make rewriting mathematically impossible.
2. Merkle Trees & Light Client Proofs (SPV)
To verify that transaction Tx is included in a block containing N transactions, a client requires on the order of O(log2 N) sibling hashes (a Merkle Audit Path) — the exact count depends on the tree’s shape (e.g., how a non-power-of-two leaf count is handled) — rather than downloading the full block data:
Proof Complexity = O(log2 N) vs Full Block Download = O(N)
Bitcoin light clients (SPV nodes) download Bitcoin’s fixed 80-byte block headers and verify transaction inclusion using Merkle inclusion proofs; the header size and format are specific to Bitcoin’s block structure, not a general property of “SPV” as a technique — other chains’ light-client header formats differ.
A Merkle inclusion proof by itself only establishes that a transaction is included under the specific header the client selected — it says nothing about whether that header belongs to the canonical, highest-cumulative-work chain, or has actually achieved finality under whatever consensus rule applies. A malicious peer could hand an SPV client a self-consistent Merkle proof for a transaction included in an entirely fabricated or stale header. This is why real SPV implementations perform header-chain validation as a separate step from Merkle proof verification: checking that each header’s proof-of-work meets its claimed difficulty target, that headers link correctly back through the hash chain, and that the client is following the chain with the greatest cumulative work (or, on a deterministic-finality chain, the most recently finalized checkpoint) — none of which the Merkle proof math itself guarantees. Cryptographic inclusion and consensus validity are separate checks; an SPV client that skips the second while trusting the first is vulnerable to exactly the kind of forged-context attack the proof alone can’t rule out.
3. Transaction Authorization & Signature Schemes
| Blockchain Network | Signature Scheme | Elliptic Curve / Primitive | Primary Engineering Characteristics |
|---|---|---|---|
| Bitcoin (Legacy) | ECDSA | secp256k1 |
Requires DER encoding; strict deterministic nonce safety (RFC 6979). |
| Bitcoin (Taproot / BIP 340) | Schnorr Signatures | secp256k1 |
BIP 340 specifies single-signer Schnorr signature verification only; its linear algebra is what enables separate multi-signature aggregation protocols such as MuSig2 (BIP 327). The Taproot output structure and MAST (Merkelized Alternative Script Trees) privacy/efficiency benefits are defined separately in BIP 341 (Taproot) and BIP 342 (Tapscript) — BIP 340 supplies the signature scheme those BIPs build on, not the MAST construction itself. |
| Ethereum (Consensus Layer) | BLS Signatures | BLS12-381 |
Per-slot committee aggregators compress up to hundreds/thousands of validator attestation signatures into a single aggregate signature under Gasper (LMD-GHOST fork choice + Casper FFG finality). |
| Ethereum (EVM Execution) | ECDSA | secp256k1 |
Recovers public key from signature via recovery parameter v. Supports legacy v in {27, 28}, EIP-155 chain-id-encoded v = chainId * 2 + 35 or 36, and EIP-2718 / EIP-1559 typed transaction parity yParity in {0, 1} (EIP-155). |
| Solana | Ed25519 | edwards25519 (the twisted-Edwards form; distinct from Curve25519, the Montgomery form X25519 ECDH uses) |
High-throughput signature verification with deterministic nonces. |
| Polkadot | sr25519 (primary; Ed25519 & ECDSA also supported) | Ristretto25519 (Curve25519-based) |
Schnorr signatures over the Ristretto group (Schnorrkel); used for BABE block-production VRF + signing. GRANDPA finality voting uses a separate key type. |
4. Advanced Cryptography: Zero-Knowledge Proofs (zk-SNARKs / STARKs)
Modern L2 scaling rollups (ZK-Rollups) and privacy blockchains use Zero-Knowledge Proofs:
- zk-SNARKs (Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge): Enables a prover to demonstrate to a verifier that a computational statement is true (e.g., “I know a private key that owns this UTXO and has sufficient balance”) without revealing any private inputs.
- zk-STARKs (Zero-Knowledge Scalable Transparent Arguments of Knowledge): Zero-knowledge proofs relying on hash-based collision-resistant assumptions generally considered post-quantum candidate constructions without requiring a trusted setup ceremony.
Post-Quantum Migration Is a Consensus and Asset-Lifecycle Change
Most deployed blockchain authorization and consensus signatures — including secp256k1 ECDSA or Schnorr, Ed25519-family signatures, and BLS signatures — rely on discrete-logarithm assumptions that a sufficiently capable fault-tolerant quantum computer running Shor’s algorithm would break. Hash-based commitments and STARK-style proofs have different assumptions, but their post-quantum posture does not protect an account or validator that still authorizes actions with a vulnerable classical signature.
Replacing a chain’s signature primitive is therefore not a local library upgrade. The change can affect address derivation, transaction and block formats, signature-verification rules, hardware wallets, custody systems, validator keys, bridge contracts, and consensus compatibility. Existing assets also need an authorized migration path before classical verification is disabled; a user who has lost the old key cannot prove ownership merely because the chain added a new algorithm.
A practical migration plan should:
- Inventory every signature and public-key exposure path, including user accounts, validators, governance, bridges, upgrade keys, and cold-storage formats.
- Introduce explicitly algorithm-tagged post-quantum or hybrid credentials with chain-ID and purpose domain separation so new signatures cannot be replayed as old-format transactions or across forks.
- Define whether a transition requires both classical and post-quantum signatures, either one during a bounded migration window, or a protocol-specific threshold rule. No one transition pattern is universally safe; the downgrade and key-loss consequences differ.
- Give asset holders and validators a tested way to move to new credentials before deprecating the classical rule, including hardware-wallet, recovery, and exchange support.
- Treat activation as a consensus and governance event: incompatible verifiers can split the chain, and larger post-quantum keys and signatures can change block size, fee, bandwidth, and verification-cost limits.
NIST’s finalized FIPS 204 ML-DSA and FIPS 205 SLH-DSA provide standardized signature primitives, but neither standard defines a blockchain migration protocol. Each ledger must specify and test its own encoding, consensus, replay, custody, and activation rules.
Blockchain Security Boundaries: What Cryptography Does and Doesn’t Cover
It’s worth being explicit about where cryptographic guarantees end and other assumptions begin, since blockchain systems are frequently described in ways that blur the two:
- Consensus vs. cryptography, again: To restate the point made above with the specific failure modes it implies — a hash chain and signatures give you tamper-evidence and authorization, but which chain wins and when a block is final are consensus-protocol questions. A bug or economic failure in the consensus layer (a liveness stall, a validator cartel, a poorly incentivized fork-choice rule) is not a cryptographic break, even though it can have the same practical impact (double-spends, reorgs) as one.
- Probabilistic vs. deterministic finality: Nakamoto-style PoW chains (Bitcoin) never give absolute finality — every confirmation only reduces the probability of a later reorg, asymptotically, and a sufficiently resourced attacker can in principle still reverse many confirmations. BFT-style finality gadgets (Ethereum’s Casper FFG, Tendermint-based chains) instead provide deterministic finality: once a block is finalized under the protocol’s rules, reverting it requires validators controlling at least the protocol’s safety threshold — a fraction of total voting power, classically “fewer than 1/3 Byzantine,” under which the algorithm mathematically guarantees two conflicting blocks can’t both finalize — to violate that assumption. That safety threshold is a property of the consensus algorithm itself, distinct from slashing, which is a separate economic layer some (not all) BFT-PoS protocols add on top: an on-chain penalty (stake burned or confiscated) applied when a validator’s protocol violation can be proven after the fact, making it economically costly to attempt what the safety threshold already makes cryptographically hard. Ethereum’s Casper FFG specifically ties the two together via “accountable safety” (a safety violation is provably attributable to specific validators, who are then slashed); Bitcoin’s Nakamoto consensus has neither a deterministic safety threshold nor a slashing mechanism. Don’t conflate “the safety threshold was crossed” with “someone got slashed” — they’re related but distinct guarantees, and which ones a given chain actually provides varies by protocol.
- Chain-ID / domain separation and replay: A transaction or signature valid on one chain can be replayable on another chain sharing the same signature scheme and address format unless the protocol explicitly binds signatures to a specific chain — this is exactly why Ethereum’s EIP-155 (referenced in the table above) encodes the chain ID into the signed transaction hash: without it, a transaction signed for mainnet could be replayed verbatim on a fork or testnet sharing the same account. This is a protocol-level domain-separation problem, not something the signature algorithm itself solves.
- Bridge and oracle risks: Cross-chain bridges and price/data oracles sit outside the cryptographic guarantees of any single chain — a bridge’s security reduces to whatever mechanism it uses to attest that an event happened on the source chain (a federated multisig, a light-client proof, an optimistic fraud-proof window), and that mechanism’s trust assumptions are frequently much weaker than the underlying chains’ consensus security. The underlying reason is structural: bridges and oracles concentrate value — often holding the locked collateral backing assets circulating on multiple chains — while inheriting security from whatever mechanism attests to off-chain or cross-chain state, which is frequently a smaller, differently-trusted validator or signer set than the base-layer consensus and cryptography this page covers.
- Data availability: A validity proof (including a ZK proof) can confirm that a state transition was computed correctly without confirming that the underlying transaction data was actually published anywhere accessible. This risk is specific to designs that keep that data off-chain entirely — a validium or the off-chain-DA mode of a volition — where a malicious or failed operator withholding the data behind an otherwise-valid proof leaves users unable to reconstruct their own account state or exit the system. Conventional ZK rollups avoid that specific failure by publishing state-reconstruction data through Ethereum consensus itself, but the mechanism has shifted: historically that meant calldata (permanently retained on-chain); since EIP-4844, most rollups instead publish it as blobs, which Ethereum consensus guarantees availability for only a limited retention window (currently on the order of ~18 days) before pruning. Initial data availability during that window is consensus-backed the same way calldata’s always was; long-term archival and state reconstruction after a blob is pruned depends on a separate layer (blob archive services, rollup-run archives) rather than the base protocol — a distinction that doesn’t exist for calldata, which stays on-chain indefinitely. This is why rollup designs distinguish data availability (is the data published and retrievable right now?) from long-term retention (can it still be reconstructed later?) and from validity (was the computation correct?), with different constructions (on-chain calldata, blobs, dedicated DA layers, data availability sampling) addressing different points on that spectrum depending on which model a given rollup uses.
- Zero-knowledge proof assumptions: some widely deployed zk-SNARK systems (Groth16-style circuit-specific constructions, used by Zcash and many others; also universal-but-still-trusted setups like PLONK’s) have soundness that depends on a trusted setup ceremony (a one-time generation of public parameters that is secure only if at least one participant destroyed their secret “toxic waste” — an assumption external to the proof system’s math itself), on specific pairing-friendly curve choices, and on the correctness of the circuit compiler translating the claimed statement into the arithmetic circuit actually being proven. zk-STARKs avoid the trusted-setup assumption (relying on collision-resistant hashes instead) at the cost of larger proof sizes. In both cases, “the proof verified” is a statement about the circuit that was proven, not an independent guarantee that the circuit itself correctly encodes the intended real-world statement — a bug in circuit design is a bug a valid proof will not catch.
- Key custody is a critical end-to-end failure mode in practice: alongside the consensus, bridge, oracle, and proof-circuit risks discussed above, none of the cryptography on this page protects funds if the private key controlling them is lost or stolen. A base-layer transaction signed by a stolen key has no built-in password reset or customer-support override — reversing it purely at the protocol level would require the same kind of majority/finality-threshold rewrite discussed above, which legitimate custody failures don’t trigger. Some systems do add recourse on top of that base layer — smart-contract wallets with social recovery, DAO or governance-level intervention (Ethereum’s 2016 DAO fork being the canonical precedent), or a custodian’s own internal reversal — but those are opt-in application- or community-layer mechanisms, not something the base protocol provides for an arbitrary signed transaction. This is why serious custody design doesn’t rest on a single private key: multisignature (at least M of N independent authorized keys must sign; all N are required only in the special case where M equals N) and threshold signature schemes (a single signature is produced collaboratively from N key shares, with no single share ever reconstructing the full key) both remove any one compromised key or device as a single point of failure. Beyond the signing scheme itself, production custody needs a key rotation plan (moving funds to a new key set on a schedule or after a suspected exposure), a recovery plan for lost key shares that doesn’t itself become a backdoor, and emergency controls (a pre-authorized path to freeze or migrate funds quickly if a compromise is detected) — all of which are operational/systems design, not something the underlying signature scheme provides automatically just by existing.
Hash-linked blocks make modification evident; the consensus protocol and its honest-participation or safety assumptions make an alternative history costly or unable to finalize. Rewriting thresholds are protocol-specific, and bridges, oracles, key custody, and post-quantum signature migration remain system and governance concerns outside a hash chain's guarantees.
Primary references
- Bitcoin white paper: Bitcoin: A Peer-to-Peer Electronic Cash System — bitcoin.org — verified that rewriting accepted history depends on redoing proof of work and overtaking the honest chain, not hash linking alone.
- Bitcoin BIP 340: Schnorr Signatures for secp256k1 — Bitcoin BIP 340 Specification
- Bitcoin BIP 327: MuSig2 for BIP340-compatible Multi-Signatures — Bitcoin BIP 327 Specification
- Bitcoin BIP 341 / BIP 342: Taproot: SegWit version 1 spending rules / Validation of Taproot Scripts (Tapscript) — BIP 341, BIP 342
- Ethereum EIP-155: Simple Replay Attack Protection — EIP-155 Specification
- Polkadot Cryptography: Schnorrkel sr25519 Signatures over Ristretto25519 — Polkadot Host Specification
- STARKs Specification: Scalable, Transparent, and Post-Quantum Secure Computational Integrity — IACR Cryptology ePrint 2018/046
- NIST FIPS 204: Module-Lattice-Based Digital Signature Standard (ML-DSA) — NIST FIPS 204
- NIST FIPS 205: Stateless Hash-Based Digital Signature Standard (SLH-DSA) — NIST FIPS 205
- BLS Signatures Draft: BLS Signatures IRTF/CFRG Internet-Draft (Work in Progress — Not an IETF Standard) — draft-irtf-cfrg-bls-signature-07
- Ethereum Consensus Specs: Casper FFG / Gasper Finality Gadget Specification — ethereum/consensus-specs
- Tendermint BFT: The latest gossip on BFT consensus (Buchman, Kwon, Milosevic) — arXiv:1807.04938
- Data Availability Proofs: Fraud and Data Availability Proofs: Maximising Light Client Security (Al-Bassam, Sonnino, Buterin) — arXiv:1809.09044
- Ethereum PoS Attack & Defense: Stake thresholds for delaying vs. reverting finality under Casper FFG — ethereum.org: Attack and defense