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

Explore Payjoin support #406

Open
ghost opened this issue Jul 18, 2022 · 1 comment
Open

Explore Payjoin support #406

ghost opened this issue Jul 18, 2022 · 1 comment
Labels
concept Wild idea, or too many details unknown yet

Comments

@ghost
Copy link

ghost commented Jul 18, 2022

Joinmarket comes with built-in Payjoin support. See the Joinmarket docs on Payjoin for more details.

TL;DR 📖

Payjoins don't work out of the box via the API. It doesn't look impossible to get them working, though. Adding support for making a Payjoin payment should be slightly easier than receiving payments since it looks like there's less moving parts involved. Receiving payments requires spinning up an onion service. Support for making payments would be a good first step.


It would be nice for Jam to support Payjoins as well. Roughly speaking, there's two cases to consider:

1️⃣ Making a Payjoin payment
2️⃣ Receiving a Payjoin payment

Making a Payjoin Payment 💸

This is a relatively straight forward flow already implemented in Joinmarket's sendpayment.py script. The taker/direct-send endpoint doesn't support it yet, though.

Making a Payjoin payment in Joinmarket roughly consists of parsing the BIP21 URI and passing control to the built-in Payjoin manager instead of broadcasting a regular transaction.

From what it looks we should be able to take the implementation from the sendpayment.py script as template and transfer it over to the API endpoint without much hassle—similarly to how we did it for the Scheduler implementation.

Receiving a Payjoin Payment 💰

Receiving a payment involves spinning up an ephemeral onion service. The receive-payjoin.py script doesn't look too complicated. Whether we can easily port it to a new RPC-API endpoint remains to be seen, I'd be surprised if it turns out to be super hard, though. After all, the maker/start endpoint does something similar.

@ghost ghost added the concept Wild idea, or too many details unknown yet label Jul 18, 2022
@ghost ghost added this to the v0.2.0 - It works automagically milestone Jul 18, 2022
@theborakompanioni theborakompanioni removed this from the v0.2.0 - Housekeeping milestone Sep 22, 2023
@kristapsk
Copy link
Contributor

kristapsk commented Nov 2, 2023

The taker/direct-send endpoint doesn't support it yet, though.

I think it has been historically mistake to have destination and amount_sats as two parameters to this RPC, instead better API would have been to provide just BIP21 URI. Then payjoin send support in Jam would be trivial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concept Wild idea, or too many details unknown yet
Projects
Status: No status
Development

No branches or pull requests

2 participants