You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR implements Payjoin sending functionality to the BDK CLI.
Draft Explanation
At the time of writing, this is a draft PR for implementing SendPayjoin to the BDK CLI. It still needs session persistence to be implemented, but I've been focused on the Payjoin receiver and sender commands so that I will work on later.
I also have a ReceivePayjoin branch on my local, but I am currently stuck at signing for both Sender and Receiver, so I am using this draft PR to get help regarding signing.
Regarding the current version of the PR, I need help with signing the original PSBT.
Notes to the reviewers
A couple of things I'd need more recommendation on:
Is the current way of handling the errors (through mapping them to a generic BDKCLI error) the best way to handle it? It makes the code quite verbose, but I was not able to find a generic Payjoin error type to add to the BDKCLIError enum so that I can just ? throughout the code.
I cannot get the signing for the original PSBT right. I am currently testing through a regtest on my local, and using the payjoin-cli for the receiver end. When I generate the URI with payjoin-cli receive and use that in the sending logic I've implemented here, the receiver returns the following. This does not have any witness data at all, and the finalized does return false. I currently cannot understand why it cannot sign the UTXOs owned by this wallet though...:
02000000014df3998e42e1fc60baa75a3bd16458d15d8842f7409c42c2d7498d1b8e945f590000000000fdffffff0210270000000000001600144fe208a8c68474e8d147804bface77057fc5ecdf63d10295000000001600149ef197c3deb0a655c92df6964306aeb96a1c991ef9010000
Error: Replied with error: Can't broadcast. PSBT rejected by mempool.
Changelog notice
I'm leaving the checklist to later since this is a draft PR for the purpose of asking for assistance.
Much like how rust-bitcoin does not have a single generic error type because there are multiple errors to handle differently, rust-bitcoin does not have a generic error type. There are many errors that may need different handling. Some are recoverable and won't need to be printed. Some might be terminal. Our next update will make this easier, but for now, the payjoin-cli reference implementation is even incomplete with regard to error handling. If you want to create an single enum with variants for each of the payjoin error types, that could work. I'm not sure what BDK-CLI's error handling strategy is.
I'd want to tap another BDK-CLI contributor to figure out what the preference for error handling for this project is.
Receiver Signing
In order to sign, I think you'll need to re-introduce the UTXO data to the PSBT so BDK can figure out what keys go to each input since that data was stripped by the receiver. You can see that I faced a similar issue, and how I resolved it using BDK 1.0 alpha in Mutiny way back. I did the same with BitMask. This is a limitation of BDK.
Accidentally closed. Please see the finalized PR: #200
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements Payjoin sending functionality to the BDK CLI.
Draft Explanation
At the time of writing, this is a draft PR for implementing SendPayjoin to the BDK CLI. It still needs session persistence to be implemented, but I've been focused on the Payjoin receiver and sender commands so that I will work on later.
I also have a ReceivePayjoin branch on my local, but I am currently stuck at signing for both Sender and Receiver, so I am using this draft PR to get help regarding signing.
Regarding the current version of the PR, I need help with signing the original PSBT.
Notes to the reviewers
A couple of things I'd need more recommendation on:
?throughout the code.payjoin-cli receiveand use that in the sending logic I've implemented here, the receiver returns the following. This does not have any witness data at all, and thefinalizeddoes return false. I currently cannot understand why it cannot sign the UTXOs owned by this wallet though...:Changelog notice
I'm leaving the checklist to later since this is a draft PR for the purpose of asking for assistance.
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features:
CHANGELOG.mdBugfixes: