B Index of Consensus Rules¶
Every numbered rule box in this document is listed below in order of appearance. Together they are the complete set of requirements a block must meet to be accepted by the reference implementation. A block is valid if and only if no rule rejects it. Where a rule matters in two contexts, for example a requirement on a stake transaction that is checked while validating a block, it is stated in both chapters and appears twice here; the two statements are equivalent.
3 Cryptographic Primitives¶
- 3.1 BLAKE-256
- 3.2 Derived hash functions
- 3.3 BLAKE3 proof-of-work hash function
- 3.4 Parsing a secp256k1 public key
- 3.5 Strict public key encoding
- 3.6 ECDSA verification
- 3.7 Parsing a DER signature
- 3.8 Strict ECDSA signature encoding
- 3.9 Parsing an EC-Schnorr-DCRv0 signature
- 3.10 Parsing an EC-Schnorr-DCRv0 public key
- 3.11 EC-Schnorr-DCRv0 verification
- 3.12 Parsing an Ed25519 public key
- 3.13 Parsing an Ed25519 signature
- 3.14 Ed25519 verification
- 3.15 Merkle root
4 Data Encoding and Structures¶
- 4.1 Decodability
- 4.2 Canonical variable-length integers
- 4.3 Serialization type
- 4.4 Outpoint tree byte
- 4.5 Transaction element counts
- 4.6 Witness count of a full serialization
- 4.7 Script lengths
- 4.8 Merkle roots before header commitments
- 4.9 Merkle roots after header commitments
- 4.10 Block transaction counts
- 4.11 Header size field
6 The Script System¶
- 6.1 Non-zero script versions
- 6.2 Script parsing
- 6.3 Engine construction checks
- 6.4 Per-script end conditions
- 6.5 Combined stack size
- 6.6 Opcode processing
- 6.7 Minimal data pushes
- 6.8 Conditional opcodes
- 6.9 Final result
- 6.10 Boolean interpretation
- 6.11 Numeric operands
- 6.12 OP_PICK and OP_ROLL
- 6.13 OP_CAT
- 6.14 OP_SUBSTR
- 6.15 OP_LEFT and OP_RIGHT
- 6.16 OP_ROTR and OP_ROTL
- 6.17 OP_LSHIFT and OP_RSHIFT
- 6.18 OP_SHA256
- 6.19 OP_CHECKLOCKTIMEVERIFY
- 6.20 OP_CHECKSEQUENCEVERIFY
- 6.21 No-operation opcodes
- 6.22 Reserved and invalid opcodes
- 6.23 Hash type encoding
- 6.24 Strict DER signature encoding
- 6.25 Public key encoding
- 6.26 Subscript construction
- 6.27 OP_CHECKSIG
- 6.28 OP_CHECKMULTISIG
- 6.29 OP_CHECKSIGALT
- 6.30 SIGHASH_SINGLE with no matching output
- 6.31 Pay-to-script-hash evaluation
- 6.32 No stake opcodes in redeem scripts
- 6.33 Detecting tag opcodes in a script
- 6.34 Transaction signature operation count
- 6.35 Provably unspendable outputs
- 6.36 Strict null-data scripts
7 Transactions¶
- 7.1 Outpoint tree must match the creating transaction
- 7.2 Outputs that never enter the UTXO set
- 7.3 Witness fields of spending inputs
- 7.4 Tree placement of transaction types
- 7.5 Inputs and outputs present
- 7.6 Maximum serialized size
- 7.7 Output amounts
- 7.8 Input witness amounts
- 7.9 No duplicate inputs
- 7.10 Maximum transaction version
- 7.11 Maximum output script version of regular transactions
- 7.12 No stake opcodes in regular outputs
- 7.13 Coinbase input
- 7.14 Vote stakebase and ticket input
- 7.15 Revocation version and input
- 7.16 Treasurybase input
- 7.17 Treasury spend input
- 7.18 Treasury add change
- 7.19 Non-null inputs
- 7.20 Expired transactions
- 7.21 Lock time finality
- 7.22 Transactions subject to sequence locks
- 7.23 Treasury spend sequence number
- 7.24 Sequence lock enforcement
- 7.25 Inputs exempt from UTXO lookup
- 7.26 Referenced output exists and is unspent
- 7.27 Stake transactions do not spend same-block outputs
- 7.28 Zero-value outputs are not spendable
- 7.29 Coinbase maturity
- 7.30 Maturity of outputs of expiring transactions
- 7.31 Treasury generation output maturity
- 7.32 Ticket outputs are spent only by votes and revocations
- 7.33 Treasury add outputs are unspendable
- 7.34 Vote and revocation output maturity
- 7.35 Stake change maturity
- 7.36 Referenced amount range
- 7.37 Input total
- 7.38 Outputs do not exceed inputs; fee
- 7.39 Connection order and output availability
- 7.40 Historical same-block stake spend exceptions
- 7.41 Inputs whose scripts are executed
- 7.42 Script execution parameters
- 7.43 Script failure invalidates the block
8 The Stake System¶
- 8.1 Stake transaction type
- 8.2 Tagged script
- 8.3 Null data script
- 8.4 Ticket input script forms
- 8.5 Ticket commitment amounts
- 8.6 Ticket price
- 8.7 Treasury votes require the treasury agenda
- 8.8 Stakebase signature script
- 8.9 Ticket input not null
- 8.10 Revocation version
- 8.11 Revocation script validation
- 8.12 Ticket outpoint index
- 8.13 Ticket output available
- 8.14 Ticket submission output
- 8.15 Ticket spend maturity
- 8.16 Number of payments
- 8.17 Payment script
- 8.18 Payment value and fee limits
- 8.19 Stakebase amount
- 8.20 Stakebase totals
- 8.21 Ticket outputs are spent only by votes and revocations
- 8.22 Maturity of stake outputs
- 8.23 Stake transactions do not spend same-block outputs
- 8.24 Live pool order
- 8.25 Stake state transition
- 8.26 Tickets expiring in block h
- 8.27 Stake header fields below stake validation height
- 8.28 Minimum number of votes
- 8.29 Maximum number of votes
- 8.30 Maximum number of ticket purchases
- 8.31 Ticket purchase count
- 8.32 Pool size commitment
- 8.33 Final state commitment
- 8.34 Tree membership
- 8.35 Allowed stake transaction types
- 8.36 No votes or revocations below stake validation height
- 8.37 Non-empty stake tree
- 8.38 Vote count
- 8.39 Revocation count and limit
- 8.40 Votes vote on the parent
- 8.41 Parent approval
- 8.42 Votes and revocations spend eligible tickets
9 Proof of Work and Difficulty¶
10 Blocks and Chain Selection¶
- 10.1 Validity is inherited
- 10.2 Proof of work, context-free form
- 10.3 Timestamp precision
- 10.4 Timestamp not too far in the future
- 10.5 Stake header fields in the sanity stage
- 10.6 Parent known and not known invalid
- 10.7 Height
- 10.8 Timestamp after the median time past
- 10.9 Minimum block spacing at maximum difficulty (testnet3 only)
- 10.10 Difficulty, positional form
- 10.11 Block version
- 10.12 Fork rejection checkpoint
- 10.13 Maximum-difficulty checkpoint (testnet3 only)
- 10.14 Proof of work, contextual form
- 10.15 Difficulty and ticket price, exact
- 10.16 Stake version
- 10.17 Ticket pool commitments
- 10.18 Wire size limit
- 10.19 Merkle roots
- 10.20 At least one regular transaction
- 10.21 Header size field
- 10.22 Transaction sanity
- 10.23 Ticket purchases
- 10.24 No duplicate transactions
- 10.25 No expired transactions
- 10.26 Coinbase is the first regular transaction
- 10.27 Coinbase height commitment
- 10.28 Treasurybase placement
- 10.29 Transaction context checks
- 10.30 Tree composition
- 10.31 Votes and revocations in the block
- 10.32 Treasury transaction limits
- 10.33 Approval of the parent
- 10.34 Signature operations, fast count
- 10.35 Consensus block size
- 10.36 All transactions final
- 10.37 Vote and revocation eligibility
- 10.38 Header commitment root
- 10.39 Effect of disapproval
- 10.40 Signature operations, per tree
- 10.41 Transaction inputs
- 10.42 Stake transactions do not spend outputs of their own block
- 10.43 Regular transactions spend only earlier outputs of their own block
- 10.44 Each output is spent at most once per block
- 10.45 Historical same-block stake spends
- 10.46 Coinbase amount
- 10.47 Vote subsidies and treasurybase amount
- 10.48 Script validation
- 10.49 Relative lock times
- 10.50 Best chain
- 10.51 Recording invalidity
- 10.52 Assume-valid ancestors
11 Issuance and Block Subsidy¶
- 11.1 Full block subsidy
- 11.2 Selection of the split variant
- 11.3 The vote subsidy is based on the height voted on
- 11.4 The first regular transaction is the only coinbase
- 11.5 Coinbase input
- 11.6 Treasury output before the treasury agenda
- 11.7 Coinbase height commitment
- 11.8 Coinbase input value
- 11.9 Coinbase output total
- 11.10 Vote stakebase value
- 11.11 Vote output limits
- 11.12 Treasurybase amount
- 11.13 Block-one coinbase
- 11.14 Block-one outputs
12 The Decentralized Treasury¶
- 12.1 Treasury transactions only in the stake tree
- 12.2 No treasury transactions before activation
- 12.3 Permitted stake transactions before stake validation height
- 12.4 Coinbase detection with the treasury active
- 12.5 Treasury balance
- 12.6 Treasurybase required and unique
- 12.7 Treasurybase form
- 12.8 Treasurybase height commitment
- 12.9 Treasurybase amount
- 12.10 Treasurybase creates no outputs
- 12.11 Treasury add change
- 12.12 Treasury add inputs
- 12.13 Treasury add limit
- 12.14 Treasury add outputs are unspendable
- 12.15 Treasury spend input
- 12.16 Treasury spend key
- 12.17 Treasury spend signature
- 12.18 Treasury spend amounts
- 12.19 Treasury spend sequence number
- 12.20 Treasury spends only on a TVI
- 12.21 Full voting window after stake validation height
- 12.22 Treasury spend inside its window
- 12.23 Treasury spend not previously mined
- 12.24 Treasury spend approved
- 12.25 Treasury expenditure
- 12.26 Maturity of treasury payouts
- 12.27 Treasury spend expiry and window
- 12.28 Treasury vote output
- 12.29 Signature operations of treasury transactions
- 12.30 No treasury opcodes in regular outputs