-
Notifications
You must be signed in to change notification settings - Fork 84
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
Allow node wallet to receive payjoin transactions #301
base: main
Are you sure you want to change the base?
Conversation
22b2e82
to
ff71f08
Compare
Currently blocked by the failing CI https://github.com/lightningdevkit/ldk-node/actions/runs/9287478277/job/25556603253?pr=301, a tracking issue on rust bitcoin is already open here rust-bitcoin/rust-bitcoinconsensus#32. |
Hmm, unfortunately I think it's a bit of a deal breaker as we really want to keep the bindings and Rust as congruent as possible. Especially so as, in contrast to 'receive-and-open-channel', payjoin send/receive would be expected to be a client-side feature that mobile users might benefit from? I mean if it really blocks your progress we could consider landing the code behind a Two potential ways to go about it: a) Push for a fix in |
yup, working on option Now that lightningdevkit/rust-lightning#3024 is ready for reivew, this |
035ad65
to
1eac75e
Compare
@tnull Apparently I dont need the Previously I was checking if the transaction sent by the sender is broadcast-able, but the payjoin protocol requires that only if payjoin used in a non-interactive receiver, as mentioned here https://github.com/bitcoin/bips/blob/master/bip-0078.mediawiki#receivers-original-psbt-checklist. So the binding issue is longer blocking this. |
Cool, let me know when this is ready for review. What is the idea for testing this? Could we add some integration tests testing sending/receiving? To this end, since both PRs only hold a single commit and this one is based on #295, would it make sense to close #295, and add a third commit adding integration tests? |
integration test already added here https://github.com/lightningdevkit/ldk-node/pull/301/files#diff-ebba69f49eedcd3dd6a656eff964c6184b6d29c02fbad6a49d3b41c87cc3de79 I am very close to open the third PR (payjoin->channel opening), and based on the work I have done there I expect a couple of minor changes here. Will let you know when its RFR. |
b1ac224
to
d137df1
Compare
@tnull I think this is ready for review. There are a couple of things that needs discussion, I added a comment about them in the code: let me know if this PR is small enough for review and I can close #295. |
763e710
to
f2652f9
Compare
Ah, unfortunately these links don't resolve for me by now. Could you describe the issues here.
Hmm, you're right, ~2k lines changes is a mouth full, so let start with #295, land it behind a |
40e9a9d
to
801aaf5
Compare
af1c223
to
e5f3a6b
Compare
c5a0f3c
to
6209d96
Compare
Implements the payjoin sender as describe in BIP77. This would allow the on chain wallet linked to LDK node to send payjoin transactions.
Implements the payjoin sender as describe in BIP77. This would allow the on chain wallet linked to LDK node to send payjoin transactions.
Implements the payjoin receiver part as describe in BIP77. This would allow the on chain wallet linked to LDK node to receive payjoin transactions. Receiving a payjoin transaction requires first to enroll with the configured Payjoin directory and listening to our enrolled subdirectory for upcoming request. When a request received, we validate it as specified in BIP78, prepare our Payjoin proposal and send it back to the payjoin sender via the subdirectory.
This commit allows users to schedule a channel that will opened once a Payjoin request received. This can save users 1 extra onchain transaction fees. The Payjoin flow is normal with the following caveats: 1. We use `Payjoin::ProvisionalProposal::substitue_output_address` to point to the multisig output script as retrived from `LdkEvent::FundingGeneratingReady`. 2. We dont try to preserve privacy in Payjoin channel opening transactions. 3. We wait with our response to the Payjoin sender until a `Ldk::Event::FundingTxBroadcastSafe` event is received.
..to run the example `cargo run --example ldk-node-with-payjoin-support`
@jbesraa We now upgraded LDK to 0.0.124/0.0.125 which shipped your 'unsafe funding' work, which unblocks this PR I think? Do you still intend to finish these Payjoin PRs? Has there been any update on the |
Yup, I do. I see the |
Cool!
I think we previously discussed doing the latter, i.e., that first |
fully addresses #177
blocked by lightningdevkit/rust-lightning#3024