This PR adds a user configurable, zero by default parameter — maxburnamount — to sendrawtransaction. This PR makes bitcoin core reject transactions that contain unspendable outputs which exceed maxburnamount. closes #25899.
As a result of this PR, sendrawtransaction will by default block 3 kinds of transactions:
- Those that begin with
OP_RETURN- (datacarriers) - Those whose lengths exceed the script limit.
- Those that contain invalid opcodes.
The user is able to configure a maxburnamount that will override this check and allow a user to send a potentially unspendable output into the mempool.
I see two legitimate use cases for this override:
- Users that deliberately use
OP_RETURNfor datacarrier transactions that embed data into the blockchain. - Users that refuse to update, or are unable to update their bitcoin core client would be able to make use of new opcodes that their client doesn't know about.