Skip to content

Encode payjoin 2 subdirectory pubkey and ohttp= param in ur::bytewords - #226

Closed
DanGould wants to merge 3 commits into
payjoin:masterfrom
DanGould:ur
Closed

Encode payjoin 2 subdirectory pubkey and ohttp= param in ur::bytewords#226
DanGould wants to merge 3 commits into
payjoin:masterfrom
DanGould:ur

Conversation

@DanGould

@DanGould DanGould commented Mar 27, 2024

Copy link
Copy Markdown
Member

base64Url encoding's character set require upper lowercasing characters, doubling the density of QRs which display their data. The only reason it was used was because it was readily available in the bitcoin crate and produced a String.

@ChristopherA suggested to use the UR encoding instead when a BIP for payjoin v2 was initially proposed. Neither the subdirectory public key identifier nore the ohttp param are themselves URIs, but they can still take advantage of the ur::bytewords encoding scheme in minimal style for QR compression benefits. Now that BIP 77 is finalizing we should seriously consider which encoding is best for the long haul.

UR's bytewords should result in smaller QR codes. I'll want to do some tests with actual QR codes but the idea is simple enough to implement thanks to @dspicher's library

@DanGould

Copy link
Copy Markdown
Member Author

After some further research on encodings, I do believe minimal bytewords encodings is a good fit. Since both types of data are already structured and annotated by the bip21 uri that carries them, they don't need. It also provides a checksum which neither the default pubkey serialization nor Oblivious HTTP KeyConfiguration have themselves.

@DanGould
DanGould requested a review from jbesraa March 28, 2024 19:54
@DanGould
DanGould marked this pull request as ready for review March 28, 2024 19:54
@DanGould DanGould closed this Mar 28, 2024
@DanGould
DanGould removed the request for review from jbesraa March 28, 2024 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant