Transaction Taxonomy
Classification of Bitcoin SV transactions by script pattern. Each output is typed independently — a single transaction may contain both payment and data outputs.
Standard script types
| Type | Script pattern | Description |
|---|---|---|
| P2PKH | OP_DUP OP_HASH160 <20> OP_EQUALVERIFY OP_CHECKSIG | Pay to public key hash. ~95% of transactions. |
| P2PK | <pubkey> OP_CHECKSIG | Pay to public key. Early blocks. |
| P2MS | OP_m <pubkeys> OP_n OP_CHECKMULTISIG | Multisig. m-of-n signatures required. |
| P2SH | OP_HASH160 <20> OP_EQUAL | Pay to script hash. Script revealed at spend. |
| OP_RETURN | OP_FALSE OP_RETURN <data> | Data carrier. Unspendable. Protocols embed data here. |
| Coinbase | vin[0].coinbase (no txid) | Block reward. First transaction in every block. |
OP_RETURN sub-protocols
OP_RETURN transactions are further classified by their protocol prefix — the first push data element after OP_RETURN. The prefix is the file extension.
| Protocol | Prefix | Purpose |
|---|---|---|
| B:// | 19HxigV4Q... | File storage (content, media type, encoding) |
| MAP | 1PuQa7K62... | Key-value metadata |
| AIP | 15PciHG22... | Author identity proof |
| Run | 72756e (hex) | Token protocol (deploy, call, mint) |
| 1Sat Ordinals | ord | Inscriptions / NFTs |
| D:// | 19iG3WTYSs... | Dynamic file references |
Classification algorithm
For each transaction output, check in order:
- OP_RETURN? → parse first push data for protocol prefix
- Matches P2PKH template? → 76 a9 14 <20> 88 ac
- Matches P2PK template? → <33|65> ac
- Matches P2SH template? → a9 14 <20> 87
- Starts OP_1..OP_16, ends OP_CHECKMULTISIG? → bare multisig
- vin[0] has coinbase field? → coinbase
- Otherwise → non-standard / custom contract
Smart contract patterns
| Pattern | Indicator | Description |
|---|---|---|
| Hashlock | OP_HASH160 <hash> OP_EQUAL | Reveal preimage to spend |
| Timelock | OP_CHECKLOCKTIMEVERIFY | Spend locked until time/height |
| HTLC | Hashlock + timelock | Atomic swaps, payment channels |
| Covenant | OP_PUSH_TX patterns | Restricts where/how funds can move |
| Oracle | Rabin signature verification | External data fed into contracts |