Skip to content

Chainscore/bitcoin-spec

Repository files navigation

Bitcoin Protocol Specification

Bitcoin Protocol Specification cover

In this specification for the Bitcoin protocol, we have covered most of the concepts & rulesets to develop on Bitcoin: consensus rules, transaction and block formats, canonical serialization, Bitcoin Script opcode behavior, UTXO state transitions, proof-of-work chain selection, mempool relay boundaries, and peer-to-peer network messages.

The specification is maintained as a buildable PDF and LaTeX source. It cites BIPs, Bitcoin Core source evidence, and deployed full-node behavior.

The document does not change Bitcoin consensus rules. It is a maintained technical reference that distinguishes consensus rules, peer-service behavior, mempool behavior, and implementation evidence.

The current draft baseline is Bitcoin Core 31.0. BIPs are incorporated only when they are live in that full-node baseline.

Bitcoin protocol specification, Bitcoin consensus rules, Bitcoin Core consensus, Bitcoin transaction format, Bitcoin block format, block validation, UTXO set, Bitcoin Script opcodes, Taproot, Tapscript, SegWit, proof of work, mempool policy, Bitcoin P2P network protocol, BIP reference.

Read the specification

https://chainscore.github.io/bitcoin-spec/

The generated PDFs are:

Scope

This repository is intended for developers, protocol engineers, researchers, client implementers, infrastructure teams, and reviewers to have a source of truth for Bitcoin protocol.

Covered areas include:

  • notation, hashes, identifiers, and canonical encodings;
  • transaction records, transaction identifiers, locktime, and sequence locks;
  • Script execution, signature messages, and opcode classes;
  • block records, Merkle roots, witness commitments, and contextual block checks;
  • compact target encoding, difficulty adjustment, proof of work, and chainwork;
  • active-chain validation, UTXO transitions, reorganization correctness, and consensus rule context;
  • mempool admission as local relay state; and
  • interoperable P2P message behavior.

Out of scope: wallet UX, address-book behavior, mining interfaces, exchange policy, historical proposal tracking, and Bitcoin Core RPC manuals.

Build dependencies

On Debian-based systems, install at least:

apt install make git latexmk texlive texlive-latex-extra texlive-fonts-recommended
cargo install mdbook --version 0.5.2 --locked

Building

make protocol
make protocol-dark
make all
make book

The outputs are written to:

out/protocol.pdf
out/protocol-dark.pdf

About

Bitcoin protocol specification covering consensus rules, transaction and block formats, Script opcodes, UTXO state transitions, proof of work, mempool, and P2P networking.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors