-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add Wallet::get_psbt_input function and Descriptor::max_satisfaction_weight #362
Conversation
fe8063d
to
aa86e51
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.
ACK 1e1b794. Only thing is it appears your commits are not signed anymore..?
/// for converting to/from [`PsbtSighashType`] from/to the desired signature hash type they need. | ||
#[derive(Debug)] | ||
pub(crate) struct PsbtSighashType { | ||
inner: BdkPsbtSighashType, |
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.
I like the idea of using inner
as the variable name, and wonder if we should eventually refactor other structs that use the same design pattern (simple wrappers over a BDK types).
58bd3bf
to
5e0dfbf
Compare
I fixed commit signatures, and added |
ACK 7b79f39 with some questions. Is this JSON serialization/deserialisation deterministic? Like can someone arrive from an psbt input built from a different tool and exported in json and simply import it here? Or are there corner cases? I'm not clear enough on the Rust serialization system. It looks like its not done by the rust-bitcoin crate, but just the sort of "standard" serde crate (it's a derived method). Sorry these feel like beginner questions but I was thinking it'd be cool if we can make sure we add the methods that allow us to be compatible with other implementations. Just not clear on whether a input in JSON format coming from Sparrow (Java) or Blue (bitcoin-js) would just work here, or if it's just the "jsonization" of the Rust struct itself. |
As far as I could find there's no standard serialization format for just the PSBT Output, only the whole PSBT has a standard cross-implementation serialization format. So you have a good point that this JSON approach would not be compatible across other wallets. That makes me think this could be a dead-end approach and that we should encourage users to collaboratively add inputs and outputs by constructing PSBTs and using |
Closing for now, may bring it back later after we finish updating to BDK 1.0. |
Description
Add
Wallet::get_psbt_input
andDescriptor::max_satisfaction_weight
functions and required structs and enums needed by #358.Also added
Input
from_json
constructor andjson_serialize
functions.Notes to the reviewers
After theTxBuilder::add_foreign_utxo
function is added theInput._inner
field should be renamed toinner
.Changelog notice
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features: