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.
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.
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
nit, maybe sort insertion of this entry by derivation numbers
Moved to the end of the table
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
Maybe append p2tr at the end of this list rather than the start.
Moved it to the end
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.
@jonatack @ben-kaufman Looks good to me!
247 | +|testnet 248 | +|first 249 | +|p2tr 250 | +|external 251 | +|first 252 | +|m / 48' / 1' / 0' / 3' / 0 / 0
@ben-kaufman @Fonta1n3 Should there be mainnet p2tr entry as well?
I didn't add because there was none for p2sh-p2wsh, only testnet, but we could add for both I think.
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?
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:
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.
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).
Hm, perhaps BIP48 ought to be updated to Final in that case.
@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.
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.
Thanks for the quick reply. I opened a PR to revert the changes and move BIP48 to Final in #1850.