Skip to content
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

blog/2020/11/descriptors-in-the-wild/ #1

Open
utterances-bot opened this issue Nov 25, 2020 · 4 comments
Open

blog/2020/11/descriptors-in-the-wild/ #1

utterances-bot opened this issue Nov 25, 2020 · 4 comments

Comments

@utterances-bot
Copy link

Descriptors in the wild :: Bitcoin Dev Kit

Guide to setup a 2-of-2 multisig using Bitcoin Core and BDK

https://bitcoindevkit.org/blog/2020/11/descriptors-in-the-wild/

Copy link

great article! I was wandering how can one create psbt with repl? Looking for procedure to do the same as walletcreatefundedpsbt and walletprocesspsbt in core. Thanks

@afilini
Copy link
Member

afilini commented Nov 25, 2020

The complete interface is documented at https://bitcoindevkit.org/repl/interface/

Specifically, there's the create_tx command that can be used to create a psbt and then the sign command to sign.

Copy link

if anyone is interested how to do it other way around (create PSBT in BDK and finalize it in core):

export psbt=$(repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint create_tx --to mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt:500000|jq -r '.psbt')
export psbt=$(repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint sign --psbt $psbt|jq -r '.psbt')
bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK sendrawtransaction $(bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK finalizepsbt $(bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK walletprocesspsbt $psbt | jq -r '.psbt') | jq -r '.hex')

Thanks again for this brilliant piece! Also you forgot to remove backticks from two code snippets:
here

export BDK_rec_desc="wsh(multi(2,$BDK_xprv/84'/0'/0'/0/*,$core_xpub_84_for_rec_desc))"`

and here

repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint get_new_address`

Copy link
Member

This article has been updated to use bdk-cli instead of ku to generate keys, thanks @vmenond !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants