Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIP 77: Payjoin Version 2: Serverless Payjoin #1483

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

DanGould
Copy link

@DanGould DanGould commented Aug 12, 2023

This document proposes a backwards-compatible second version of the payjoin protocol described in BIP 78, allowing complete payjoin receiver functionality including payment output substitution without requiring them to host a secure public endpoint. This requirement is replaced with an untrusted third-party relay and streaming clients which communicate using an asynchronous protocol and authenticated, encrypted payloads. It was originally proposed to the mailing list here: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-January/021364.html

The protocol has received many rounds of review and an earlier version of this proposal has also been sent to the mailing list: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-August/021868.html

Feedback from that list post has been incorporated into this draft.

Proposing this as an Standards Track BIP to ensure wallets across the ecosystem can come to rough consensus on a single serverless payjoin standard and correctly implement it.

A few decisions have yet to reach rough consensus:

  • How should the receiver pubkeys be encoded in the BIP 21 URI? Both base64uri and Blockchain Commons UR have been proposed, with the former having more available libraries and the latter better suited for QR encoding.

The bip does contain some reference implementations based on earlier versions of this spec, but they must evolve based on the decisions we come to here.

@luke-jr
Copy link
Member

luke-jr commented Dec 26, 2023

Let's call this BIP 77

@murchandamus
Copy link
Contributor

Hi @DanGould, the first comment on this PR seems to indicate that this proposal is still WIP. Is that an accurate understanding? If this PR is not yet ready to be merged, perhaps it should be changed to "Draft". If I misunderstood the status of this PR, please respond below so someone may review to assess whether this is ready for merge.

bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
@DanGould DanGould marked this pull request as draft May 3, 2024 02:50
@DanGould DanGould force-pushed the pjv2 branch 2 times, most recently from 51bb8c0 to 9f4624e Compare May 3, 2024 03:13
@DanGould
Copy link
Author

DanGould commented May 3, 2024

Converted to draft until we have some more experience with the implementations in the wild.

Still seeking review especially on the soundness of the network privacy, choice of cryptosystem, and bip21 parameter encoding.

bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
Co-authored-by: thebrandonlucas <38222767+thebrandonlucas@users.noreply.github.com>
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved
bip-0077.mediawiki Outdated Show resolved Hide resolved

The payjoin protocols automate cooperative transaction construction to break that common-input assumption. The increased the opportunity to batch payments and and execute transaction cut-through increases intent throughput, since multiple intents combined take up fewer bytes than independent transactions.

Version 1's requirements have proven to be an obstacle to adoption. V1 coordinates payjoins over a public server endpoint secured by either TLS or Tor hidden service hosted by the receiver. Version 1 is also synchronous, requiring both sender and receiver to be online simultaneously to payjoin. Both requirements present significant barriers for all but sophisticated server operators or those wallets with complex Tor integration. Wallet developers [[https://lists.linuxfuihjknhoundation.org/pipermail/bitcoin-dev/2021-January/018358.html| regard]] these as limits to payjoin adoption.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Version 1's requirements have proven to be an obstacle to adoption. V1 coordinates payjoins over a public server endpoint secured by either TLS or Tor hidden service hosted by the receiver. Version 1 is also synchronous, requiring both sender and receiver to be online simultaneously to payjoin. Both requirements present significant barriers for all but sophisticated server operators or those wallets with complex Tor integration. Wallet developers [[https://lists.linuxfuihjknhoundation.org/pipermail/bitcoin-dev/2021-January/018358.html| regard]] these as limits to payjoin adoption.
Version 1's requirements have proven to be an obstacle to adoption. V1 coordinates payjoins over a public server endpoint secured by either TLS or Tor hidden service hosted by the receiver. Version 1 is also synchronous, requiring both sender and receiver to be online simultaneously to payjoin. Both requirements present significant barriers for all but sophisticated server operators or those wallets with complex Tor integration. Wallet developers [[https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-January/018358.html| regard]] these as limits to payjoin adoption.


Payjoin is the simplest case of interactive bitcoin batching, allowing two participants to combine their transaction intents. It solves the sole privacy problem left open in the bitcoin paper, that transactions with multiple inputs "necessarily reveal that their inputs were owned by the same owner," by enabling two owners to provide input in a transaction.

The payjoin protocols automate cooperative transaction construction to break that common-input assumption. The increased the opportunity to batch payments and and execute transaction cut-through increases intent throughput, since multiple intents combined take up fewer bytes than independent transactions.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The payjoin protocols automate cooperative transaction construction to break that common-input assumption. The increased the opportunity to batch payments and and execute transaction cut-through increases intent throughput, since multiple intents combined take up fewer bytes than independent transactions.
The payjoin protocols automate cooperative transaction construction to break that common-input assumption. The increased opportunity to batch payments and execute transaction cut-through increases intent throughput, since multiple intents combined take up fewer bytes than independent transactions.

The payjoin version 2 protocol takes the following steps:

* The recipient sends their payjoin pubkey and optional authentication credential according to the [[#enroll-messaging|enroll messaging]] protocol to receive a subdirectory allocation. It may go offline and replay enrollment to come back online.
* Out of band, the receiver of the payment, shares a bitcoin URI with the sender including a <code>pj=</code> query parameter including the subdirectory as a base64URL encoded pubkey. To support version 1 senders the directory acts as an unsecured payjoin server so <code>pjos=0</code> must be specified in the URI. Version 2 senders may safely allow output substitution regardless. An <code>ohttp=</code> parameter containing the directory's base64URL Key Config should also be provided.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Out of band, the receiver of the payment, shares a bitcoin URI with the sender including a <code>pj=</code> query parameter including the subdirectory as a base64URL encoded pubkey. To support version 1 senders the directory acts as an unsecured payjoin server so <code>pjos=0</code> must be specified in the URI. Version 2 senders may safely allow output substitution regardless. An <code>ohttp=</code> parameter containing the directory's base64URL Key Config should also be provided.
* Out of band, the receiver of the payment shares a bitcoin URI with the sender, including a <code>pj=</code> query parameter with the subdirectory as a base64URL encoded pubkey. To support version 1 senders the directory acts as an unsecured payjoin server so <code>pjos=0</code> must be specified in the URI. Version 2 senders may safely allow output substitution regardless. An <code>ohttp=</code> parameter containing the directory's base64URL Key Config should also be provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants