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 layers: Hash chains, Merkle trees, and digital signatures.

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:

  1. 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.
  2. 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:

  1. Inventory every signature and public-key exposure path, including user accounts, validators, governance, bridges, upgrade keys, and cold-storage formats.
  2. 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.
  3. 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.
  4. 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.
  5. 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:

What I need to remember

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