BIP 433: Add P2A BIP #1982

pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:2025-09-p2a changing 2 files +83 −0
  1. instagibbs commented at 3:40 pm on September 24, 2025: member

    For interoperability with other schemes, it behooves me to write a BIP for this output type. It’s already standard to spend in well over half the network.

    h/t roasbeef for bothering me about this repeatedly

  2. jonatack added the label New BIP on Sep 24, 2025
  3. in bip-paytoanchor.mediawiki:28 in 490aa62c71
    23+The "anchor" output type is a commonly used pattern in Bitcoin layer 2 systems such as Lightning Network and beyond. This pattern allows transactions which are presigned far in advance to leave a "hook" for CPFP fee bumping later, when prevailing feerates for block inclusion are better known.
    24+
    25+When the wallet user is unconcerned by *who* is able to bump the transaction fees as long as someone does, this output type may confer a couple of advantages:
    26+
    27+1. Using an output type with minimal output and spending input footprint saves fees on average
    28+2. Keyless operation aids in interoperability of services like watchtowers as there is no privelaged key material for bumping
    


    jonatack commented at 9:13 pm on September 25, 2025:
    02. Keyless operation aids in interoperability of services like watchtowers, as there is no privileged key material for bumping,
    

    instagibbs commented at 2:48 pm on October 7, 2025:
    done
  4. in bip-paytoanchor.mediawiki:50 in 490aa62c71
    45+
    46+====Related Work====
    47+
    48+There are a number of related but separate historical concepts:
    49+
    50+[https://github.com/bitcoin/bitcoin/pull/30239 Ephemeral Dust]: Relay policies allowing a single dust output as long as it is spent in a transaction package. As an implementation detail, dust for P2A is set at 240 satoshis by default, others dust levels remain unchanged, and the dust-having transaction must be zero fee.
    


    jonatack commented at 9:21 pm on September 25, 2025:
    0[https://github.com/bitcoin/bitcoin/pull/30239 Ephemeral Dust]: Relay policies allowing a single dust output as long as it is spent in a transaction package. As an implementation detail, dust for P2A is set at 240 satoshis by default, other dust levels remain unchanged, and the dust-having transaction must be zero fee.
    

    Roasbeef commented at 11:30 pm on September 25, 2025:
    I think it’s also worth specifying above that P2A outputs can be zero value as well.

    Roasbeef commented at 11:31 pm on September 25, 2025:

    Have you considered making this BIP slightly more generalized, and also preicelyf defining the acceptance rules for ephemerl dust?

    Eg: one question that’s popped into my mind several times is: can ephemeral dust only be used with v3 transactions?


    Roasbeef commented at 11:36 pm on September 25, 2025:

    Dust threshold instead of just dust?

    As in, values before 240 for P2A are considered dust.


    instagibbs commented at 2:48 pm on October 7, 2025:
    done

    instagibbs commented at 2:49 pm on October 7, 2025:
    done

    instagibbs commented at 2:50 pm on October 7, 2025:

    Ephemeral dust ended up being very implementation-specific, and likely to change in some future.

    Wondering if there is a more BOLT-like living document suitable for that.


    instagibbs commented at 2:50 pm on October 7, 2025:
    fixed
  5. in bip-paytoanchor.mediawiki:36 in 490aa62c71
    31+
    32+===Specification===
    33+
    34+A P2A output is defined as one with the exact witness output script
    35+
    36+<code>OP_1 <0x4e73></code>
    


    jonatack commented at 9:24 pm on September 25, 2025:
    Perhaps add a footnote describing “what is the 0x4e73 for?” per your answer in https://github.com/bitcoin/bitcoin/pull/30352#issuecomment-2215089061

    instagibbs commented at 2:48 pm on October 7, 2025:
    done
  6. in bip-0433.mediawiki:73 in 490aa62c71 outdated
    68+Gloria Zhao,
    69+Pieter Wuille,
    70+Jeremy Rubin,
    71+and Bastien Teinturier.
    72+
    73+==References and Rationale==
    


    jonatack commented at 9:30 pm on September 25, 2025:
    TBD, or remove this header?

    Roasbeef commented at 11:40 pm on September 25, 2025:
    Should link to the bitcoind PR that implemented this.

    Roasbeef commented at 11:43 pm on September 25, 2025:

    instagibbs commented at 2:48 pm on October 7, 2025:
    one is added, leaving

    instagibbs commented at 2:50 pm on October 7, 2025:
    Was in “Implementation” section
  7. in bip-0433.mediawiki:58 in 490aa62c71 outdated
    53+
    54+[bip-0431.mediawiki TRUC transactions]: TRUC transactions bound the topology including child transaction size, which aids in anti-pinning for the P2A output, as anyone can attach a child transaction including an oversized, low feerate one. There is no ineherent dependency on this concept and P2A.
    55+
    56+====Backward Compatibility====
    57+
    58+Creation of P2A outputs has been considered standard since the deployment of Segwit softfork on the network.
    


    jonatack commented at 9:33 pm on September 25, 2025:
    Maybe link here to the SegWit BIP section making them standard.

    instagibbs commented at 2:48 pm on October 7, 2025:
    the BIPs aren’t standardness BIPs, so I’m not sure that helps.

    murchandamus commented at 9:41 pm on December 8, 2025:
    I’m not sure if the segwit BIPs (141–144) mentioned it, but BIP 173 (Bech32) states that “implementations MUST allow the use of any version”. And that recommendation is repeated in BIP 350 (bech32m), which mentions it in the Implementation advice for test vectors.
  8. jonatack commented at 9:38 pm on September 25, 2025: member
    Quick first pass.
  9. in bip-paytoanchor.mediawiki:30 in 490aa62c71
    25+When the wallet user is unconcerned by *who* is able to bump the transaction fees as long as someone does, this output type may confer a couple of advantages:
    26+
    27+1. Using an output type with minimal output and spending input footprint saves fees on average
    28+2. Keyless operation aids in interoperability of services like watchtowers as there is no privelaged key material for bumping
    29+
    30+with the drawback that selection of this output type could result in griefing if anti-pinning measures are not taken.
    


    Roasbeef commented at 11:28 pm on September 25, 2025:
    Recommend that if unsure, then this new type is best used w/ v3 transactions are they have stricter replacement rules?

    instagibbs commented at 2:49 pm on October 7, 2025:
    done
  10. in bip-paytoanchor.mediawiki:38 in 490aa62c71
    33+
    34+A P2A output is defined as one with the exact witness output script
    35+
    36+<code>OP_1 <0x4e73></code>
    37+
    38+corresponding to the address <code>bc1pfeessrawgf</code> on Bitcoin mainnet.
    


    Roasbeef commented at 11:35 pm on September 25, 2025:
    Should also specify the encoding for: regtest, signet, and testnet. Would make for good test vectors.

    instagibbs commented at 2:50 pm on October 7, 2025:
    done
  11. Roasbeef commented at 11:37 pm on September 25, 2025: contributor
    Thanks for making this. Nearly done with an implementation for btcsuite.
  12. instagibbs force-pushed on Oct 7, 2025
  13. in bip-paytoanchor.mediawiki:4 in 9ed387c703
    0@@ -0,0 +1,76 @@
    1+<pre>
    2+  BIP: ?
    3+  Layer: Applications
    4+  Title: Pay To Anchor (P2A)
    


    murchandamus commented at 9:06 pm on December 8, 2025:

    Nit: I’d use title case here:

    0  Title: Pay to Anchor (P2A)
    

    instagibbs commented at 4:04 pm on December 9, 2025:
    done
  14. in bip-paytoanchor.mediawiki:17 in 9ed387c703
    12+                2024-10-10: https://bitcoinops.org/en/bitcoin-core-28-wallet-integration-guide/ wallet integration guide
    13+</pre>
    14+
    15+==Abstract==
    16+
    17+This document describes a new standard output script called PayToAnchor (P2A) and prescribes making spending of this output type standard.
    


    murchandamus commented at 9:07 pm on December 8, 2025:

    Nit:

    0This document describes a new standard output script called Pay to Anchor (P2A) and prescribes making spending of this output type standard.
    

    instagibbs commented at 4:04 pm on December 9, 2025:
    done
  15. in bip-paytoanchor.mediawiki:27 in 9ed387c703
    22+
    23+The "anchor" output type is a commonly used pattern in Bitcoin layer 2 systems such as Lightning Network and beyond. This pattern allows transactions which are presigned far in advance to leave a "hook" for CPFP fee bumping later, when prevailing feerates for block inclusion are better known.
    24+
    25+When the wallet user is unconcerned by *who* is able to bump the transaction fees as long as someone does, this output type may confer a couple of advantages:
    26+
    27+1. Using an output type with minimal output and spending input footprint saves fees on average
    


    murchandamus commented at 9:08 pm on December 8, 2025:

    That’s generally true, not just on average?

    01. Using an output type with minimal output and spending input footprint saves fees
    

    instagibbs commented at 4:04 pm on December 9, 2025:
    done
  16. in bip-paytoanchor.mediawiki:28 in 9ed387c703
    23+The "anchor" output type is a commonly used pattern in Bitcoin layer 2 systems such as Lightning Network and beyond. This pattern allows transactions which are presigned far in advance to leave a "hook" for CPFP fee bumping later, when prevailing feerates for block inclusion are better known.
    24+
    25+When the wallet user is unconcerned by *who* is able to bump the transaction fees as long as someone does, this output type may confer a couple of advantages:
    26+
    27+1. Using an output type with minimal output and spending input footprint saves fees on average
    28+2. Keyless operation aids in interoperability of services like watchtowers as there is no privileged key material for bumping
    


    murchandamus commented at 9:09 pm on December 8, 2025:

    missing word?

    02. Keyless operation aids in interoperability of services like watchtowers as there is no privileged key material needed for bumping
    

    instagibbs commented at 4:03 pm on December 9, 2025:
    think it reads fine, added “required” anyways
  17. in bip-paytoanchor.mediawiki:34 in 9ed387c703
    29+
    30+with the drawback that selection of this output type could result in griefing if anti-pinning measures are not taken. If unsure, use in conjunction with [https://github.com/bitcoin/bips/blob/master/bip-0431.mediawiki TRUC transactions].
    31+
    32+===Specification===
    33+
    34+A P2A output is defined as one with the exact witness output script
    


    murchandamus commented at 9:12 pm on December 8, 2025:

    “exact witness output script” feels odd, how about one of:

    0A P2A output is defined as one with the native segwit output script
    
    0A P2A output is defined as one with the output script
    
    0A P2A output is defined as one with exactly the output script
    

    instagibbs commented at 4:03 pm on December 9, 2025:
    just called it scriptPubKey instead, what do you think?

    murchandamus commented at 4:14 pm on December 9, 2025:
    Sure, that’s fine. I use “scriptPubKey” and “output script” as synonyms. I prefer the latter because it is more accessible.
  18. in bip-paytoanchor.mediawiki:36 in 9ed387c703
    31+
    32+===Specification===
    33+
    34+A P2A output is defined as one with the exact witness output script
    35+
    36+<code>OP_1 <0x4e73></code><ref>To be segwit it needs to be a witness version + witness program. This conforms to the smallest witness program size of two. The specific bytes cannot be zeros so they are chosen to spell "fees" in bech32m format.</ref>
    


    murchandamus commented at 9:24 pm on December 8, 2025:

    How about:

    0<code>OP_1 <0x4e73></code><ref>Native segwit outputs are composed of a witness version and a witness program. A witness program must be at least two bytes long and the specific bytes cannot be zeros. The two bytes for the P2A witness program are chosen to spell "fees" in bech32m encoding.</ref>
    

    instagibbs commented at 4:03 pm on December 9, 2025:
    taken
  19. in bip-paytoanchor.mediawiki:40 in 9ed387c703
    35+
    36+<code>OP_1 <0x4e73></code><ref>To be segwit it needs to be a witness version + witness program. This conforms to the smallest witness program size of two. The specific bytes cannot be zeros so they are chosen to spell "fees" in bech32m format.</ref>
    37+
    38+corresponding to the addresses <code>bc1pfeessrawgf</code> on Bitcoin mainnet, <code><tb1pfees9rn5nz</code> on public testnets, and <code>bcrt1pfeesnyr2tx</code> on regtest.
    39+
    40+P2A inputs are considered standard for spending if no witness data is attached. This avoids meaningless witness padding. Consensus meaning is unchanged.
    


    murchandamus commented at 9:30 pm on December 8, 2025:
    Perhaps explain who or what considers P2A inputs standard?

    instagibbs commented at 4:03 pm on December 9, 2025:
    added more details
  20. in bip-0433.mediawiki:60 in 9ed387c703 outdated
    55+
    56+====Backward Compatibility====
    57+
    58+Creation of P2A outputs has been considered standard since the deployment of Segwit softfork on the network.
    59+
    60+Transactions with P2A inputs were previously nonstandard, reserved as an upgrade hook.
    


    murchandamus commented at 9:43 pm on December 8, 2025:
    0Transactions with P2A inputs were previously nonstandard by Bitcoin Core, reserved as an upgrade hook.
    

    instagibbs commented at 4:03 pm on December 9, 2025:
    done
  21. murchandamus commented at 9:45 pm on December 8, 2025: contributor
    Looks pretty good already. I got a bag of nits for you.
  22. in bip-paytoanchor.mediawiki:9 in 9ed387c703
    0@@ -0,0 +1,76 @@
    1+<pre>
    2+  BIP: ?
    3+  Layer: Applications
    4+  Title: Pay To Anchor (P2A)
    5+  Author: Gregory Sanders <gsanders87@gmail.com>
    6+  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-?
    7+  Status: Draft
    8+  Type: Informational
    9+  Created: 2025-09-23
    


    murchandamus commented at 9:48 pm on December 8, 2025:
    This should hold the date of number assignment, so currently should still be “?”.

    instagibbs commented at 4:03 pm on December 9, 2025:
    added with date of assignment
  23. murchandamus added the label Needs number assignment on Dec 8, 2025
  24. Roasbeef commented at 2:04 am on December 9, 2025: contributor

    This BIP has been assigned number 433!

    (can update the readme in the PR to reflect assignment)

  25. Roasbeef renamed this:
    Add P2A BIP
    BIP 433: Add P2A BIP
    on Dec 9, 2025
  26. murchandamus removed the label Needs number assignment on Dec 9, 2025
  27. murchandamus commented at 2:20 am on December 9, 2025: contributor
    Please add an entry to the table in the README.md for your BIP, add the number to the preamble, and update the “Created” header to 2025-12-08.
  28. instagibbs force-pushed on Dec 9, 2025
  29. instagibbs force-pushed on Dec 9, 2025
  30. instagibbs commented at 4:05 pm on December 9, 2025: member
    Thanks for the review and number!
  31. Add BIP433 Pay to Anchor (P2A) ab9bc69f93
  32. instagibbs force-pushed on Dec 9, 2025
  33. murchandamus commented at 4:18 pm on December 9, 2025: contributor
    Changes look good to me. ACK ab9bc69f93a4fc36a17813a4917cc62ed69036c2

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-10 00:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me