-
Notifications
You must be signed in to change notification settings - Fork 88
Add experimental silent payment transaction creation support #220
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
base: master
Are you sure you want to change the base?
Conversation
e0a13af to
bc40b76
Compare
tvpeter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on adding this feature @nymius,
I couldn't test because I don't know how to construct sp recipients. I will check the documentation on the library and will come back to test it. In the meantime, I have left some comments.
Thank you
…actions Add experimental silent payment sending capabilities with new CreateSpTx command. This command creates signed transactions directly rather than PSBTs due to current limitations in secure shared derivation. - Add bdk_sp dependency with "sp" feature flag - Implement CreateSpTx subcommand for offline wallet operations - Add silent payment recipient parsing utility - Support mixed recipients (regular addresses + silent payments) - Generate signed transactions ready for broadcast - For the moment is not possible to enable RBF for the created transactions. Note: This is experimental functionality for testing only, not recommended for mainnet use.
…s error return value
The input for this command are two compressed public keys. The network is obtained from the wallet current network. The silent payment code generated is independent from any of the other stateful features of bdk-cli. This command is mainly intended for experimental use, do not lock any funds to the generated code if you don't know what you are doing and don't have the keys matchin the public keys used.
bc40b76 to
8d15df7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #[error("Create transaction error: {0}")] | ||
| CreateTx(#[from] bdk_wallet::error::CreateTxError), | ||
|
|
||
| #[error("Silent payment address decoding error: {0}")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #[error("Silent payment address decoding error: {0}")] | |
| #[cfg(feature = "sp")] | |
| #[error("Silent payment address decoding error: {0}")] |
| if send_all { | ||
| tx_builder.drain_wallet().drain_to(recipients[0].0.clone()); | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to drain to an SP address? if so, it will be great to cover that as well.
| for psbt_input in psbt.inputs.iter_mut() { | ||
| psbt_input.final_script_sig = None; | ||
| psbt_input.final_script_witness = None; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't it be ideal to check if they were actually finalized before resetting?
Description
This PR adds experimental support for creating silent payment transactions through a new
CreateSpTxcommand. The implementation integrates thebdk_spcrate to enable sending Bitcoin to silent payment addresses.Key changes:
bdk_spdependency as an optional featureCreateSpTxcommand with support for silent payment recipientsaddress:amountpairsNotes to the reviewers
.expect()calls that should be addressed in future iterationsChangelog notice
Added: Experimental silent payment transaction creation via
CreateSpTxcommand (feature-gated behindspflag)Checklists
All Submissions
New Features
* [ ] I've added tests for the new feature