-
Notifications
You must be signed in to change notification settings - Fork 262
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
Adding importdescriptors
for Descriptor-Based Wallets
#199
base: master
Are you sure you want to change the base?
Conversation
ff2e1f5
to
2e87fa5
Compare
…scriptors parameter and added bech32m address type
2e87fa5
to
1ab603e
Compare
Running bitcoind (master) and a BDK descriptor-based wallet wallet.sync gives me that seems come from and have mention in bitcoin 23946 Running bitcoind v22.0 and a BDK descriptor-based wallet works but will break at v23.0 onward it seems so maybe this PR after review can make us progress forward ... |
We should verify if it's not the case anymore with 23.0 and use Sorry for the BDK off-topic, this PR should be worked on anyway |
Concept ACK - the code looks good, but there are conflicts with master. I'll review once is rebased :) |
@@ -5,6 +5,6 @@ authors = ["Steven Roose <[email protected]>"] | |||
|
|||
[dependencies] | |||
bitcoincore-rpc = { path = "../client" } | |||
bitcoin = { version = "0.26", features = [ "use-serde", "rand" ] } | |||
bitcoin = { version = "0.27", features = [ "use-serde", "rand" ] } |
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.
Currently master
is at 0.28.0, but I believe we should drop the patch specification as before so users of the library can resolve the latest patch.
So just a rebase is in order and then we can drop the patch version :)
bitcoin = { version = "0.27", features = [ "use-serde", "rand" ] } | |
bitcoin = { version = "0.28", features = [ "use-serde", "rand" ] } |
@@ -21,4 +21,4 @@ path = "src/lib.rs" | |||
serde = { version = "1", features = [ "derive" ] } | |||
serde_json = "1" | |||
|
|||
bitcoin = { version = "0.26", features = [ "use-serde" ] } | |||
bitcoin = { version = "0.27", features = [ "use-serde" ] } |
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.
bitcoin = { version = "0.27", features = [ "use-serde" ] } | |
bitcoin = { version = "0.28", features = [ "use-serde" ] } |
We'll also need to make the following an rust-bitcoincore-rpc/json/src/lib.rs Line 148 in 1ab603e
|
@@ -914,20 +919,23 @@ fn test_create_wallet(cl: &Client) { | |||
blank: None, | |||
passphrase: None, | |||
avoid_reuse: None, | |||
descriptors: 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.
Bitcoin Core 23 now creates descriptor wallets by default. So in order for these tests to pass, this needs to be descriptors: Some(false)
for each of these WalletParams
.
This should be an rust-bitcoincore-rpc/json/src/lib.rs Line 152 in 1ab603e
|
|
||
test_get_network_info(&cl); | ||
unsafe { VERSION = cl.version().unwrap() }; | ||
println!("Version: {}", version()); | ||
|
||
cl.create_wallet("testwallet", None, None, None, None).unwrap(); | ||
cl.create_wallet("testwallet", None, None, None, None, None).unwrap(); |
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.
Needs to be Some(false)
for Bitcoin Core 23 compatibility.
handle_defaults(&mut args, &[false.into(), false.into(), into_json("")?, false.into()]), | ||
handle_defaults( | ||
&mut args, | ||
&[false.into(), false.into(), into_json("")?, false.into(), false.into()], |
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.
Last default option should be true.into()
to be compatible with Bitcoin Core 23.
I don't mean to seem impatient, but is there any hope of this getting merged? I find it amazing that the Rust Bitcoin community has no need to use descriptor wallets in Bitcoin Core, which have now been available for over 2 years and are required for Taproot. |
Are you going the route without BWT now, which also isn't getting much attention currently. Adding Taproot support there wouldn't do much other than just pass descriptors to Core directly (at least that's how I'd do it if this were merged). At least then I don't think Sparrow would need this if you're just going to do descriptor RPC directly. But agree that someone would definitely need to use descriptor wallets with this crate. |
Yes, I'm considering giving up with BWT. It doesn't seem like Rust Bitcoin has sufficient community to keep up. I'd prefer a Java library for Sparrow in any case. |
This PR adds the following features:
importdescriptors
RPC commandBech32m
address supportcreatewallet
to add indescriptors
parameterrust-bitcoin
to0.27
integration_test/run.sh
script was updated to support the latest versioning of Bitcoin Core.I figure this would be very useful for anyone creating descriptor based wallets, especially with Taproot coming in!