Bitcoin Core policy limits (src/policy/policy.h):
From TeachMeBitcoin, the free encyclopedia
Reading time: 3 min
12. Non-Standard Scripts — What Happens to Them
Overview
Bitcoin's consensus rules define which scripts are valid (will be accepted into the blockchain). However, Bitcoin Core also maintains a separate concept of standardness — a policy layer that restricts which transactions nodes will relay and include in mined blocks under default settings. Non-standard scripts are consensus-valid but policy-rejected by most nodes.
Standard vs. Non-Standard
Standard script types (Bitcoin Core default policy):
- P2PK
- P2PKH
- P2SH
- P2MS (bare multisig, up to 3 keys)
- P2WPKH
- P2WSH
- P2TR
- OP_RETURN (with data ≤ 83 bytes)
Non-standard (will not relay by default):
- Any script not matching above patterns
- Bare multisig > 1-of-3
- Scripts with non-push opcodes in scriptSig
- Scripts exceeding size limits
- Scripts with OP_RETURN and > 83 bytes of data
What Happens to Non-Standard Transactions
1. Transaction is broadcast to the network
2. Most nodes (running default policy) reject it at the mempool level
3. The transaction is NOT relayed to other peers
4. The transaction does NOT appear in most mempools
BUT:
5. A miner can still include the transaction directly in a block
6. Once included in a valid block, all nodes ACCEPT it (consensus valid)
7. The UTXO is created and is spendable in future transactions
This is the crucial distinction:
- Policy: enforced by relay nodes → affects mempool propagation
- Consensus: enforced by all nodes → affects block validity
Methods to Broadcast Non-Standard Transactions
Option 1: Direct miner submission
- Contact mining pool operator directly
- ViaBTC, Luxor, and others accept direct submissions
- F2Pool "transaction accelerator" for stuck transactions
Option 2: Mining your own block
- Requires hashrate, practical only for large operations
Option 3: Custom relay paths
- Some services maintain non-standard relay networks
- Bisq's trade protocol uses timelock scripts that were historically non-standard
Option 4: Bitcoin Core with -acceptnonstdtxn flag
- Start node with: bitcoind -acceptnonstdtxn=1
- The node will relay and mine non-standard transactions
- Useful for testing on regtest/testnet
Size and Resource Limits
# Bitcoin Core policy limits (src/policy/policy.h):
MAX_STANDARD_TX_WEIGHT = 400000 # 400,000 WU
MAX_P2SH_SIGOPS = 15 # Max sigops in P2SH redeemScript
MAX_STANDARD_P2WSH_SCRIPT_SIZE = 3600 # witnessScript max 3600 bytes
MAX_STANDARD_P2WSH_STACK_ITEM_SIZE = 80 # Each witness item ≤ 80 bytes
MAX_STANDARD_P2WSH_STACK_ITEMS = 100 # Max 100 witness items
MAX_OP_RETURN_RELAY = 83 # OP_RETURN data bytes
☕ Help support TeachMeBitcoin
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:
Ethereum:
0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin:
bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana:
4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J