This PR proposes to percent-encode the + character used in the Payjoin mailbox URI (pj parameter) as %2B when included in a query parameter of a Bitcoin URI.
The reason is the same as the # fragment char that is encoded as %23 to avoid it being parsed as a fragment of the Bitcoin URI instead of the payjoin URI. The + character also has reserved meaning in query parameter contexts (Bitcoin URI), different from in path contexts (payjoin URI), and improper encoding can break parsing in standards-compliant URI parsers.
This change ensures:
- Compatibility across wallets, libraries, and copy-paste behavior.
- That the Payjoin endpoint and its session parameters are interpreted as intended.
- Continued support for QR alphanumeric mode if
%2Bis used (%2bshouldn’t be used as clarified in the change to the bip)