Fundamental Concepts

BRC-20 Transaction Structure

A BRC-20 operation using this OP_RETURN extension is encoded within a standard Bitcoin transaction.

  1. Inputs (UTXOs): Standard Bitcoin Unspent Transaction Outputs. These inputs provide the BTC required for transaction fees and output values. Critically, according to the indexer's state, certain input UTXOs may also represent ownership of BRC-20 token balances, conferring the "right" to transfer those tokens.
  2. OP_RETURN Output: This is the core of the BRC-20 extension. It is a non-spendable output containing a script starting with OP_RETURN (0x6a), followed by a data push opcode and the compact JSON payload (currently limited to ≤ 80 bytes). This payload contains the BRC-20 operation details (protocol, operation type, ticker, amount, etc.).
  3. Standard Recipient Outputs: One or more standard P2PKH, P2SH, or Taproot outputs directing BTC to recipient addresses. These outputs MUST meet the Bitcoin network's dust limit (currently 546 sat for P2PKH). In Mint and multi-recipient Transfer operations, the satoshi amount directed to these outputs is used by indexers to determine the proportional distribution of tokens.
  4. Change Output: A standard output returning any excess BTC from the inputs back to the sender's address. Indexer policy typically dictates whether this output is also eligible for proportional token distribution or if tokens are only distributed among designated recipient outputs.

Important Rules (Protocol-Level)

These are high-level rules enforced by the Bitcoin network itself, which impact the design and validation of BRC-20 transactions.

  • Dust limit: Standard outputs below the network's dust limit (e.g., 546 sat for P2PKH) may not be relayed or included in blocks by miners. This is why recipient outputs MUST be at least the dust limit.
  • OP_RETURN Constraints: The OP_RETURN opcode allows for including data in a transaction. Currently, the standard policy limit for this data is 80 bytes. This limit is expected to be removed in Bitcoin Core v30, potentially allowing for larger BRC-20 payloads in the future. OP_RETURN outputs have a value of 0 BTC and are provably unspendable.
  • Transaction Validity: Bitcoin network consensus rules ensure that transactions are correctly formatted, signed, and that inputs are valid and unspent. Miners do not validate the content of the OP_RETURN data itself against BRC-20 rules.

Proportional Distribution

In Mint operations and multi-recipient Transfer operations, tokens are distributed among the eligible standard outputs based on the proportion of satoshis each output receives relative to the total satoshis in all eligible outputs.

For N eligible standard outputs in a transaction, if the total token amount to be distributed is total_token_amt, and output i receives s_i satoshis, its allocated token amount tok_i is calculated as:

tok_i = ⌊(total_token_amt × s_i) / (∑ s_j)⌋

where ∑ s_j is the sum of satoshis in all N eligible standard outputs. Indexer policy defines which outputs are eligible (typically all non-OP_RETURN, non-change outputs, though this can be refined). Atomic remainders from the floor division must be handled consistently by indexers (e.g., attributed to the sender, burned).