delvingbitcoin

Serverless Payjoin Protocol Design

Serverless Payjoin Protocol Design

Original Postby bitgould

Posted on: April 1, 2024 19:17 UTC

The discussion revolves around the optimal URI encoding method for incorporating payjoin parameters, specifically the session public key ($SUBDIRECTORY_PUBKEY) and ohttp Key Configuration ($OHTTP_KEY_CONFIG), into a bitcoin URI scheme.

This decision is critical for ensuring that the bitcoin URIs, which are often converted to QR codes, remain efficient and accessible. The initial approach utilized base64url encoding due to its density and availability in related payjoin components for PSBT encoding. However, this method poses issues with QR Alphanumeric Encoding, as highlighted by research from Blockchain Commons, leading to denser and harder-to-scan QR codes.

Several alternatives to base64url have been considered for encoding these parameters. Among these, bech32m stands out as the preferred choice for the person discussing, mainly because of its widespread inclusion in bitcoin software that supports segregated witness (segwit) addresses. Bech32m's benefits include the presence of a prefix and checksum, which add value without significant drawbacks. Another option, base45, was mentioned as appealing for its efficiency in saving bytes, though it introduces an additional dependency which could be seen as a drawback.

In summary, the selection of an appropriate encoding method for payjoin parameters in bitcoin URIs is crucial for maintaining the usability and functionality of QR codes generated from these URIs. The preference leans towards bech32m due to its compatibility, built-in features, and minimal additional overhead, making it a suitable choice over base64url and other considered alternatives.