BIP 77: Specify v1-fallback response mechanism#2186
Conversation
| When responding to a BIP 78 sender, the receiver MUST NOT HPKE-encrypt | ||
| the *Proposal PSBT*. The receiver MUST send the *Proposal PSBT* as the | ||
| body of a PUT request, with the body being the base64-encoded PSBT | ||
| serialized as UTF-8 bytes. The target mailbox endpoint MUST be the |
There was a problem hiding this comment.
nit: "serialized as UTF-8 bytes" is correct, since base64 is a character based encoding and specifies a subset of ASCII, and UTF-8 is a superset of ASCII. there's no technical difference but this could say "serialized as ASCII", so arguably the implicit complexity of utf-8 is not necessary.
for reference, BIP 174 does not specify this, it treats the character/string and octet representations of PSBTs as separate (which is correct). BIP 78 otoh just ignores this distinction and implicitly assumes base64 is an octet encoding by composition with ASCII/UTF-8 (but realistically nobody is really going to serialize base64 as UTF-16 or EBDIC or whatever and be surprised that it doesn't work, so it's fine)
There was a problem hiding this comment.
and another nit: "encoded" more correct than "serialized" for character -> octet step, but again it's not like this could be misconstrued
|
@DanGould do you plan to update to take the review suggestions? |
The receiver-to-sender response section presented HPKE encryption and POST as the only path, when v2 receivers servicing v1 (BIP 78) senders in the wild send the cleartext base64 PSBT via PUT to their own mailbox. Add a forward-reference from the v2 path to Backwards compatibility, and specify the v1-fallback response (no HPKE; PUT method; UTF-8 body; receiver's own mailbox as target) normatively in that section. Addresses payjoin/rust-payjoin#1487. Partially addresses payjoin/rust-payjoin#844 (PUT/POST gap).
400c6f6 to
9997e00
Compare
|
Suggestions applied |
jonatack
left a comment
There was a problem hiding this comment.
Update to take feedback by @nothingmuch LGTM.
The receiver-to-sender response section presented HPKE encryption and POST as the only path, when v2 receivers servicing v1 (BIP 78) senders in the wild send the cleartext base64 PSBT via PUT to their own mailbox. Add a forward-reference from the v2 path to Backwards compatibility, and specify the v1-fallback response (no HPKE; PUT method; UTF-8 body; receiver's own mailbox as target) normatively in that section.
This puts the spec in line with PDK integrations in the wild.
Addresses payjoin/rust-payjoin#1487. Partially addresses payjoin/rust-payjoin#844.
Seeking your review, @nothingmuch