-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BIP-373: denote different public key types/purposes consistently #1705
BIP-373: denote different public key types/purposes consistently #1705
Conversation
3c53392
to
953e807
Compare
I find the term "compressed" more clear than "plain", so I don't think that part of the change is an improvement. Similarly I find "compressed" vs "x-only" easier to understand than "plain 33 bytes" vs "x-only". I would just change: "Why the plain aggregate public key instead of x-only?" to say "compressed". |
bip-0373.mediawiki
Outdated
@@ -46,53 +46,53 @@ The new per-input types are defined as follows: | |||
| rowspan="2"|MuSig2 Participant Public Keys | |||
| rowspan="2"|<tt>PSBT_IN_MUSIG2_PARTICIPANT_PUBKEYS = 0x1a</tt> | |||
| <tt><33 byte plain aggregate pubkey></tt> | |||
| <tt><33 byte compressed pubkey>*</tt> | |||
| <tt><33 byte plain participant pubkey>*</tt> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also say "33 byte participant pubkey (compressed)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like keeping "compressed" as well, maybe consistently throughout in the manner @Sjors suggests here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bip-0373.mediawiki
Outdated
| rowspan="2"| | ||
| rowspan="2"| | ||
| rowspan="2"| 0, 2 | ||
|- | ||
| The MuSig2 aggregate plain public key<ref>'''Why the plain aggregate public key instead of x-only?''' | ||
| The MuSig2 plain aggregate public key<ref>'''Why the plain aggregate public key instead of x-only?''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "The MuSig2 aggregate public key (compressed)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
bip-0373.mediawiki
Outdated
BIP 32 requires public keys to include their evenness byte. Aggregate public keys are expected to be | ||
derived from, following [[bip-0328.mediawiki|BIP 328]], and therefore will | ||
need to include the evenness. Furthermore, PSBT_IN_TAP_BIP32_DERIVATION fields include fingerprints | ||
to identify master keys, and these fingerprints require full compressed public keys. By including | ||
to identify master keys, and these fingerprints require full plain public keys. By including |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require the y-coordinate of the public key, so x-only serialisation can't be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included.
I think more important than the concrete term is to stick to one and use it consistently, so I'm also fine with changing all occurences to "compressed" if there are no objections. My impression was that "compressed" is significantly less used now than it was in the past (when there was only 65 vs. 33 bytes), especially since x-only pubkeys could then be seen as "even more compressed" 😅 // EDIT: slightly off-topic for the BIP repo here, but if we change everything to "compressed", the RPC help for |
That's true, but there's no other word for x-inclusive key. |
Improve the clarity of the BIP w.r.t. pubkeys in the following ways: - be specific about the purpose of pubkey types in PSBT fields ("plain pubkey" alone doesn't say a lot, especially if it's used repeatedly within a field) - replace all uses of "plain pubkey" by "compressed pubkey" (the only category that should matter is whether the pubkey type is "x-only" or "plain") - use consistent word order, e.g. prefer "compressed aggregate public key" over "aggregate compressed public key"
953e807
to
50e8208
Compare
"Plain pubkey" is the terminology used by BIP 327, hence its usage here. However, if "compressed pubkey" is clearer to readers, then I'm find with that. ACK 50e8208 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @Sjors?
ACK 50e8208 |
While reviewing bitcoin/bitcoin#31247 a while ago I noticed that the mentioned public keys in the PSBT fields of this BIP are quite confusing. This is mostly due to a non-consistent mention of types (plain vs. x-only) and a purpose that is sometimes missing. This PR aims to improve this in the following ways:
Another possibility would be to even get rid of the "plain/compressed" terminology completely. From the fact that "x-only" is not explicitly mentioned and the size of 33 bytes it should be obvious that this is a plain public key.