-
Notifications
You must be signed in to change notification settings - Fork 1
Adding importdescriptors
for Descriptor-Based Wallets
#1
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
Conversation
3bb64ac
to
1d9b199
Compare
Hi, I am facing a challenge in this PR. There seems to be a difference between the results coming from Reproduction:
PAYLOAD="[{\"active\":true,\"desc\":\"wpkh(tprv8ZgxMBicQKsPeTNzU5evMToRhHA9h3UCxbpzrzjUWUd6TQktkhmY82dQx5f6QaFpSWMzZxKz16xQFGeW7ykPjYuTetU6ep9aFTpAt7jKhPU/44'/0'/0'/0/*)#w2lyh4jx\",\"internal\":false,\"range\":[0,100],\"timestamp\":\"now\"},{\"active\":true,\"desc\":\"wpkh(tprv8ZgxMBicQKsPeTNzU5evMToRhHA9h3UCxbpzrzjUWUd6TQktkhmY82dQx5f6QaFpSWMzZxKz16xQFGeW7ykPjYuTetU6ep9aFTpAt7jKhPU/44'/0'/0'/0/*)#w2lyh4jx\",\"internal\":true,\"range\":[0,999],\"timestamp\":\"now\"}]"
bitcoin-cli -regtest -datadir=/tmp/rust_bitcoincore_rpc_test/2 --rpcport="12349" importdescriptors $PAYLOAD
curl --user $(cat /tmp/rust_bitcoincore_rpc_test/2/regtest/.cookie) --data-binary "{\"jsonrpc\": \"1.0\", \"id\": \"test\", \"method\": \"importdescriptors\", \"params\": $PAYLOAD}" -H 'content-type: text/plain;' http://localhost:12349/ | jq It returns an error code -1 with the importdescriptors help message. This is also the reason the test corresponding to this PR gets failed. Can anyone help me out on this? |
I was able to get the request passed and successful via the rpc-client test. I had to make the request with a single argument which contains the a json array value containing the json descriptor objects. I'm now getting an error parsing the success result, but once that's fixed I can review it with you. |
aa4c5fa
to
4c93f8b
Compare
Thanks to @notmandatory, we resolved this issue. It's ready to review now! |
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.
tACK 4c93f8b
from a quick look, the PR is good but I am not yet sure I am going to maintain this repo unless there are no other options. This is a topic we will discuss in the next bdk meeting |
@sandipndev can you also make a version of this PR for the https://github.com/rust-bitcoin/rust-bitcoincore-rpc? @RCasatta we discussed the issue a little in our last |
…scriptors parameter and added bech32m address type
adc7137
to
a3df1c2
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 a3df1c2
post merge ACK a3df1c2 good job @sandipndev! 🎉 don't forget to also update rust-bitcoin#199 to match this one |
This PR adds the following features:
importdescriptors
RPC commandBech32m
address supportcreatewallet
to add indescriptors
parameterThe
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!