Repository navigation
policy: make unstructured Taproot annexes standard - #36466
RobinLinus wants to merge 4 commits into
Conversation
Permit marker-only annexes and annexes whose first byte after the 0x50 marker is 0x00, reserving other prefixes for future semantics. Annex weight remains subject to MAX_STANDARD_TX_WEIGHT without an additional per-input limit. Require all transaction inputs to carry an annex if any does. This prevents unilateral introduction of an annex into transactions with participants who did not opt in; it does not prevent witness inflation among participants who opted in. Cover key and script paths, mixed input types, reserved prefixes, script stack limits, and the transaction weight boundary. Update the Taproot functional tests to exercise standard unstructured annexes. Builds on the all-input opt-in approach in bitcoin#27926 and the Libre Relay implementation.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
We should exclude spends of P2A outputs here, as they can't contain an annex. |
Exclude native P2A inputs from the all-input annex requirement while retaining their empty-witness policy. Other inputs must still opt in together. Cover mixed spends, input ordering, multiple anchors, wrapped and unknown witness programs, and witness stuffing in unit and functional tests.
|
@petertodd Thanks, fixed in bb6ccd0. Native P2A inputs are exempt; their witnesses must remain empty. |
|
@petertodd Thanks, addressed in b4179ad. The empty-witness check moved below P2A handling so anchors are counted before the early |
|
utACK b4179ad |
|
What is the purpose of this? I was imagining that annex standardness would be added at the same time consensus-relevant meaning would be given to annexes. Of course, if there were active use of annexes on the network it would be useful to accommodate relay, but as of now I don't see the point. |
|
@sipa The motivation is data availability for metaprotocols, including a range of shielded protocols such as Shielded CSV. Annexes would let these protocols publish data directly in a Taproot key-path spend, avoiding the script-path commitment and reveal required by inscription-style encoding. The motivation for enabling relay now is to support these applications. They need data availability independently of future consensus semantics for the annex; the proposed Standard relay would also let these applications reach miners through the public P2P network, reducing the incentive to build private mempools or depend on arrangements with individual mining pools. |
|
ACK |
AndreaDiazCorreia
left a comment
There was a problem hiding this comment.
I tested this on b4179ad, the unit and functional tests pass, and they fail with master's policy.cpp. I also changed the policy code in 7 ways (no P2A exemption, no opt-in rule, no prefix check, empty-witness skip before the P2A check, etc.) and annex_standardness catches all of them.
A tx with one 399,580-byte annex (exactly 400,000 WU) is accepted, also by a node with -datacarrier=0. #27926 had a 256-byte limit. Why remove it? Should node operators have an option to turn off annex relay?
|
🐙 This pull request conflicts with the target branch and needs rebase. |

Make Taproot annexes standard for key and script paths:
0x50: marker-only opt-in.0x50 0x00 <data>: arbitrary data; other prefixes remain nonstandard.No annex-specific size limit; the existing 400,000 WU standard transaction limit applies.
This opt-in rule protects transactions that do not opt in. It does not prevent annex inflation by opted-in participants. Consensus and witness replacement are unchanged.
Builds on #27926 and Libre Relay.
Validation: full build, 17 transaction unit tests, full
feature_taproot.py, andgit diff --checkpassed.AI-assisted implementation and tests.