DRAFT: PR #X Decouple Datacarrier Size and Output Count Limits for Adaptable OP_RETURN Policy
Status: Draft | Target: Bitcoin Core v30.1 (Q4 2025 - Q1 2026) | Author: @jotapea
Motivation
In Bitcoin Core v30.0, transactions with multiple OP_RETURN/nulldata outputs are relayed by default, allowing up to 100,000 bytes. Effectively, this uncaps the total nulldata size per transaction, as the transaction size limit is hit first.
The scope of this PR is addressing the outcome of these changes, not the reasons for them. And this should be undeniable: all Bitcoin software should incentivize nulldata over unspendable burn outputs for data.
However, the approach taken by v30.0's aggregated datacarriersize cap conflates per-output size with output count. It makes no distinction between a single contiguous data output, or this data being split between multiple outputs. While openly (defaulting to) relaying these data blobs, jumping from 83 bytes, to (<) 100,000 bytes (over 1000x increase).
This PR decouples the number of OP_RETURN outputs from the size of the outputs, to offer more granular limits control, while still supporting all features desired by Bitcoin node participants.
With just one additional configuration for nulldata relaying, Bitcoin Core can adapt to client configurations, and continue as the foundational Bitcoin node software of choice.
Proposed Changes
-datacarrier (bool, default: 1): A flag to toggle OP_RETURN relay. When set to 0, this disables OP_RETURN transactions entirely. No changes here.
-datacarriersize (int, default: 83): The maximum allowed byte size for any individual OP_RETURN output. The default is the historical cap of 83 bytes, but it can be any value. A value of 0 means no size limit. (Changed from v30.0, which redefined it as the aggregate of all nulldata outputs, while also making unlimited the default.)
-datacarriercount (int, default: 1): The maximum number of OP_RETURN outputs allowed per transaction. Setting this to 0 would allow an unlimited number of OP_RETURN outputs. This is the only new configuration. (Prior to v30.0, this was hardcoded to 1.)
The aggregate nulldata size limit becomes datacarriersize * datacarriercount.
Implementation
TBD.
Configurations
For same policy as v30.0 / Libre Relay
datacarrier=1
datacarriersize=0
datacarriercount=0
# unlimited unsplit and split nulldata
Defaults proposed for v30.1 (historical default)
datacarrier=1
datacarriersize=83
datacarriercount=1
# single nulldata output with 83 bytes limit
Compromise: enough incentive over unspendable outputs (a new default possibility, but out of scope for this PR)
datacarrier=1
datacarriersize=83
datacarriercount=0
# unlimited split nulldata
Knots default
datacarrier=1
datacarriersize=42
datacarriercount=1
# single nulldata output with 42 bytes limit
"Knots extreme"
datacarrier=0
# no nulldata transactions relay
<Customizable>
datacarrier=1
datacarriersize=100
datacarriercount=50
# total size limit: 100*50 = 5000 bytes
Benefits & Trade-offs
Pros:
Extends customization of OP_RETURN relay policy, with separate size and count limits, which cover the spectrum of nulldata carrying configurations used by Bitcoin node software.
Retains money-first defaults for
datacarriersizeanddatacarriercountthat mimic historic consensus.The capacity to openly relay nulldata outputs is kept (no feature is lost from v30.0, is just reverting the defaults).
Cons:
Minor increase in configuration complexity due to the introduction of one more parameter, though this is mitigated by better configurability.
Reverts the datacarrier defaults from v30.0, making any reason for that change a possible argument against this PR. But that should be a separate issue pertaining the New Datacarrier Defaults.
Thank you for reading.
This can be a bit unusual, as there is no code yet for this. But that is the least of my worries.
I just wanted to do something before this highly controversial release.
All feedback is welcomed.