Skip to content

Commit 71868ed

Browse files
authored
Merge pull request #1 from kumulynja/bip77-pj-uri-encoding
BIP 77: Propose to encode `+` as `%2B` in pj param of Bitcoin URIs
2 parents 77b0bb2 + d6606f1 commit 71868ed

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bip-0077.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,10 @@ fragment of the Bitcoin URI.
233233
These session-specific parameters use a bech32-inspired encoding.
234234
The HRP is used as the parameter key, followed by the '1' separator,
235235
followed by the parameter value encoded using the bech32 character set in
236-
[uppercase](#uppercase-url). No checksum is used. Parameters are separated
237-
by a `+` character.
236+
[uppercase](#uppercase-url). No checksum is used. Parameters are separated by a + character,
237+
which must be [RFC 3986
238+
percent-encoded](https://datatracker.ietf.org/doc/html/rfc3986#section-2.1) as `%2B` to avoid it being interpreted as a space in Bitcoin URI query parameters.
239+
To preserve QR alphanumeric mode compatibility, `%2B` ([uppercase](#uppercase-url)) should be used instead of `%2b`.
238240

239241
The following parameters are defined, and must be provided in reverse
240242
lexicographical order:
@@ -253,7 +255,7 @@ lexicographical order:
253255
time](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16).
254256

255257
For example, a properly encoded endpoint Bitcoin URI looks like this
256-
`bitcoin:tb1q6q6de88mj8qkg0q5lupmpfexwnqjsr4d2gvx2p?amount=0.00666666&pjos=0&pj=HTTPS://PAYJO.IN/TXJCGKTKXLUUZ%23RK1Q0DJS3VVDXWQQTLQ8022QGXSX7ML9PHZ6EDSF6AKEWQG758JPS2EV+OH1QYPM59NK2LXXS4890SUAXXYT25Z2VAPHP0X7YEYCJXGWAG6UG9ZU6NQ+EX1WKV8CEC`
258+
`bitcoin:tb1q6q6de88mj8qkg0q5lupmpfexwnqjsr4d2gvx2p?amount=0.00666666&pjos=0&pj=HTTPS://PAYJO.IN/TXJCGKTKXLUUZ%23RK1Q0DJS3VVDXWQQTLQ8022QGXSX7ML9PHZ6EDSF6AKEWQG758JPS2EV%2BOH1QYPM59NK2LXXS4890SUAXXYT25Z2VAPHP0X7YEYCJXGWAG6UG9ZU6NQ%2BEX1WKV8CEC`
257259

258260
### Sender Original PSBT Messaging
259261

0 commit comments

Comments
 (0)