Beersy
BRC-9

Simplified Payment Verification

Confirming a payment traditionally means running a full copy of the blockchain, which is far too heavy for a phone or a web page. This describes how a recipient can satisfy themselves a payment is genuine using only and a short proof.

Ty Everettchanged 1 May 20263 min read
transactionspv checklistverified payme

Summary

Why
Verifying a Bitcoin payment normally requires a full copy of the blockchain, which is too slow and heavy for quick, everyday transactions.
What
BRC-9 is a step-by-step procedure for confirming a Bitcoin transaction is valid and correctly paid using only its headers, , and script evaluation, not a full blockchain copy.
How
A recipient takes the envelope of headers and proofs attached to a transaction, checks the proofs trace back to the genesis block on the most-work chain, validates signatures and scripts, and confirms the amounts, locktime, and fee match what was invoiced.

What this lets you do

  • Verify a payment transaction without downloading the full blockchain
  • Check that merkle proofs link back to the genesis block on the strongest chain
  • Confirm inputs and outputs match what an invoice requested
  • Reject transactions with insufficient fees, bad locktimes, or invalid scripts
  • Trust or require confirmed inputs depending on how strict verification needs to be

Written by claude-sonnet-5 from the specification text. Where the two differ, the original is correct.

Reference for an AI

Everything an assistant needs to answer questions about BRC-9 accurately, including what it depends on.

The specification

Abstract

The BRC-9 specification defines a process for (SPV) that allows payment recipients to verify the validity of a transaction without downloading and verifying the entire blockchain. The process involves verifying the headers and proofs of a BRC-8 , ensuring that all SPV proofs link back to the genesis block and the chain with the most proof of-work, and confirming that the transaction is valid according to the rules of Bitcoin. This standard aims to facilitate fast, secure, and efficient payment processing for merchants and users.

Motivation

The Bitcoin blockchain is a decentralized, distributed ledger that records every transaction on the network. However, downloading and verifying the entire blockchain can be time-consuming and resource-intensive, making it impractical for users who want to make quick, simple transactions. Simplified Payment Verification (SPV) provides a way for payment recipients to verify the validity of a transaction without the need for a full blockchain download. This protocol is essential for enabling fast and efficient payment processing, especially for small, casual transactions.

Specification

Status Note

BRC-9 describes SPV validation for the older BRC-8 JSON envelope and mAPI response model. Current bsv-blockchain/ts-sdk and bsv-blockchain/wallet-toolbox wallet/payment flows generally use BRC-62 , BRC-95 , proofs, and chain trackers instead of mapiResponses.

The validation principles in this document remain useful, but implementers should treat the BRC-8 envelope and mAPI-specific checks below as historical unless they are maintaining a legacy protocol that explicitly still exchanges BRC-8 envelopes.

The steps for verifying the validity of a payment transaction using the BRC-9 SPV protocol are as follows:

  1. Ensure that the received BRC-8 Envelope is in the correct format
  2. Add any previously-unknown headers provided in the BRC-8 Envelope to the chain of headers
  3. Ensure that all SPV proofs link back to the genesis block and the chain with the most proof of-work
  4. Ensure that all signatures on provided mAPI responses are valid
  5. Ensure that all specified minerID public keys have endorsed all mAPI responses
  6. Ensure that, if only confirmed inputs were allowed, every specified input transaction is directly proven with an SPV proof rather than relying on a chain of mAPI responses
  7. Ensure that the transaction is valid according to the rules of Bitcoin (sum of input amounts is greater than or equal to the sum of output amounts)
  8. Ensure that the lock time of the transaction is as requested in the invoice
  9. Ensure that, if the lock time is in the future, all sequence numbers are UINT_MAX, unless you are working with an application that supports continuously-updating payment channel transactions and expect to get another updated transaction later
  10. Ensure that evaluating the locking scripts from the input transactions and then the provided in each input is successful, thus ensuring that all inputs were properly spent
  11. Ensure that the transaction was properly signed
  12. Ensure that the transaction contains the output scripts and amounts that were requested in the invoice
  13. Ensure that the transaction pays a sufficient fee according to the rules of the fee model you are using

The above steps ensure that the transaction is valid and secure according to the Bitcoin protocol. Merchants may take additional measures to increase security, such as subscribing to mAPI status updates and double spend notifications, verifying the identity of the sender, waiting for confirmations, or using an escrow service.

Implementation

Any wallet that has access to a source of is capable of verifying , and any computer with the resources needed to execute the Bitcoin script programs from the chain of spends is capable of verifying the chain of custody. This means that almost any modern digital computer can easily perform Simplified Payment Verification by following the steps outlined in this document.

Was this helpful?

Search Beersy

Search standards by number, title, author or topic