Skip to content

Encode &ohttp= and &exp= parameters in the &pj= URL as a fragment instead of top-level bip21 params. #298

Closed

Description

@DanGould

Right now Payjoin V2 encodes &ohttp= and &exp= as bip21 URI query keys since that seemed natural as bip78 used them for &pjos=. However, this may present a few problems down the line.

Instead of bip21 URI query keys like this

bitcoin:tb1qamy39l62neydk8hmvcfhzewpp3n906d2y335rd?pjos=0&pj=https://payjo.in/AoMhJgAzb-5vB7XspWSTbCaa2vkpucHZ6n2ZixU7vwY8&ohttp=AQAgbLIT3-hgHP5dAGB574bdCyTeJvJR4n7hLJ4B8dxgYDMABAABAAM&exp=1719258352

They should be percent-encoded as fragment paramerters in the &pj= url:

bitcoin:tb1qamy39l62neydk8hmvcfhzewpp3n906d2y335rd?pjos=0&pj=https://payjo.in/AoMhJgAzb-5vB7XspWSTbCaa2vkpucHZ6n2ZixU7vwY8%23ohttp%3DAQAgbLIT3-hgHP5dAGB574bdCyTeJvJR4n7hLJ4B8dxgYDMABAABAAM%26exp%3D1719258352

This solves problems.

  1. BIP21 parsers would otherwise need to update to support the new ohttp and exp parameters. URL parsers already parse the fragment out of a URL.
  2. QR encoders can encode everything in the &pj= parameter in alphanumeric mode which is more dense but excludes '?', '=', '&'. Each time bip21 uri params switch therefore, the QR encoded incurs overhead to switch between alphanumeric and bytes mode which can be more costly than the advantage.
  3. This stops introducing a precedence problem where multiple bip21 params could be used by conflicting protocols

To be done as part of #216

Activity

  1. added 8 commits that reference this issue on Jun 24, 2024
    fecba55
    0b516dc
    7b21179
    f534375
    7e9925f
    fbcf60a
    9f0e415
    d551d4f
  2. added this to the payjoin-0.19.0 milestone on Jun 27, 2024
  3. added 9 commits that reference this issue on Jul 8, 2024
    820a4bb
    1c5d9f4
    e2e8166
    0bbef22
    b2c5127
    9dbdd97
    78e66f6
    2cd4b2c
    57b84da
  4. added a commit that references this issue on Jul 11, 2024
    87f9f06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions