BIP48: Add p2tr script type derivation #1835

pull ben-kaufman wants to merge 1 commits into bitcoin:master from ben-kaufman:bip48-p2tr changing 1 files +13 −3
  1. ben-kaufman commented at 7:34 am on April 28, 2025: contributor

    BIP48 currently defines script types only for p2wsh and p2sh-p2wsh, but not for the newer p2tr.

    This PR proposes defining the the script_type for p2tr as 3, to provide a clear standard for the derivation to use in p2tr scripts.

  2. in bip-0048.mediawiki:203 in 95cb548d99 outdated
    196@@ -194,6 +197,13 @@ Public derivation is used at this level.
    197 |-
    198 |testnet
    199 |first
    200+|p2tr
    201+|external
    202+|first
    203+|m / 48' / 1' / 0' / 3' / 0 / 0
    


    jonatack commented at 3:12 pm on April 28, 2025:
    nit, maybe sort insertion of this entry by derivation numbers

    ben-kaufman commented at 4:18 pm on April 29, 2025:
    Moved to the end of the table
  3. in bip-0048.mediawiki:105 in 95cb548d99 outdated
     98@@ -99,10 +99,10 @@ Hardened derivation is used at this level.
     99 
    100 ===Script===
    101 
    102-This level splits the key space into two separate <code>script_type</code>(s). To provide
    103+This level splits the key space into three separate <code>script_type</code>(s). To provide
    104 forward compatibility for future script types this specification can be easily extended.
    105 
    106-Currently the only script types covered by this BIP are Native Segwit (p2wsh) and
    107+Currently the only script types covered by this BIP are Taproot (p2tr), Native Segwit (p2wsh) and
    


    jonatack commented at 3:14 pm on April 28, 2025:
    Maybe append p2tr at the end of this list rather than the start.

    ben-kaufman commented at 4:18 pm on April 29, 2025:
    Moved it to the end
  4. jonatack commented at 3:16 pm on April 28, 2025: member

    This would need sign-off by the BIP author (Fontaine dentondevelopment@protonmail.com).

    Pinging @Fonta1n3 for feedback or approval.

  5. jonatack added the label Proposed BIP modification on Apr 28, 2025
  6. jonatack added the label Pending acceptance on Apr 28, 2025
  7. BIP48: Add p2tr script type derivation e7cf2e9149
  8. ben-kaufman force-pushed on Apr 29, 2025
  9. Fonta1n3 commented at 2:10 pm on April 30, 2025: contributor

    This would need sign-off by the BIP author (Fontaine dentondevelopment@protonmail.com).

    Pinging @Fonta1n3 for feedback or approval.

    Thanks for the ping, appreciate it, will have a look this afternoon and revert back.

  10. Fonta1n3 commented at 2:30 am on May 1, 2025: contributor
    @jonatack @ben-kaufman Looks good to me!
  11. jonatack removed the label Pending acceptance on May 1, 2025
  12. jonatack commented at 3:07 am on May 1, 2025: member
    Thank you, @Fonta1n3. LGTM.
  13. jonatack merged this on May 1, 2025
  14. jonatack closed this on May 1, 2025

  15. in bip-0048.mediawiki:252 in e7cf2e9149
    247+|testnet
    248+|first
    249+|p2tr
    250+|external
    251+|first
    252+|m / 48' / 1' / 0' / 3' / 0 / 0
    


    jonatack commented at 5:15 am on May 1, 2025:
    @ben-kaufman @Fonta1n3 Should there be mainnet p2tr entry as well?

    ben-kaufman commented at 5:30 am on May 1, 2025:
    I didn’t add because there was none for p2sh-p2wsh, only testnet, but we could add for both I think.

    jonatack commented at 6:10 pm on May 3, 2025:

    I didn’t add because there was none for p2sh-p2wsh, only testnet, but we could add for both I think.

    Would you like to make a PR?


    ben-kaufman commented at 5:48 am on May 4, 2025:
  16. murchandamus commented at 7:01 pm on May 13, 2025: contributor

    Sorry for the late review, but given the flexibility of P2TR, it seems to me that this update to BIP 48 is incompletely specified. The referenced output script in BIP 67 cannot be used in P2TR since OP_CHECKMULTISIG does not exist in tapscript. In order to establish compatibility between various implementations, it should clarify what construction is exactly used for the P2TR outputs.

    As it was merged, this change to BIP 48 does not makes sense to me. I would suggest that it is rolled back while this update is fleshed out further.

    For example these questions need to be considered:

    • How is the internal key composed from the participating keys?
    • Is this referring to a keypath or scriptpath construction?
    • How is the taptree organized, is there one leaf or multiple leaves?
    • Do the leaves use MuSig2 or an OP_CHECKSIGADD-based construction?
    • What leaf version is used and what is the exact leafscript?
    • If this is a scriptpath construction, is there a MuSig2 keypath fallback?

    Given that clarifying all these aspects comprehensively would add a lot to the specification and would make existing implementations that claim to have implemented BIP 48 be non-compliant with the updated specification, it might make sense to propose this scheme in a separate document instead. I would recommend any would be author to review BIP 383 and BIP 387 as they seem to be closely related.

    Should it be further pursued to add P2TR derivation to BIP 48, I would recommend that a Changelog section is added to BIP 48.

  17. achow101 commented at 7:02 pm on May 13, 2025: member

    I don’t think we should be updating BIP 48.

    Unlike other BIPs, BIP 48 is more descriptive rather the prescriptive. As stated in the motivation, the purpose is “to define the existing industry wide practice of utilizing m/48’ derivation paths in hierarchical deterministic multi-sig wallets so that other developers may benefit from a standard.” At the time that the BIP was written, multiple implementations referenced a BIP 48 that didn’t actually exist, but were fairly consistent in implementation. Thus BIP 48 was written to actually document what was being done.

    With that context, I don’t think it makes sense to make changes to BIP 48. It describes what implementations did rather than specifying what implementations should do (although it is worded in that way).

  18. jonatack commented at 7:05 pm on May 13, 2025: member
    Hm, perhaps BIP48 ought to be updated to Final in that case.
  19. murchandamus commented at 7:06 pm on May 13, 2025: contributor
    @achow101: Thanks, I was missing that context. Given the descriptive origin, I’m even more inclined that this change should be reverted, and BIP 48 should probably be updated to Final.
  20. ben-kaufman commented at 7:10 pm on May 13, 2025: contributor

    Thanks for the comments @murchandamus @achow101

    I see your point and I agree that it will probably be better to update 48 to Final and consider a new and more complete standard for P2TR.

  21. murchandamus commented at 8:14 pm on May 13, 2025: contributor
    Thanks for the quick reply. I opened a PR to revert the changes and move BIP48 to Final in #1850.

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

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