Add P2A BIP #1982

pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:2025-09-p2a changing 1 files +76 −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-paytoanchor.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-paytoanchor.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.
  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. Add P2A BIP 9ed387c703
  13. instagibbs force-pushed on Oct 7, 2025

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-10-12 05:10 UTC

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