bitcoind
and bitcoin-cli
version 23.0.ββββbitcoind -regtest -server -fallbackfee=0.0002 -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0 -blockfilterindex=1 -peerblockfilters=1
$HOME/.bitcoin/regtest
create a new descriptor wallet.
ββββbitcoin-cli -regtest -named createwallet wallet_name=trkeyspend disable_private_keys=true blank=true avoid_reuse=true descriptors=true load_on_startup=true
verify blank wallet.
ββββbitcoin-cli -regtest -rpcwallet=trkeyspend listdescriptors
get pub descriptor and checksum info.
ββββbitcoin-cli -regtest getdescriptorinfo "tr(tprv8ZgxMBicQKsPdDArR4xSAECuVxeX1jwwSXR4ApKbkYgZiziDc4LdBy2WvJeGDfUSE4UT4hHhbgEwbdq8ajjUHiKDegkwrNU6V55CxcxonVN/*)"
ββββ{
ββββ "descriptor": "tr(tpubD6NzVbkrYhZ4WgCeJid2Zds24zATB58r1q1qTLMuApUxZUxzETADNTeP6SvZKSsXs4qhvFAC21GFjXHwgxAcDtZqzzj8JMpsFDgqyjSJHGa/*)#p6qxwm0p",
ββββ "checksum": "53nr4k3n",
ββββ "isrange": true,
ββββ "issolvable": true,
ββββ "hasprivatekeys": true
ββββ}
add a single signature tr() descriptor to the "trkeyspend" wallet.
ββββbitcoin-cli -regtest -rpcwallet=trkeyspend importdescriptors '[{"desc":"tr(tpubD6NzVbkrYhZ4WgCeJid2Zds24zATB58r1q1qTLMuApUxZUxzETADNTeP6SvZKSsXs4qhvFAC21GFjXHwgxAcDtZqzzj8JMpsFDgqyjSJHGa/*)#p6qxwm0p","active":true,"timestamp":"now","label":"singlesig tr()" }]'
ββββ[
ββββ {
ββββ "success": true,
ββββ "warnings": [
ββββ "Range not given, using default keypool range"
ββββ ]
ββββ }
ββββ]
verify wallet descriptor.
ββββbitcoin-cli -regtest -rpcwallet=trkeyspend listdescriptors
ββββ{
ββββ "wallet_name": "trkeyspend",
ββββ "descriptors": [
ββββ {
ββββ "desc": "tr(tpubD6NzVbkrYhZ4WgCeJid2Zds24zATB58r1q1qTLMuApUxZUxzETADNTeP6SvZKSsXs4qhvFAC21GFjXHwgxAcDtZqzzj8JMpsFDgqyjSJHGa/*)#p6qxwm0p",
ββββ "timestamp": 1296688602,
ββββ "active": true,
ββββ "internal": false,
ββββ "range": [
ββββ 0,
ββββ 999
ββββ ],
ββββ "next": 0
ββββ }
ββββ ]
ββββ}
get two new deposit address.
ββββbitcoin-cli -regtest -rpcwallet=trkeyspend getnewaddress "test generate to" "bech32m"
ββββbcrt1p3p03j3l949mguknpksdwx82wapgr87qrzx0e5j77qcy3tlyst6ast0v6xz
ββββ
ββββbitcoin-cli -regtest -rpcwallet=trkeyspend getnewaddress "test send to" "bech32m"
ββββbcrt1pudwymxwvvv6p04g5uc2fzpeqd3fkntl9c558d0rlrlcnlazeautqm0u49z
ββββ
ββββbitcoin-cli -regtest -rpcwallet=trkeyspend getnewaddress "test change" "bech32m"
ββββbcrt1pl0fwd8wseth46ydh28jvd0dhm9rukcvm542w557r8mpva6uz2gksg5q5p0
generate new bitcoin to tr() trkeyspend wallet.
ββββbitcoin-cli -regtest generatetoaddress 200 "bcrt1p3p03j3l949mguknpksdwx82wapgr87qrzx0e5j77qcy3tlyst6ast0v6xz"
ββββ
ββββbitcoin-cli -regtest -rpcwallet=trkeyspend getbalance
ββββ5000.00000000
create spending PSBT in core from first to second address, change to third address.
ββββbitcoin-cli -regtest -rpcwallet=trkeyspend send '{"bcrt1pudwymxwvvv6p04g5uc2fzpeqd3fkntl9c558d0rlrlcnlazeautqm0u49z": 0.4321}' null unset null '{"change_address": "bcrt1pl0fwd8wseth46ydh28jvd0dhm9rukcvm542w557r8mpva6uz2gksg5q5p0", "psbt":true}'
ββββ{
ββββ "psbt": "cHNidP8BAIkCAAAAAYDkTndbEjC5MKDmvIhTC+9nUMn1oR7szUXeQlk0jOsFAAAAAAD+////AhBVkwIAAAAAIlEg41xNmcxjNBfVFOYUkQcgbFNpr+XFKHa8fx/xP/RZ7xbokHInAQAAACJRIPvS5p3Qyu9dEbdR5Ma9t9lHy2GbpVTqU8M+ws7rglItAAAAAAABAJECAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wQBKwEB/////wIA8gUqAQAAACJRIIhfGUflqXaOWmG0GuMdTuhQM/gDEZ+aS94GCRX8kF67AAAAAAAAAAAmaiSqIant4vYcP3HR3v0/qZnfo2lTdVxpBol5mWK0i+vYNpdOjPkAAAAAAQErAPIFKgEAAAAiUSCIXxlH5al2jlphtBrjHU7oUDP4AxGfmkveBgkV/JBeuwAAAA==",
ββββ "complete": false
ββββ}
create a new descriptor wallet.
ββββbitcoin-cli -regtest -named createwallet wallet_name=trscriptspend disable_private_keys=true blank=true avoid_reuse=true descriptors=true load_on_startup=true
verify blank wallet.
ββββbitcoin-cli -regtest -rpcwallet=trscriptspend listdescriptors
get pub descriptor and checksum info.
ββββbitcoin-cli -regtest getdescriptorinfo "tr(b511bd5771e47ee27558b1765e87b541668304ec567721c7b880edc0a010da55,{pk(tprv8ZgxMBicQKsPdDArR4xSAECuVxeX1jwwSXR4ApKbkYgZiziDc4LdBy2WvJeGDfUSE4UT4hHhbgEwbdq8ajjUHiKDegkwrNU6V55CxcxonVN/*),pk(8aee2b8120a5f157f1223f72b5e62b825831a27a9fdf427db7cc697494d4a642)})"
ββββ{
ββββ "descriptor": "tr(b511bd5771e47ee27558b1765e87b541668304ec567721c7b880edc0a010da55,{pk(tpubD6NzVbkrYhZ4WgCeJid2Zds24zATB58r1q1qTLMuApUxZUxzETADNTeP6SvZKSsXs4qhvFAC21GFjXHwgxAcDtZqzzj8JMpsFDgqyjSJHGa/*),pk(8aee2b8120a5f157f1223f72b5e62b825831a27a9fdf427db7cc697494d4a642)})#a3uvnj4v",
ββββ "checksum": "cnpznagc",
ββββ "isrange": true,
ββββ "issolvable": true,
ββββ "hasprivatekeys": true
ββββ}
add a script spend signature tr() descriptor to the "trkeyspend" wallet.
ββββbitcoin-cli -regtest -rpcwallet=trscriptspend importdescriptors '[{"desc":"tr(b511bd5771e47ee27558b1765e87b541668304ec567721c7b880edc0a010da55,{pk(tpubD6NzVbkrYhZ4WgCeJid2Zds24zATB58r1q1qTLMuApUxZUxzETADNTeP6SvZKSsXs4qhvFAC21GFjXHwgxAcDtZqzzj8JMpsFDgqyjSJHGa/*),pk(8aee2b8120a5f157f1223f72b5e62b825831a27a9fdf427db7cc697494d4a642)})#a3uvnj4v","active":true,"timestamp":"now","label":"script spend tr()" }]'
ββββ[
ββββ {
ββββ "success": true,
ββββ "warnings": [
ββββ "Range not given, using default keypool range"
ββββ ]
ββββ }
ββββ]
verify wallet descriptor.
ββββbitcoin-cli -regtest -rpcwallet=trscriptspend listdescriptors
ββββ{
ββββ "wallet_name": "trscriptspend",
ββββ "descriptors": [
ββββ {
ββββ "desc": "tr(b511bd5771e47ee27558b1765e87b541668304ec567721c7b880edc0a010da55,{pk(tpubD6NzVbkrYhZ4WgCeJid2Zds24zATB58r1q1qTLMuApUxZUxzETADNTeP6SvZKSsXs4qhvFAC21GFjXHwgxAcDtZqzzj8JMpsFDgqyjSJHGa/*),pk(8aee2b8120a5f157f1223f72b5e62b825831a27a9fdf427db7cc697494d4a642)})#a3uvnj4v",
ββββ "timestamp": 1652824724,
ββββ "active": true,
ββββ "internal": false,
ββββ "range": [
ββββ 0,
ββββ 999
ββββ ],
ββββ "next": 0
ββββ }
ββββ ]
ββββ}
get two new deposit address.
ββββbitcoin-cli -regtest -rpcwallet=trscriptspend getnewaddress "test generate to" "bech32m"
ββββbcrt1pw7e7gmqj2085xdtxnp37kgnlgecwph2fguv77m66zw5flmp6zq9sn44c42
ββββ
ββββbitcoin-cli -regtest -rpcwallet=trscriptspend getnewaddress "test send to" "bech32m"
ββββbcrt1p6v74yeekflargt9hd8pck3ram0z3vepmf0ah8s5duvn8emvmvmhq64egkm
ββββ
ββββbitcoin-cli -regtest -rpcwallet=trscriptspend getnewaddress "test change" "bech32m"
ββββbcrt1p2ltczq0t6tz2ez2mwu9zwmukdsq4khvlpy9c5kwlwndfxsuklz6qn93hg6
generate new bitcoin to tr() trkeyspend wallet.
ββββbitcoin-cli -regtest generatetoaddress 200 "bcrt1pw7e7gmqj2085xdtxnp37kgnlgecwph2fguv77m66zw5flmp6zq9sn44c42"
ββββ
ββββbitcoin-cli -regtest -rpcwallet=trscriptspend getbalance
ββββ5000.00000000
create spending PSBT in core from first to second address, change to third address.
ββββbitcoin-cli -regtest -rpcwallet=trscriptspend send '{"bcrt1p6v74yeekflargt9hd8pck3ram0z3vepmf0ah8s5duvn8emvmvmhq64egkm": 0.54321}' null unset null '{"change_address": "bcrt1p2ltczq0t6tz2ez2mwu9zwmukdsq4khvlpy9c5kwlwndfxsuklz6qn93hg6", "psbt":true}'
ββββ{
ββββ "psbt": "cHNidP8BAIkCAAAAARwLJS8W4FXnZNme/7PIZ2bA4AjmtIZRYjuBklAIcmmuAAAAAAD+////ApAGySYBAAAAIlEgV9eBAevSxKyJW3cKJ2+WbAFbXZ8JC4pZ33Tak0OW+LRo3zwDAAAAACJRINM9Umc2T/o0LLdpw4tEfdvFFmQ7S/tzwo3jJnztm2buAAAAAAABAJECAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wQBRAEB/////wIA8gUqAQAAACJRIHez5GwSU89DNWaYY+sif0Zw4N1JRxnvb1oTqJ/sOhALAAAAAAAAAAAmaiSqIant4vYcP3HR3v0/qZnfo2lTdVxpBol5mWK0i+vYNpdOjPkAAAAAAQErAPIFKgEAAAAiUSB3s+RsElPPQzVmmGPrIn9GcODdSUcZ729aE6if7DoQCwAAAA==",
ββββ "complete": false
ββββ}
update PSBT segwit inputs and outputs in core.
βββbitcoin-cli -regtest -rpcwallet=trkeyspend utxoupdatepsbt "cHNidP8BAIkCAAAAAX8Pluh49K9Oe1oEjrtCqhDHk5iLgdN/aUEfE+qEYf4qAAAAAAD+////AhBVkwIAAAAAIlEg41xNmcxjNBfVFOYUkQcgbFNpr+XFKHa8fx/xP/RZ7xbokHInAQAAACJRIPvS5p3Qyu9dEbdR5Ma9t9lHy2GbpVTqU8M+ws7rglItAAAAAAABAJECAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wQBEgEB/////wIA8gUqAQAAACJRIIhfGUflqXaOWmG0GuMdTuhQM/gDEZ+aS94GCRX8kF67AAAAAAAAAAAmaiSqIant4vYcP3HR3v0/qZnfo2lTdVxpBol5mWK0i+vYNpdOjPkAAAAAAQErAPIFKgEAAAAiUSCIXxlH5al2jlphtBrjHU7oUDP4AxGfmkveBgkV/JBeuwAAAA=="
βββ
βββcHNidP8BAIkCAAAAAX8Pluh49K9Oe1oEjrtCqhDHk5iLgdN/aUEfE+qEYf4qAAAAAAD+////AhBVkwIAAAAAIlEg41xNmcxjNBfVFOYUkQcgbFNpr+XFKHa8fx/xP/RZ7xbokHInAQAAACJRIPvS5p3Qyu9dEbdR5Ma9t9lHy2GbpVTqU8M+ws7rglItAAAAAAABAJECAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wQBEgEB/////wIA8gUqAQAAACJRIIhfGUflqXaOWmG0GuMdTuhQM/gDEZ+aS94GCRX8kF67AAAAAAAAAAAmaiSqIant4vYcP3HR3v0/qZnfo2lTdVxpBol5mWK0i+vYNpdOjPkAAAAAAQErAPIFKgEAAAAiUSCIXxlH5al2jlphtBrjHU7oUDP4AxGfmkveBgkV/JBeuwAAAA==
% bitcoind --version
Bitcoin Core version v23.0
% bitcoin-cli --version
Bitcoin Core RPC client version v23.0
% bitcoin-cli -regtest help
== Blockchain ==
getbestblockhash
getblock "blockhash" ( verbosity )
getblockchaininfo
getblockcount
getblockfilter "blockhash" ( "filtertype" )
getblockfrompeer "blockhash" peer_id
getblockhash height
getblockheader "blockhash" ( verbose )
getblockstats hash_or_height ( stats )
getchaintips
getchaintxstats ( nblocks "blockhash" )
getdeploymentinfo ( "blockhash" )
getdifficulty
getmempoolancestors "txid" ( verbose )
getmempooldescendants "txid" ( verbose )
getmempoolentry "txid"
getmempoolinfo
getrawmempool ( verbose mempool_sequence )
gettxout "txid" n ( include_mempool )
gettxoutproof ["txid",...] ( "blockhash" )
gettxoutsetinfo ( "hash_type" hash_or_height use_index )
preciousblock "blockhash"
pruneblockchain height
savemempool
scantxoutset "action" ( [scanobjects,...] )
verifychain ( checklevel nblocks )
verifytxoutproof "proof"
== Control ==
getmemoryinfo ( "mode" )
getrpcinfo
help ( "command" )
logging ( ["include_category",...] ["exclude_category",...] )
stop
uptime
== Mining ==
getblocktemplate ( "template_request" )
getmininginfo
getnetworkhashps ( nblocks height )
prioritisetransaction "txid" ( dummy ) fee_delta
submitblock "hexdata" ( "dummy" )
submitheader "hexdata"
== Network ==
addnode "node" "command"
clearbanned
disconnectnode ( "address" nodeid )
getaddednodeinfo ( "node" )
getconnectioncount
getnettotals
getnetworkinfo
getnodeaddresses ( count "network" )
getpeerinfo
listbanned
ping
setban "subnet" "command" ( bantime absolute )
setnetworkactive state
== Rawtransactions ==
analyzepsbt "psbt"
combinepsbt ["psbt",...]
combinerawtransaction ["hexstring",...]
converttopsbt "hexstring" ( permitsigdata iswitness )
createpsbt [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount,...},{"data":"hex"},...] ( locktime replaceable )
createrawtransaction [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount,...},{"data":"hex"},...] ( locktime replaceable )
decodepsbt "psbt"
decoderawtransaction "hexstring" ( iswitness )
decodescript "hexstring"
finalizepsbt "psbt" ( extract )
fundrawtransaction "hexstring" ( options iswitness )
getrawtransaction "txid" ( verbose "blockhash" )
joinpsbts ["psbt",...]
sendrawtransaction "hexstring" ( maxfeerate )
signrawtransactionwithkey "hexstring" ["privatekey",...] ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )
testmempoolaccept ["rawtx",...] ( maxfeerate )
utxoupdatepsbt "psbt" ( ["",{"desc":"str","range":n or [n,n]},...] )
== Signer ==
enumeratesigners
== Util ==
createmultisig nrequired ["key",...] ( "address_type" )
deriveaddresses "descriptor" ( range )
estimatesmartfee conf_target ( "estimate_mode" )
getdescriptorinfo "descriptor"
getindexinfo ( "index_name" )
signmessagewithprivkey "privkey" "message"
validateaddress "address"
verifymessage "address" "signature" "message"
== Wallet ==
abandontransaction "txid"
abortrescan
addmultisigaddress nrequired ["key",...] ( "label" "address_type" )
backupwallet "destination"
bumpfee "txid" ( options )
createwallet "wallet_name" ( disable_private_keys blank "passphrase" avoid_reuse descriptors load_on_startup external_signer )
dumpprivkey "address"
dumpwallet "filename"
encryptwallet "passphrase"
getaddressesbylabel "label"
getaddressinfo "address"
getbalance ( "dummy" minconf include_watchonly avoid_reuse )
getbalances
getnewaddress ( "label" "address_type" )
getrawchangeaddress ( "address_type" )
getreceivedbyaddress "address" ( minconf include_immature_coinbase )
getreceivedbylabel "label" ( minconf include_immature_coinbase )
gettransaction "txid" ( include_watchonly verbose )
getunconfirmedbalance
getwalletinfo
importaddress "address" ( "label" rescan p2sh )
importdescriptors "requests"
importmulti "requests" ( "options" )
importprivkey "privkey" ( "label" rescan )
importprunedfunds "rawtransaction" "txoutproof"
importpubkey "pubkey" ( "label" rescan )
importwallet "filename"
keypoolrefill ( newsize )
listaddressgroupings
listdescriptors ( private )
listlabels ( "purpose" )
listlockunspent
listreceivedbyaddress ( minconf include_empty include_watchonly "address_filter" include_immature_coinbase )
listreceivedbylabel ( minconf include_empty include_watchonly include_immature_coinbase )
listsinceblock ( "blockhash" target_confirmations include_watchonly include_removed )
listtransactions ( "label" count skip include_watchonly )
listunspent ( minconf maxconf ["address",...] include_unsafe query_options )
listwalletdir
listwallets
loadwallet "filename" ( load_on_startup )
lockunspent unlock ( [{"txid":"hex","vout":n},...] persistent )
newkeypool
psbtbumpfee "txid" ( options )
removeprunedfunds "txid"
rescanblockchain ( start_height stop_height )
restorewallet "wallet_name" "backup_file" ( load_on_startup )
send [{"address":amount,...},{"data":"hex"},...] ( conf_target "estimate_mode" fee_rate options )
sendmany "" {"address":amount,...} ( minconf "comment" ["address",...] replaceable conf_target "estimate_mode" fee_rate verbose )
sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount replaceable conf_target "estimate_mode" avoid_reuse fee_rate verbose )
sethdseed ( newkeypool "seed" )
setlabel "address" "label"
settxfee amount
setwalletflag "flag" ( value )
signmessage "address" "message"
signrawtransactionwithwallet "hexstring" ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )
unloadwallet ( "wallet_name" load_on_startup )
upgradewallet ( version )
walletcreatefundedpsbt ( [{"txid":"hex","vout":n,"sequence":n,"weight":n},...] ) [{"address":amount,...},{"data":"hex"},...] ( locktime options bip32derivs )
walletdisplayaddress "address"
walletlock
walletpassphrase "passphrase" timeout
walletpassphrasechange "oldpassphrase" "newpassphrase"
walletprocesspsbt "psbt" ( sign "sighashtype" bip32derivs finalize )
For BDK 1.0 alpha releases the latest 1.0.0-alpha.1 is set to release any day now. The marquee change for this milestone is the introduction of the ChainOracle type and related refactoring. The new ChainOracle makes it possible for BDK based wallets to directly access key blockchain data directly from sources such as Compact Block Filter clients or via the Bitcoin Core RPC interface (TBD in future releases). Other notable 1.0 alpha changes are improved no_std support for our WASM using friends, and fixing 1.48 Rust version support to keep our corporate hat users happy. For good measure new features were added to get sat_per_kwu for FeeRate and to create P2TR wallets according to the BIP-086 descriptor template.
Jul 10, 2023General Discussion Items New Projects/Support Top BDK 1.0 PRs and issues Top BDK_CLI PRs and issues Top Other PRs and issues Upcoming Events
Jun 20, 2023New Projects/Support Blink Wallet Galoy live batch servicepayout side next week new hot wallet https://github.com/bitcoindevkit/bdk/pull/976#issuecomment-1572869091 how to block by block scaling Top PRs Evan working on RPCfirst step LocalChain PR then update example
Jun 6, 2023:calendar: Tues , 13:00 UTC :round_pushpin: Discord General Voice Channel Discussion Items [ ] TBD [ ] Any review begs? :pray: [ ] Blockers? 🪨 New Projects and Support
Sep 27, 2022or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up