From bf067fc8bfe04911bed1da8263e0906a37186491 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 1 May 2024 07:02:52 +0000 Subject: [PATCH] deploy: 06dcb000f3076e23a758881281e6c503c67df431 --- 404.html | 6 +- assets/js/{31.c8bce6b9.js => 31.2e09623a.js} | 2 +- assets/js/{40.d6250f8b.js => 40.40d30668.js} | 2 +- assets/js/{41.ae79f963.js => 41.0fe241e3.js} | 2 +- assets/js/{42.9a10d494.js => 42.bd54d519.js} | 2 +- assets/js/{43.481500e2.js => 43.3b234b14.js} | 2 +- assets/js/{44.4d519937.js => 44.1195b75f.js} | 2 +- assets/js/{45.251f6700.js => 45.41387e37.js} | 2 +- assets/js/{46.5deb1292.js => 46.883464d4.js} | 2 +- assets/js/{50.73103c2e.js => 50.7c06d746.js} | 2 +- assets/js/{51.29907970.js => 51.072a36a2.js} | 2 +- assets/js/{55.8b6a6fba.js => 55.f2658f8a.js} | 2 +- assets/js/{56.06ad83c0.js => 56.56539c8a.js} | 2 +- assets/js/{57.d75083e5.js => 57.dbe1ec8d.js} | 2 +- assets/js/{58.cbdab33e.js => 58.e412cf96.js} | 2 +- assets/js/{61.26c526fa.js => 61.1cf26963.js} | 2 +- assets/js/{62.3606e160.js => 62.b483815a.js} | 2 +- assets/js/{63.9bc2c59b.js => 63.2518a4ae.js} | 2 +- assets/js/{64.88c04aa9.js => 64.c74d4d9a.js} | 2 +- assets/js/{65.5db91110.js => 65.084b8455.js} | 2 +- assets/js/{66.371047c4.js => 66.7b4c3cb3.js} | 2 +- assets/js/{69.34e6059d.js => 69.c4fd27b4.js} | 2 +- assets/js/{70.42bd691e.js => 70.817333ce.js} | 2 +- assets/js/{74.f95bc438.js => 74.7423fc21.js} | 2 +- assets/js/{75.e7d4729b.js => 75.24e75de4.js} | 2 +- assets/js/{76.e04e7796.js => 76.2c842c7e.js} | 2 +- assets/js/{78.30d8c4b6.js => 78.c52dfcaf.js} | 2 +- assets/js/{79.210c655a.js => 79.5fec677c.js} | 2 +- assets/js/{80.f1215952.js => 80.79a4d68e.js} | 2 +- assets/js/{81.a0a6e317.js => 81.4bf5116e.js} | 2 +- .../js/{app.28c08e5f.js => app.042c0ac6.js} | 4 +- bdk-cli/compiler/index.html | 6 +- bdk-cli/concept/index.html | 6 +- bdk-cli/index.html | 6 +- bdk-cli/installation/index.html | 6 +- bdk-cli/interface/index.html | 6 +- bdk-cli/introduction/index.html | 6 +- bdk-cli/playground/index.html | 6 +- bdk-cli/regtest/index.html | 6 +- blog/2020/12/hello-world/index.html | 6 +- blog/2020/12/release-v0.2.0/index.html | 6 +- .../index.html | 6 +- .../index.html | 6 +- .../index.html | 6 +- blog/2021/01/release-v0.3.0/index.html | 6 +- blog/2021/02/release-v0.4.0/index.html | 6 +- blog/2021/03/release-v0.5.0/index.html | 6 +- blog/2021/04/release-v0.6.0/index.html | 6 +- blog/2021/05/release-v0.7.0/index.html | 6 +- blog/2021/06/release-v0.8.0/index.html | 6 +- blog/2021/07/release-v0.9.0/index.html | 6 +- .../index.html | 6 +- .../index.html | 6 +- blog/_2024-q4-update/index.html | 6 +- blog/author/Alekos Filini/index.html | 4 +- blog/author/Alekos Filini/page/2/index.html | 4 +- blog/author/Bitcoin Zavior/index.html | 4 +- .../C\303\251sar Alvarez Vallero/index.html" | 4 +- blog/author/Daniela Brozzoni/index.html | 4 +- blog/author/Gabriele Domenichini/index.html | 4 +- blog/author/Lloyd Fournier/index.html | 4 +- blog/author/Rajarshi Maitra/index.html | 4 +- blog/author/Riccardo Casatta/index.html | 4 +- blog/author/Sandipan Dey/index.html | 4 +- blog/author/Steve Myers/index.html | 4 +- blog/author/Wszdexdrf/index.html | 4 +- blog/author/index.html | 6 +- blog/author/rorp/index.html | 4 +- blog/author/thunderbiscuit/index.html | 4 +- blog/author/waterst0ne/index.html | 4 +- blog/bdk-cli-basics-multisig-2of3/index.html | 6 +- blog/bdk-cli-basics/index.html | 6 +- blog/bdk-core-pt1/index.html | 6 +- blog/bdk-rn-making-of/index.html | 6 +- blog/bdk-with-tor/index.html | 6 +- blog/bindings-scope/index.html | 6 +- blog/bitcoin-core-rpc-demo/index.html | 6 +- blog/compact-filters-demo/index.html | 6 +- blog/descriptor-based-paper-wallet/index.html | 6 +- blog/descriptors-in-the-wild/index.html | 6 +- blog/exploring-bdk-flutter/index.html | 6 +- blog/exploring-bdk-rn/index.html | 6 +- blog/getting-started-with-rust-hwi/index.html | 6 +- blog/hidden-power-of-bitcoin/index.html | 6 +- .../index.html | 6 +- blog/index.html | 4 +- blog/miniscript-vulnerability/index.html | 6 +- blog/page/2/index.html | 4 +- blog/page/3/index.html | 4 +- blog/page/4/index.html | 4 +- blog/road-to-bdk-1/index.html | 6 +- blog/spending-policy-demo/index.html | 6 +- blog/tags/Android/index.html | 4 +- blog/tags/Architecture/index.html | 4 +- blog/tags/BDK-RN/index.html | 4 +- blog/tags/BDK/index.html | 4 +- blog/tags/BIP157/index.html | 4 +- blog/tags/Bitcoin Core/index.html | 4 +- blog/tags/Development/index.html | 4 +- blog/tags/Flutter/index.html | 4 +- blog/tags/Hardware Wallets/index.html | 4 +- blog/tags/Neutrino/index.html | 4 +- blog/tags/RPC/index.html | 4 +- blog/tags/React Native/index.html | 4 +- blog/tags/Wallet/index.html | 4 +- blog/tags/architecture/index.html | 4 +- blog/tags/basics/index.html | 4 +- blog/tags/bdk-cli/index.html | 4 +- blog/tags/bdk-rn/index.html | 4 +- blog/tags/bdk/index.html | 4 +- blog/tags/bindings/index.html | 4 +- blog/tags/bitcoin-cli/index.html | 4 +- blog/tags/bitcoin/index.html | 4 +- blog/tags/blockchain/index.html | 4 +- blog/tags/coin selection/index.html | 4 +- blog/tags/compact_filters/index.html | 4 +- blog/tags/descriptor/index.html | 4 +- blog/tags/development/index.html | 4 +- blog/tags/fee/index.html | 4 +- blog/tags/getting started/index.html | 4 +- blog/tags/guide/index.html | 4 +- blog/tags/iOS/index.html | 4 +- blog/tags/index.html | 6 +- blog/tags/machine learning/index.html | 4 +- blog/tags/miniscript/index.html | 4 +- blog/tags/mobile/index.html | 4 +- blog/tags/multi-sig/index.html | 4 +- blog/tags/novice/index.html | 4 +- blog/tags/paper wallets/index.html | 4 +- blog/tags/project/index.html | 4 +- blog/tags/release/index.html | 4 +- blog/tags/rust/index.html | 4 +- blog/tags/security/index.html | 4 +- blog/tags/summer of bitcoin/index.html | 4 +- blog/tags/taproot/index.html | 4 +- blog/tags/tor/index.html | 4 +- blog/tags/tutorial/index.html | 4 +- blog/tags/wallet/index.html | 4 +- .../index.html | 6 +- case-studies/index.html | 4 +- descriptors/index.html | 6 +- .../bdk/descriptor/enum.Descriptor.html | 2 +- .../bdk/wallet/enum.ApplyBlockError.html | 4 +- .../latest/bdk/wallet/enum.InsertTxError.html | 4 +- .../latest/bdk/wallet/enum.LoadError.html | 4 +- .../latest/bdk/wallet/enum.NewError.html | 4 +- .../bdk/wallet/enum.NewOrLoadError.html | 4 +- .../fn.wallet_name_from_descriptor.html | 2 +- .../bdk/nightly/latest/bdk/wallet/index.html | 2 +- .../latest/bdk/wallet/struct.AddressInfo.html | 6 +- .../latest/bdk/wallet/struct.Balance.html | 2 +- .../latest/bdk/wallet/struct.ChangeSet.html | 6 +- .../latest/bdk/wallet/struct.Update.html | 4 +- .../latest/bdk/wallet/struct.Wallet.html | 131 +-- docs-rs/bdk/nightly/latest/bdk_chain/all.html | 2 +- .../bdk_chain/constant.COINBASE_MATURITY.html | 2 +- .../bdk/nightly/latest/bdk_chain/index.html | 4 +- .../nightly/latest/bdk_chain/sidebar-items.js | 2 +- .../latest/bdk_chain/spk_client/index.html | 2 + .../bdk_chain/spk_client/sidebar-items.js | 1 + .../spk_client/struct.FullScanRequest.html | 31 + .../spk_client/struct.FullScanResult.html | 14 + .../spk_client/struct.SyncRequest.html | 39 + .../spk_client/struct.SyncResult.html | 12 + .../bdk/nightly/latest/bdk_esplora/all.html | 2 +- .../bdk/nightly/latest/bdk_esplora/index.html | 4 +- .../latest/bdk_esplora/sidebar-items.js | 2 +- .../bdk_esplora/struct.FullScanUpdate.html | 23 - .../latest/bdk_esplora/struct.SyncUpdate.html | 21 - .../bdk_esplora/trait.EsploraAsyncExt.html | 12 +- .../latest/bdk_esplora/trait.EsploraExt.html | 12 +- .../latest/bdk_esplora/type.Error.html | 2 +- .../example_esplora/constant.DB_MAGIC.html | 2 +- .../example_esplora/constant.DB_PATH.html | 2 +- .../example_esplora/enum.EsploraCommands.html | 4 +- .../latest/example_esplora/fn.main.html | 2 +- .../nightly/latest/example_esplora/index.html | 2 +- .../example_esplora/struct.EsploraArgs.html | 4 +- .../example_esplora/struct.ScanOptions.html | 6 +- .../example_esplora/type.ChangeSet.html | 2 +- .../implementors/core/convert/trait.From.js | 2 +- .../implementors/core/marker/trait.Freeze.js | 3 +- .../implementors/core/marker/trait.Send.js | 3 +- .../implementors/core/marker/trait.Sync.js | 3 +- .../implementors/core/marker/trait.Unpin.js | 3 +- .../panic/unwind_safe/trait.RefUnwindSafe.js | 3 +- .../panic/unwind_safe/trait.UnwindSafe.js | 3 +- docs-rs/bdk/nightly/latest/search-index.js | 6 +- docs-rs/bdk/nightly/latest/source-files.js | 2 +- .../nightly/latest/src/bdk/wallet/mod.rs.html | 96 ++- .../nightly/latest/src/bdk_chain/lib.rs.html | 2 + .../latest/src/bdk_chain/spk_client.rs.html | 770 ++++++++++++++++++ .../latest/src/bdk_esplora/async_ext.rs.html | 90 +- .../src/bdk_esplora/blocking_ext.rs.html | 76 +- .../latest/src/bdk_esplora/lib.rs.html | 42 +- .../latest/src/example_esplora/main.rs.html | 144 ++-- .../src/wallet_esplora_async/main.rs.html | 68 +- .../src/wallet_esplora_blocking/main.rs.html | 60 +- .../constant.DB_MAGIC.html | 2 +- .../constant.PARALLEL_REQUESTS.html | 2 +- .../constant.SEND_AMOUNT.html | 2 +- .../constant.STOP_GAP.html | 2 +- .../latest/wallet_esplora_async/fn.main.html | 2 +- .../latest/wallet_esplora_async/index.html | 2 +- .../wallet_esplora_blocking/fn.main.html | 2 +- .../latest/wallet_esplora_blocking/index.html | 2 +- examples/index.html | 6 +- foundation/index.html | 4 +- getting-started/index.html | 6 +- index.html | 4 +- sitemap.xml | 2 +- supporters/index.html | 6 +- 212 files changed, 1647 insertions(+), 757 deletions(-) rename assets/js/{31.c8bce6b9.js => 31.2e09623a.js} (99%) rename assets/js/{40.d6250f8b.js => 40.40d30668.js} (99%) rename assets/js/{41.ae79f963.js => 41.0fe241e3.js} (99%) rename assets/js/{42.9a10d494.js => 42.bd54d519.js} (99%) rename assets/js/{43.481500e2.js => 43.3b234b14.js} (99%) rename assets/js/{44.4d519937.js => 44.1195b75f.js} (99%) rename assets/js/{45.251f6700.js => 45.41387e37.js} (99%) rename assets/js/{46.5deb1292.js => 46.883464d4.js} (99%) rename assets/js/{50.73103c2e.js => 50.7c06d746.js} (99%) rename assets/js/{51.29907970.js => 51.072a36a2.js} (99%) rename assets/js/{55.8b6a6fba.js => 55.f2658f8a.js} (99%) rename assets/js/{56.06ad83c0.js => 56.56539c8a.js} (99%) rename assets/js/{57.d75083e5.js => 57.dbe1ec8d.js} (99%) rename assets/js/{58.cbdab33e.js => 58.e412cf96.js} (99%) rename assets/js/{61.26c526fa.js => 61.1cf26963.js} (99%) rename assets/js/{62.3606e160.js => 62.b483815a.js} (99%) rename assets/js/{63.9bc2c59b.js => 63.2518a4ae.js} (99%) rename assets/js/{64.88c04aa9.js => 64.c74d4d9a.js} (99%) rename assets/js/{65.5db91110.js => 65.084b8455.js} (99%) rename assets/js/{66.371047c4.js => 66.7b4c3cb3.js} (99%) rename assets/js/{69.34e6059d.js => 69.c4fd27b4.js} (99%) rename assets/js/{70.42bd691e.js => 70.817333ce.js} (98%) rename assets/js/{74.f95bc438.js => 74.7423fc21.js} (88%) rename assets/js/{75.e7d4729b.js => 75.24e75de4.js} (98%) rename assets/js/{76.e04e7796.js => 76.2c842c7e.js} (99%) rename assets/js/{78.30d8c4b6.js => 78.c52dfcaf.js} (98%) rename assets/js/{79.210c655a.js => 79.5fec677c.js} (97%) rename assets/js/{80.f1215952.js => 80.79a4d68e.js} (99%) rename assets/js/{81.a0a6e317.js => 81.4bf5116e.js} (95%) rename assets/js/{app.28c08e5f.js => app.042c0ac6.js} (57%) create mode 100644 docs-rs/bdk/nightly/latest/bdk_chain/spk_client/index.html create mode 100644 docs-rs/bdk/nightly/latest/bdk_chain/spk_client/sidebar-items.js create mode 100644 docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanRequest.html create mode 100644 docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanResult.html create mode 100644 docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncRequest.html create mode 100644 docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncResult.html delete mode 100644 docs-rs/bdk/nightly/latest/bdk_esplora/struct.FullScanUpdate.html delete mode 100644 docs-rs/bdk/nightly/latest/bdk_esplora/struct.SyncUpdate.html create mode 100644 docs-rs/bdk/nightly/latest/src/bdk_chain/spk_client.rs.html diff --git a/404.html b/404.html index cd7ad5d12f..178b08cfa0 100644 --- a/404.html +++ b/404.html @@ -15,7 +15,7 @@ - + @@ -39,7 +39,7 @@ Blog GitHub - (opens new window)

404 - Not Found

There's nothing here.
+ (opens new window)

404 - Not Found

Looks like we've got some broken links.
Take me home.
- + diff --git a/assets/js/31.c8bce6b9.js b/assets/js/31.2e09623a.js similarity index 99% rename from assets/js/31.c8bce6b9.js rename to assets/js/31.2e09623a.js index 542adce355..940bd49eaa 100644 --- a/assets/js/31.c8bce6b9.js +++ b/assets/js/31.2e09623a.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{344:function(t,e,a){t.exports=a.p+"assets/img/BDK-RN-Architecture.42fbc351.png"},345:function(t,e,a){t.exports=a.p+"assets/img/BDK-RN.370f20c3.png"},346:function(t,e,a){t.exports=a.p+"assets/img/android_folder.0ff999be.png"},389:function(t,e,a){"use strict";a.r(e);var n=a(7),s=Object(n.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("p",[t._v("The "),e("strong",[t._v("BitcoinDevkit")]),t._v("'s "),e("strong",[t._v("React Native")]),t._v(" library ("),e("code",[t._v("bdk-rn")]),t._v(") makes it easy to develop bitcoin applications for both Android and iOS mobile platforms. Using "),e("code",[t._v("bdk-rn")]),t._v(", knowledge of the underlying bitcoin and BDK API is not required and using "),e("code",[t._v("bdk-rn")]),t._v(" is similar to using any other RN module. The goal is "),e("strong",[t._v("Rapid Bitcoin Application Development")]),t._v(" by doing the heavy lifting in advance and providing a reusable library for other developers to use. Developers simply install using "),e("code",[t._v("yarn add")]),t._v(" and start using it in a React Native Project. The native code, Rust lang implementation, configuration and other setup details are all taken care of by "),e("code",[t._v("bdk-rn")]),t._v(".")]),t._v(" "),e("p",[t._v("This article is "),e("strong",[t._v("NOT a guide on how to use bdk-rn")]),t._v(" to build a bitcoin application, rather this is an insight into how "),e("code",[t._v("bdk-rn")]),t._v(" was developed. For help on how to use "),e("code",[t._v("bdk-rn")]),t._v(" to develop a bitcoin wallet or application please refer to the user guide in the "),e("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#usage",target:"_blank",rel:"noopener noreferrer"}},[t._v("readme"),e("OutboundLink")],1),t._v(" on Github. There will be "),e("code",[t._v("how to guides")]),t._v(" published shortly on getting started with "),e("code",[t._v("bdk-rn")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"react-native-architecture"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#react-native-architecture"}},[t._v("#")]),t._v(" React Native Architecture")]),t._v(" "),e("p",[t._v("At a high level, RN consists of the UI front which is essentially JavaScript which interacts with the native iOS and Android platforms over a bridge. When communicating over the bridge values from JS are converted to native and vice versa.")]),t._v(" "),e("p",[t._v("The native part of RN consists of Android as well as iOS modules and components. The Android and iOS sections are full fledged native projects which interact with the JS side over the native bridge. A RN project has all the build configuraiton required to build both Android and iOS projects.")]),t._v(" "),e("p",[t._v("For the purpose of making "),e("code",[t._v("bdk-rn")]),t._v(", "),e("code",[t._v("bdk-kotlin")]),t._v(" is used as the native Android module and "),e("code",[t._v("bdk-swift")]),t._v(" as the native iOS module. These are configured and wrapped in a RN Project as part of the platform specific native modules within the RN Project. This RN Project is then built to be a reusable React Native module.")]),t._v(" "),e("figure",[e("img",{attrs:{src:a(344),alt:""}})]),t._v(" "),e("h2",{attrs:{id:"native-integration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#native-integration"}},[t._v("#")]),t._v(" Native Integration")]),t._v(" "),e("p",[t._v("In order to communicate to native modules on Android and iOS, React Native provides React Context API for Java/Kotlin as well as Swift. React Context API are used to build the interface to the native bridge allowing communication from JS to native modules.")]),t._v(" "),e("p",[t._v("bdk-rn uses React Context API plus some native code to wrap and enhance bdk-kotlin and bdk-swift APIs. The native code calls and interacts with the Android and iOS native modules which interface with the underlying mobile platform.")]),t._v(" "),e("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"20%"},attrs:{src:a(345)}}),t._v(" "),e("h2",{attrs:{id:"android-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#android-module"}},[t._v("#")]),t._v(" Android Module")]),t._v(" "),e("p",[t._v("We will go into the details of how the BDK Android Module is integrated, we wont cover iOS.")]),t._v(" "),e("p",[t._v("Starting off with a basic RN project. This project will be enhanced with bdk-kotlin and bdk-swift binaries and native code. For now lets go into the details for Android, iOS has similar steps to be done in Swift.")]),t._v(" "),e("p",[t._v("The Android native project is located under the root project folder.")]),t._v(" "),e("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"120%"},attrs:{src:a(346)}}),t._v(" "),e("p",[t._v("Here we need to add a dependency in "),e("code",[t._v("build.gradle")]),t._v(" for bdk-kotlin's android native binary. This will enable bdk-kotlin to be downloaded and available as one of the native modules.")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: build.gradle")]),t._v("\n\nrepositories "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("mavenCentral")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\ndependencies "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//noinspection GradleDynamicVersion")]),t._v("\n implementation "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'com.facebook.react:react-native:+'")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// bitcoindevkit")]),t._v("\n implementation "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'org.bitcoindevkit:bdk-android:0.7.1'")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("We will create an Android native module which will interact with "),e("code",[t._v("bdk-android")]),t._v(".\nThis is done by adding a new Kotlin file "),e("code",[t._v("BdkRnModule.kt")]),t._v(" inside "),e("code",[t._v("android/app/src/main/java/com/bdkrn/")]),t._v(" folder")]),t._v(" "),e("p",[t._v("This will be part of the native code for bdk-rn module.Here a new class will be created to encapsulate the interaction with bitcoindevkit's android native binary.")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" android"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("SuppressLint\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" android"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Log\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Arguments\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Promise "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" Result\n")])])]),e("p",[e("code",[t._v("org.bitcoindevkit")]),t._v(" will also need to be imported here")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" org"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bitcoindevkit"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Wallet "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" BdkWallet\n")])])]),e("p",[t._v("To use React Context API "),e("code",[t._v("com.facebook.react.bridge.*")]),t._v(" also needs to be imported")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("\n")])])]),e("p",[t._v("A new class needs to be defined here which will implement the React Context API")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("BdkRnModule")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ReactApplicationContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n\t"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("ReactContextBaseJavaModule")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getName")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BdkRnModule"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("With the base imports and class defined, we can start writing methods.\nThis will demonstrate how bdk native module will be called and how values will be returned to JS over the native bridge")]),t._v(" "),e("p",[t._v("Lets create a method that can be called from JaveScript, to do so we use the "),e("code",[t._v("@ReactMethod")]),t._v(" directive which is part of the React Context API. This will expose the method so that it can be called from JavaScript.")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token annotation builtin"}},[t._v("@ReactMethod")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("result"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Promise"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("We need one more file to complete our native framework. A new Kotlin file, "),e("code",[t._v("BdkRnPackage.kt")]),t._v(" is required to package all our native code into a new android module, here we specify the name of the file we just crated as the module name("),e("code",[t._v("BdkRnModule")]),t._v("). This can be done by adding the following code:")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnPackage.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ReactPackage\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("NativeModule\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ReactApplicationContext\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("uimanager"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ViewManager\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" BdkRnPackage "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ReactPackage "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNativeModules")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ReactApplicationContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n MutableList"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("NativeModule"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("mutableListOf")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("BdkRnModule")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])]),e("p",[t._v("Now lets add code for creating a wallet in BdkRnModule.kt")]),t._v(" "),e("p",[t._v("The methods used here are for bdk-kotlin and available in the bdk-kotlin documentation.")]),t._v(" "),e("p",[t._v("We first create a key info object")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token annotation builtin"}},[t._v("@ReactMethod")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("result"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Promise"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create key info with a new mnemonic")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" keys"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ExtendedKeyInfo "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateExtendedKey")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n Network"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("TESTNET"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n WordCount"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("WORDS12"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n \n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// more code to follow...")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create descriptor and change descriptor")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create databaseConfig and blockchainconfig")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create wallet")]),t._v("\n \n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("Then key info used to create a wallet descriptor and change descriptor:")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" descriptor"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wpkh("')])]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" keys"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("xprv "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(' "'),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("84")]),t._v("'"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("'"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("'"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*)\"\n\nval changeDescriptor: String = descriptor.replace(\"/84'/1'/0'/0/*\",\"/84'/1'/0'/1/*\")\n")])])])]),e("p",[t._v("To create a wallet with bdk we need to specify wallet descriptor, network, a database config, blockchain config. We intend to use bitcoin testnet and want to use default memory for data. For bitcoin node we will use a public electrum server. We will need to define these parameters to create a wallet.")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" network "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" `Network"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("TESTNET`\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" databaseConfig "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" DatabaseConfig"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Memory\nblockchainConfig "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n BlockchainConfig"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("Electrum")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("ElectrumConfig")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ssl://electrum.blockstream.info:60002"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 5u"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 10u"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("Once done we can use these parameters to create a BDK wallet using the native android BDK library:")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" wallet"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" BdkWallet "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("BdkWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n descriptor"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n changeDescriptor"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("setNetwork")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("network"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n databaseConfig"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n config\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("Once we have a wallet initialised, we can call methods on it to sync, generate a new address and to get balance")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[t._v("wallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ProgressLog"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" maxAddress"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\nwallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getNewAddress")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\nwallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("toLong")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("To return a value from the native android code to React Native’s Javascript side over the JS Native bridge we will use "),e("code",[t._v("com.facebook.react.bridge.Promise")]),t._v(". To return balance information to JS, the following code can be used")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" balance"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("toLong")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nresult"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("At this point we have an Android native module and it can be invoked from JS by calling "),e("code",[t._v("createWallet")]),t._v(" and it will return the balance.")]),t._v(" "),e("p",[t._v("This project can be imported into any RN project to reuse the defined "),e("code",[t._v("createWallet")]),t._v(" method without the need to carry out the setup described above.")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// any js file in React Native")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" BdkRn "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-rn'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a wallet and retrieve current balance")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" balance "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nconsole"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" balance "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n")])])]),e("p",[t._v("The actual "),e("code",[t._v("bdk-rn")]),t._v(" module has organised the native code into granular methods for different stages of creating a wallet and for different interactions and use cases for a bitcoin application, like generating, mnemonic, keys, creating wallet for different networks, creating descriptors, creating or restoring wallet, fetching balance, fetching transactions and many other methods. Please refer to the "),e("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#usage",target:"_blank",rel:"noopener noreferrer"}},[t._v("user guide in the readme"),e("OutboundLink")],1),t._v(" on Github for the complete API. The set of APIs available will grow in the near future as more APIs are added. This article can also be used as a guide to add new methods to the existing bdk-rn project.")]),t._v(" "),e("p",[t._v("The objective of "),e("code",[t._v("bdk-rn")]),t._v(" is to enable React Native developers to quickly start developing applications without the need to package BDK as described above.")]),t._v(" "),e("p",[t._v("Be on the lookout for user guides and tutorials on how to build bitcoin applications using "),e("code",[t._v("bdk-rn")]),t._v(" and "),e("code",[t._v("bdk-flutter")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"references"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#references"}},[t._v("#")]),t._v(" References")]),t._v(" "),e("p",[t._v("Creating native modules for Android and iOS: "),e("a",{attrs:{href:"https://reactnative.dev/docs/native-modules-intro",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://reactnative.dev/docs/native-modules-intro"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("React Native Architecture: "),e("a",{attrs:{href:"https://www.reactnative.guide/3-react-native-internals/3.1-react-native-internals.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://www.reactnative.guide/3-react-native-internals/3.1-react-native-internals.html"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("BDK-Android API: "),e("a",{attrs:{href:"https://bitcoindevkit.org/bdk-jvm/bdk-jvm/org.bitcoindevkit/index.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://bitcoindevkit.org/bdk-jvm/bdk-jvm/org.bitcoindevkit/index.html"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("BDK-RN: "),e("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/LtbLightning/bdk-rn"),e("OutboundLink")],1)]),t._v(" "),e("h2",{attrs:{id:"feedback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#feedback"}},[t._v("#")]),t._v(" Feedback")]),t._v(" "),e("p",[t._v("The best way to give feedback on this would be to comment on the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bitcoindevkit.org/pull/107",target:"_blank",rel:"noopener noreferrer"}},[t._v("pull request"),e("OutboundLink")],1),t._v(" for this blog post.\nThanks in advance.")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{344:function(t,e,a){t.exports=a.p+"assets/img/BDK-RN-Architecture.42fbc351.png"},345:function(t,e,a){t.exports=a.p+"assets/img/BDK-RN.370f20c3.png"},346:function(t,e,a){t.exports=a.p+"assets/img/android_folder.0ff999be.png"},391:function(t,e,a){"use strict";a.r(e);var n=a(7),s=Object(n.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("p",[t._v("The "),e("strong",[t._v("BitcoinDevkit")]),t._v("'s "),e("strong",[t._v("React Native")]),t._v(" library ("),e("code",[t._v("bdk-rn")]),t._v(") makes it easy to develop bitcoin applications for both Android and iOS mobile platforms. Using "),e("code",[t._v("bdk-rn")]),t._v(", knowledge of the underlying bitcoin and BDK API is not required and using "),e("code",[t._v("bdk-rn")]),t._v(" is similar to using any other RN module. The goal is "),e("strong",[t._v("Rapid Bitcoin Application Development")]),t._v(" by doing the heavy lifting in advance and providing a reusable library for other developers to use. Developers simply install using "),e("code",[t._v("yarn add")]),t._v(" and start using it in a React Native Project. The native code, Rust lang implementation, configuration and other setup details are all taken care of by "),e("code",[t._v("bdk-rn")]),t._v(".")]),t._v(" "),e("p",[t._v("This article is "),e("strong",[t._v("NOT a guide on how to use bdk-rn")]),t._v(" to build a bitcoin application, rather this is an insight into how "),e("code",[t._v("bdk-rn")]),t._v(" was developed. For help on how to use "),e("code",[t._v("bdk-rn")]),t._v(" to develop a bitcoin wallet or application please refer to the user guide in the "),e("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#usage",target:"_blank",rel:"noopener noreferrer"}},[t._v("readme"),e("OutboundLink")],1),t._v(" on Github. There will be "),e("code",[t._v("how to guides")]),t._v(" published shortly on getting started with "),e("code",[t._v("bdk-rn")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"react-native-architecture"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#react-native-architecture"}},[t._v("#")]),t._v(" React Native Architecture")]),t._v(" "),e("p",[t._v("At a high level, RN consists of the UI front which is essentially JavaScript which interacts with the native iOS and Android platforms over a bridge. When communicating over the bridge values from JS are converted to native and vice versa.")]),t._v(" "),e("p",[t._v("The native part of RN consists of Android as well as iOS modules and components. The Android and iOS sections are full fledged native projects which interact with the JS side over the native bridge. A RN project has all the build configuraiton required to build both Android and iOS projects.")]),t._v(" "),e("p",[t._v("For the purpose of making "),e("code",[t._v("bdk-rn")]),t._v(", "),e("code",[t._v("bdk-kotlin")]),t._v(" is used as the native Android module and "),e("code",[t._v("bdk-swift")]),t._v(" as the native iOS module. These are configured and wrapped in a RN Project as part of the platform specific native modules within the RN Project. This RN Project is then built to be a reusable React Native module.")]),t._v(" "),e("figure",[e("img",{attrs:{src:a(344),alt:""}})]),t._v(" "),e("h2",{attrs:{id:"native-integration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#native-integration"}},[t._v("#")]),t._v(" Native Integration")]),t._v(" "),e("p",[t._v("In order to communicate to native modules on Android and iOS, React Native provides React Context API for Java/Kotlin as well as Swift. React Context API are used to build the interface to the native bridge allowing communication from JS to native modules.")]),t._v(" "),e("p",[t._v("bdk-rn uses React Context API plus some native code to wrap and enhance bdk-kotlin and bdk-swift APIs. The native code calls and interacts with the Android and iOS native modules which interface with the underlying mobile platform.")]),t._v(" "),e("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"20%"},attrs:{src:a(345)}}),t._v(" "),e("h2",{attrs:{id:"android-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#android-module"}},[t._v("#")]),t._v(" Android Module")]),t._v(" "),e("p",[t._v("We will go into the details of how the BDK Android Module is integrated, we wont cover iOS.")]),t._v(" "),e("p",[t._v("Starting off with a basic RN project. This project will be enhanced with bdk-kotlin and bdk-swift binaries and native code. For now lets go into the details for Android, iOS has similar steps to be done in Swift.")]),t._v(" "),e("p",[t._v("The Android native project is located under the root project folder.")]),t._v(" "),e("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"120%"},attrs:{src:a(346)}}),t._v(" "),e("p",[t._v("Here we need to add a dependency in "),e("code",[t._v("build.gradle")]),t._v(" for bdk-kotlin's android native binary. This will enable bdk-kotlin to be downloaded and available as one of the native modules.")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: build.gradle")]),t._v("\n\nrepositories "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("mavenCentral")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\ndependencies "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//noinspection GradleDynamicVersion")]),t._v("\n implementation "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'com.facebook.react:react-native:+'")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// bitcoindevkit")]),t._v("\n implementation "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'org.bitcoindevkit:bdk-android:0.7.1'")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("We will create an Android native module which will interact with "),e("code",[t._v("bdk-android")]),t._v(".\nThis is done by adding a new Kotlin file "),e("code",[t._v("BdkRnModule.kt")]),t._v(" inside "),e("code",[t._v("android/app/src/main/java/com/bdkrn/")]),t._v(" folder")]),t._v(" "),e("p",[t._v("This will be part of the native code for bdk-rn module.Here a new class will be created to encapsulate the interaction with bitcoindevkit's android native binary.")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" android"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("SuppressLint\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" android"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Log\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Arguments\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Promise "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" Result\n")])])]),e("p",[e("code",[t._v("org.bitcoindevkit")]),t._v(" will also need to be imported here")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" org"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bitcoindevkit"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Wallet "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" BdkWallet\n")])])]),e("p",[t._v("To use React Context API "),e("code",[t._v("com.facebook.react.bridge.*")]),t._v(" also needs to be imported")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("\n")])])]),e("p",[t._v("A new class needs to be defined here which will implement the React Context API")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("BdkRnModule")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ReactApplicationContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n\t"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("ReactContextBaseJavaModule")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getName")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BdkRnModule"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("With the base imports and class defined, we can start writing methods.\nThis will demonstrate how bdk native module will be called and how values will be returned to JS over the native bridge")]),t._v(" "),e("p",[t._v("Lets create a method that can be called from JaveScript, to do so we use the "),e("code",[t._v("@ReactMethod")]),t._v(" directive which is part of the React Context API. This will expose the method so that it can be called from JavaScript.")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token annotation builtin"}},[t._v("@ReactMethod")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("result"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Promise"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("We need one more file to complete our native framework. A new Kotlin file, "),e("code",[t._v("BdkRnPackage.kt")]),t._v(" is required to package all our native code into a new android module, here we specify the name of the file we just crated as the module name("),e("code",[t._v("BdkRnModule")]),t._v("). This can be done by adding the following code:")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnPackage.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ReactPackage\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("NativeModule\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ReactApplicationContext\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("uimanager"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ViewManager\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" BdkRnPackage "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ReactPackage "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNativeModules")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ReactApplicationContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n MutableList"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("NativeModule"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("mutableListOf")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("BdkRnModule")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])]),e("p",[t._v("Now lets add code for creating a wallet in BdkRnModule.kt")]),t._v(" "),e("p",[t._v("The methods used here are for bdk-kotlin and available in the bdk-kotlin documentation.")]),t._v(" "),e("p",[t._v("We first create a key info object")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token annotation builtin"}},[t._v("@ReactMethod")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("result"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Promise"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create key info with a new mnemonic")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" keys"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ExtendedKeyInfo "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateExtendedKey")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n Network"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("TESTNET"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n WordCount"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("WORDS12"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n \n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// more code to follow...")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create descriptor and change descriptor")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create databaseConfig and blockchainconfig")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create wallet")]),t._v("\n \n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("Then key info used to create a wallet descriptor and change descriptor:")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" descriptor"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wpkh("')])]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" keys"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("xprv "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(' "'),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("84")]),t._v("'"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("'"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("'"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*)\"\n\nval changeDescriptor: String = descriptor.replace(\"/84'/1'/0'/0/*\",\"/84'/1'/0'/1/*\")\n")])])])]),e("p",[t._v("To create a wallet with bdk we need to specify wallet descriptor, network, a database config, blockchain config. We intend to use bitcoin testnet and want to use default memory for data. For bitcoin node we will use a public electrum server. We will need to define these parameters to create a wallet.")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" network "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" `Network"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("TESTNET`\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" databaseConfig "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" DatabaseConfig"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Memory\nblockchainConfig "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n BlockchainConfig"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("Electrum")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("ElectrumConfig")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ssl://electrum.blockstream.info:60002"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 5u"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 10u"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("Once done we can use these parameters to create a BDK wallet using the native android BDK library:")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" wallet"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" BdkWallet "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("BdkWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n descriptor"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n changeDescriptor"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("setNetwork")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("network"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n databaseConfig"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n config\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("Once we have a wallet initialised, we can call methods on it to sync, generate a new address and to get balance")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[t._v("wallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ProgressLog"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" maxAddress"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\nwallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getNewAddress")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\nwallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("toLong")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("To return a value from the native android code to React Native’s Javascript side over the JS Native bridge we will use "),e("code",[t._v("com.facebook.react.bridge.Promise")]),t._v(". To return balance information to JS, the following code can be used")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" balance"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("toLong")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nresult"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("At this point we have an Android native module and it can be invoked from JS by calling "),e("code",[t._v("createWallet")]),t._v(" and it will return the balance.")]),t._v(" "),e("p",[t._v("This project can be imported into any RN project to reuse the defined "),e("code",[t._v("createWallet")]),t._v(" method without the need to carry out the setup described above.")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// any js file in React Native")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" BdkRn "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-rn'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a wallet and retrieve current balance")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" balance "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nconsole"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" balance "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n")])])]),e("p",[t._v("The actual "),e("code",[t._v("bdk-rn")]),t._v(" module has organised the native code into granular methods for different stages of creating a wallet and for different interactions and use cases for a bitcoin application, like generating, mnemonic, keys, creating wallet for different networks, creating descriptors, creating or restoring wallet, fetching balance, fetching transactions and many other methods. Please refer to the "),e("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#usage",target:"_blank",rel:"noopener noreferrer"}},[t._v("user guide in the readme"),e("OutboundLink")],1),t._v(" on Github for the complete API. The set of APIs available will grow in the near future as more APIs are added. This article can also be used as a guide to add new methods to the existing bdk-rn project.")]),t._v(" "),e("p",[t._v("The objective of "),e("code",[t._v("bdk-rn")]),t._v(" is to enable React Native developers to quickly start developing applications without the need to package BDK as described above.")]),t._v(" "),e("p",[t._v("Be on the lookout for user guides and tutorials on how to build bitcoin applications using "),e("code",[t._v("bdk-rn")]),t._v(" and "),e("code",[t._v("bdk-flutter")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"references"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#references"}},[t._v("#")]),t._v(" References")]),t._v(" "),e("p",[t._v("Creating native modules for Android and iOS: "),e("a",{attrs:{href:"https://reactnative.dev/docs/native-modules-intro",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://reactnative.dev/docs/native-modules-intro"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("React Native Architecture: "),e("a",{attrs:{href:"https://www.reactnative.guide/3-react-native-internals/3.1-react-native-internals.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://www.reactnative.guide/3-react-native-internals/3.1-react-native-internals.html"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("BDK-Android API: "),e("a",{attrs:{href:"https://bitcoindevkit.org/bdk-jvm/bdk-jvm/org.bitcoindevkit/index.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://bitcoindevkit.org/bdk-jvm/bdk-jvm/org.bitcoindevkit/index.html"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("BDK-RN: "),e("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/LtbLightning/bdk-rn"),e("OutboundLink")],1)]),t._v(" "),e("h2",{attrs:{id:"feedback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#feedback"}},[t._v("#")]),t._v(" Feedback")]),t._v(" "),e("p",[t._v("The best way to give feedback on this would be to comment on the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bitcoindevkit.org/pull/107",target:"_blank",rel:"noopener noreferrer"}},[t._v("pull request"),e("OutboundLink")],1),t._v(" for this blog post.\nThanks in advance.")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/40.d6250f8b.js b/assets/js/40.40d30668.js similarity index 99% rename from assets/js/40.d6250f8b.js rename to assets/js/40.40d30668.js index 85ab325e44..9e2c066643 100644 --- a/assets/js/40.d6250f8b.js +++ b/assets/js/40.40d30668.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{387:function(t,e,s){"use strict";s.r(e);var a=s(7),r=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h2",{attrs:{id:"2-of-3-multi-signature-descriptor-wallet-using-bdk-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#2-of-3-multi-signature-descriptor-wallet-using-bdk-cli"}},[t._v("#")]),t._v(" 2-of-3 Multi-Signature Descriptor Wallet using bdk-cli")]),t._v(" "),e("h2",{attrs:{id:"overview-of-the-tutorial"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#overview-of-the-tutorial"}},[t._v("#")]),t._v(" Overview of the tutorial")]),t._v(" "),e("ul",[e("li",[t._v("The purpose of this tutorial is to continue learning "),e("code",[t._v("bdk-cli")]),t._v(" as our tool to manage a 2 of 3 multi-signature wallet.")]),t._v(" "),e("li",[t._v("Generate a receive address with a spending Policy of 2 out of 3 escrow aka multi-signature.")]),t._v(" "),e("li",[t._v("Intro to more complex but standard policies to create custom encumberances aka custom spending conditions for transactions.")])]),t._v(" "),e("p",[t._v("Note that to complete this tutorial, you'll need to enable the "),e("code",[t._v("compiler")]),t._v(" and "),e("code",[t._v("electrum")]),t._v(" flags when installing or building bdk-cli, for example by installing using:")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--features")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("compiler,electrum\n")])])]),e("h2",{attrs:{id:"step-1-generate-the-xprvs-extended-keys-and-save-to-environment-variables"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-1-generate-the-xprvs-extended-keys-and-save-to-environment-variables"}},[t._v("#")]),t._v(" Step 1: Generate the XPRVs (Extended-Keys) and Save to environment variables")]),t._v(" "),e("blockquote",[e("p",[t._v("Create three private keys and each in their own environment variable")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export XPRV_00=$(bdk-cli key generate | jq -r '.xprv')")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export XPRV_01=$(bdk-cli key generate | jq -r '.xprv')")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export XPRV_02=$(bdk-cli key generate | jq -r '.xprv')")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/FwgUdwK.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"1a-verify-xprv-environment-variables-are-active"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1a-verify-xprv-environment-variables-are-active"}},[t._v("#")]),t._v(" 1a: Verify XPRV environment variables are Active")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("env | grep XPRV")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/ZerGPbO.gif",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-2-generate-xpubs-extended-public-keys-save-to-environment-variables"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-2-generate-xpubs-extended-public-keys-save-to-environment-variables"}},[t._v("#")]),t._v(" Step 2: Generate XPUBs (Extended Public Keys) & Save to environment variables")]),t._v(" "),e("blockquote",[e("p",[t._v("Generate the three individual Public Keys aka XPUBs using our Private key and descriptor path.")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export XPUB_00=$(bdk-cli key derive --xprv $XPRV_00 --path "m/84\'/1\'/0\'/0" | jq -r ".xpub")')])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export XPUB_01=$(bdk-cli key derive --xprv $XPRV_01 --path "m/84\'/1\'/0\'/0" | jq -r ".xpub")')])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export XPUB_02=$(bdk-cli key derive --xprv $XPRV_02 --path "m/84\'/1\'/0\'/0" | jq -r ".xpub")')])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/xT3KRh4.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"2a-verify-xpub-environment-variables"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#2a-verify-xpub-environment-variables"}},[t._v("#")]),t._v(" 2a: Verify XPUB environment variables")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("env | grep XPUB")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/SzAip9E.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-3-create-single-wallet-descriptors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-3-create-single-wallet-descriptors"}},[t._v("#")]),t._v(" Step 3: Create Single-Wallet Descriptors")]),t._v(" "),e("blockquote",[e("p",[t._v("Create the wallet Descriptor for each wallet")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export DESCRIPTOR_00="$XPRV_00/84h/1h/0h/0/*"')])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export DESCRIPTOR_01="$XPRV_01/84h/1h/0h/0/*"')])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export DESCRIPTOR_02="$XPRV_02/84h/1h/0h/0/*"')])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/mFrWt6b.png",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-4-create-multi-sig-descriptor-wallets"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-4-create-multi-sig-descriptor-wallets"}},[t._v("#")]),t._v(" Step 4: Create Multi-Sig-Descriptor Wallets")]),t._v(" "),e("blockquote",[e("p",[t._v("This is how you create the 2-of-3 multi-sig output descriptor. You will need (one PrivateKey and two Xpubs) It consists of using the "),e("code",[t._v("compiler")]),t._v(" function to parse "),e("code",[t._v("policy")]),t._v(" to "),e("code",[t._v("mini-script")]),t._v(" .")])]),t._v(" "),e("ul",[e("li",[t._v("When creating the descriptor the order matters so be aware of that when following tutorial if you are for any reason changing the order of the policy.")])]),t._v(" "),e("h4",{attrs:{id:"multi-sig-wallet-0"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#multi-sig-wallet-0"}},[t._v("#")]),t._v(" Multi-Sig-Wallet 0")]),t._v(" "),e("ul",[e("li",[t._v("[ ] ▶️ "),e("code",[t._v("export MULTI_DESCRIPTOR_00=$(bdk-cli compile \"thresh(2,pk($DESCRIPTOR_00),pk($XPUB_01),pk($XPUB_02))\" | jq -r '.descriptor')")])])]),t._v(" "),e("h4",{attrs:{id:"multi-sig-wallet-1"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#multi-sig-wallet-1"}},[t._v("#")]),t._v(" Multi-Sig-Wallet 1")]),t._v(" "),e("ul",[e("li",[t._v("[ ] ▶️ "),e("code",[t._v("export MULTI_DESCRIPTOR_01=$(bdk-cli compile \"thresh(2,pk($XPUB_00),pk($DESCRIPTOR_01),pk($XPUB_02))\" | jq -r '.descriptor')")])])]),t._v(" "),e("h4",{attrs:{id:"multi-sig-wallet-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#multi-sig-wallet-2"}},[t._v("#")]),t._v(" Multi-Sig-Wallet 2")]),t._v(" "),e("ul",[e("li",[t._v("[ ] ▶️ "),e("code",[t._v("export MULTI_DESCRIPTOR_02=$(bdk-cli compile \"thresh(2,pk($XPUB_00),pk($XPUB_01),pk($DESCRIPTOR_02))\" | jq -r '.descriptor')")])])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/Yb8RmFS.gif",alt:""}})]),t._v(" "),e("h4",{attrs:{id:"multi-sig-2-of-3-policy-gets-compiled-to-miniscript"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#multi-sig-2-of-3-policy-gets-compiled-to-miniscript"}},[t._v("#")]),t._v(" multi-sig 2 of 3 policy gets compiled to miniscript")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# policy")]),t._v("\nthresh"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",pk"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("XPRV_A"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",pk"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("XPUB_B"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",pk"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("XPUB_C"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("))")]),t._v(" \n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# miniscript")]),t._v("\nwsh"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multi"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",XPRV_KEY,PUBKEY_B,XPUB_C"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("))")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h3",{attrs:{id:"4a-verify-multi-sig-descriptor-environment-variables-are-active"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#4a-verify-multi-sig-descriptor-environment-variables-are-active"}},[t._v("#")]),t._v(" 4a: Verify Multi-Sig-Descriptor environment variables are active")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("env | grep MULTI")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/aAgtlsi.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-5-generate-receive-address-by-using-multi-sig-descriptor-wallets"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-5-generate-receive-address-by-using-multi-sig-descriptor-wallets"}},[t._v("#")]),t._v(" Step 5: Generate Receive Address by using Multi-Sig-Descriptor Wallets")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 get_new_address")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd01 --descriptor $MULTI_DESCRIPTOR_01 get_new_address")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd02 --descriptor $MULTI_DESCRIPTOR_02 get_new_address")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/w1fxPSn.gif",alt:""}})]),t._v(" "),e("p",[t._v("🔴 Did you generate the same address for all three? Good! Else, something might be incorrect.")]),t._v(" "),e("h2",{attrs:{id:"step-6-send-testnet-bitcoin-to-the-newly-created-receive-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-6-send-testnet-bitcoin-to-the-newly-created-receive-address"}},[t._v("#")]),t._v(" Step 6: Send Testnet Bitcoin to the newly created receive-address")]),t._v(" "),e("p",[e("a",{attrs:{href:"https://testnet-faucet.mempool.co",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Testnet Faucet link:1"),e("OutboundLink")],1),t._v(" "),e("a",{attrs:{href:"https://bitcoinfaucet.uo1.net",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Testnet Faucet link:2"),e("OutboundLink")],1)]),t._v(" "),e("h2",{attrs:{id:"step-7-sync-one-of-the-multi-sig-wallets"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-7-sync-one-of-the-multi-sig-wallets"}},[t._v("#")]),t._v(" Step 7: Sync one of the Multi-Sig Wallets")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 sync")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/GuefgeI.gif",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-8-check-balance-multi-sig-wallets"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-8-check-balance-multi-sig-wallets"}},[t._v("#")]),t._v(" Step 8: Check Balance Multi-Sig Wallets")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 get_balance")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/zNciCqF.gif",alt:""}})]),t._v(" "),e("ul",[e("li",[t._v("Every wallet has access to sync and view balance.")])]),t._v(" "),e("h2",{attrs:{id:"step-9-check-multi-sig-policies-on-descriptor-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-9-check-multi-sig-policies-on-descriptor-wallet"}},[t._v("#")]),t._v(" Step 9: Check Multi-Sig Policies on Descriptor Wallet")]),t._v(" "),e("p",[t._v("▶️"),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 policies")])]),t._v(" "),e("p",[t._v("The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"external"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"contribution"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"conditions"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"items"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"n"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sorted"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" false,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PARTIAL"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"seaxtqqn"')]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"keys"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fingerprint"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"7cdf2d46"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fingerprint"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fc7870cd"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fingerprint"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"26b03333"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"satisfaction"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"items"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"n"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sorted"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" false,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PARTIAL"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"threshold"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"MULTISIG"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"internal"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" null\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n\n")])])]),e("h3",{attrs:{id:"spendingpolicyrequired-for-complex-descriptors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#spendingpolicyrequired-for-complex-descriptors"}},[t._v("#")]),t._v(" SpendingPolicyRequired for complex descriptors")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--external_policy")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{'),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("seaxtqqn"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(': [0,1]}"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("-rootnode-"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("children "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("#0 and #1 of root node>")]),t._v("\n")])])]),e("blockquote",[e("p",[t._v("Save the \"id\": We will need to use this ''id'' later.")])]),t._v(" "),e("p",[t._v("More info on "),e("a",{attrs:{href:"https://bitcoindevkit.org/bdk-cli/interface/",target:"_blank",rel:"noopener noreferrer"}},[t._v("external policies here"),e("OutboundLink")],1)]),t._v(" "),e("h2",{attrs:{id:"step-10-create-a-transaction-psbt"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-10-create-a-transaction-psbt"}},[t._v("#")]),t._v(" Step 10: Create a Transaction (PSBT)")]),t._v(" "),e("ul",[e("li",[t._v("1st Create a PSBT using the first wallet")]),t._v(" "),e("li",[t._v("2nd Sign the PSBT with the first wallet")]),t._v(" "),e("li",[t._v("3rd Sign PSBT with the second wallet")]),t._v(" "),e("li",[t._v("Broadcast PSBT")])]),t._v(" "),e("h3",{attrs:{id:"export-unsigned-psbt-to-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#export-unsigned-psbt-to-environment-variable"}},[t._v("#")]),t._v(" Export UNSIGNED_PSBT to environment variable")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export UNSIGNED_PSBT=$(bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 create_tx --send_all --to mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt:0 --external_policy "{\\"CHANGE_ID_HERE\\": [0,1]}" | jq -r \'.psbt\')')])]),t._v(" "),e("h3",{attrs:{id:"verify-unsigned-psbt-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#verify-unsigned-psbt-environment-variable"}},[t._v("#")]),t._v(" Verify UNSIGNED_PSBT environment variable")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("env | grep UNSIGNED")]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/djHaRDq.gif",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-11-sign-the-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-11-sign-the-transaction"}},[t._v("#")]),t._v(" Step 11: SIGN the Transaction")]),t._v(" "),e("h3",{attrs:{id:"1st-wallet-signs-the-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1st-wallet-signs-the-transaction"}},[t._v("#")]),t._v(" 1st Wallet Signs the transaction")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 sign --psbt $UNSIGNED_PSBT")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export ONESIG_PSBT=$(bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 sign --psbt $UNSIGNED_PSBT | jq -r '.psbt')")])]),t._v(" "),e("p",[t._v("▶️"),e("code",[t._v("env | grep ONESIG")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "is_finalized": false,\n "psbt": "cHNidP8BAFUBAAAAAdYCtva/7Rkt+fgFu3mxAdaPh4uTbgBL3HmYZgcEKWygAAAAAAD/////AQqGAQAAAAAAGXapFDRKD0jKFQ7CuQOBdmC5tosTpnAmiKwAAAAAAAEA6gIAAAAAAQFLyGFJFK884DGBM1WgskRZ6gKp/7oZ+Z30u0+wF3pZYAEAAAAA/v///wKghgEAAAAAACIAINHcOQLE6GpJ3J+FOzn/be+HApxW8sZtGqfA3TBW+NYX91hoOAAAAAAWABTPQDZx2wYYIn+ug2pZBmWBn0Tu/gJHMEQCIHu6GmRMDgPZyTx+klFMA9VujR3qDA/Y08kSkRvOaChjAiBAtExtGAYLuQ/DDJzCqLlNZ1bMB3MV+nxsLfTdI9YcYwEhA0b8lz+kt0xHfR/tjUKOc2Nt2L61pDd5vJ/lsKi8pw9MmFUjAAEBK6CGAQAAAAAAIgAg0dw5AsToakncn4U7Of9t74cCnFbyxm0ap8DdMFb41hciAgIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDUgwRQIhAJdILr7G3UzYylyr2fA13MFsz/jG4+iZlKeEkX79d082AiA99UF0/uFyXBVNUmuGaxdHL7wlhzqfbgGLMREN0z/O6QEBBWlSIQIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDSEDzsDXexRPSxeXiLJoS0i2fQlOoOGHmo+Dhaeaq3oHV6YhAjGKA2Dqg+QeMICBAifYslQF2WrehLEQ0iEOpp/+eQ0NU64iBgIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDRh83y1GVAAAgAEAAIAAAACAAAAAAAAAAAAiBgIxigNg6oPkHjCAgQIn2LJUBdlq3oSxENIhDqaf/nkNDRgmsDMzVAAAgAEAAIAAAACAAAAAAAAAAAAiBgPOwNd7FE9LF5eIsmhLSLZ9CU6g4Yeaj4OFp5qregdXphj8eHDNVAAAgAEAAIAAAACAAAAAAAAAAAAAAA=="\n}\n')])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/0w4sK5y.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"2nd-wallet-signs-the-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#2nd-wallet-signs-the-transaction"}},[t._v("#")]),t._v(" 2nd Wallet Signs the transaction")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd01 --descriptor $MULTI_DESCRIPTOR_01 sign --psbt $ONESIG_PSBT")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export SECONDSIG_PSBT=$(bdk-cli wallet --wallet wallet_name_msd01 --descriptor $MULTI_DESCRIPTOR_01 sign --psbt $ONESIG_PSBT | jq -r '.psbt')")])]),t._v(" "),e("p",[t._v("▶️"),e("code",[t._v("env | grep SECONDSIG")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "is_finalized": true,\n "psbt": "cHNidP8BAFUBAAAAAdYCtva/7Rkt+fgFu3mxAdaPh4uTbgBL3HmYZgcEKWygAAAAAAD/////AQqGAQAAAAAAGXapFDRKD0jKFQ7CuQOBdmC5tosTpnAmiKwAAAAAAAEA6gIAAAAAAQFLyGFJFK884DGBM1WgskRZ6gKp/7oZ+Z30u0+wF3pZYAEAAAAA/v///wKghgEAAAAAACIAINHcOQLE6GpJ3J+FOzn/be+HApxW8sZtGqfA3TBW+NYX91hoOAAAAAAWABTPQDZx2wYYIn+ug2pZBmWBn0Tu/gJHMEQCIHu6GmRMDgPZyTx+klFMA9VujR3qDA/Y08kSkRvOaChjAiBAtExtGAYLuQ/DDJzCqLlNZ1bMB3MV+nxsLfTdI9YcYwEhA0b8lz+kt0xHfR/tjUKOc2Nt2L61pDd5vJ/lsKi8pw9MmFUjAAEBK6CGAQAAAAAAIgAg0dw5AsToakncn4U7Of9t74cCnFbyxm0ap8DdMFb41hciAgIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDUgwRQIhAJdILr7G3UzYylyr2fA13MFsz/jG4+iZlKeEkX79d082AiA99UF0/uFyXBVNUmuGaxdHL7wlhzqfbgGLMREN0z/O6QEiAgPOwNd7FE9LF5eIsmhLSLZ9CU6g4Yeaj4OFp5qregdXpkgwRQIhAO2aRERcublhAzToshkZRMg2I8GaE7mM2ECr0vYyuscmAiB5KK4ETlvrLqL0QbcRbGqrSwIa9lVuOqP3f5qCnGRMaQEBBWlSIQIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDSEDzsDXexRPSxeXiLJoS0i2fQlOoOGHmo+Dhaeaq3oHV6YhAjGKA2Dqg+QeMICBAifYslQF2WrehLEQ0iEOpp/+eQ0NU64iBgIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDRh83y1GVAAAgAEAAIAAAACAAAAAAAAAAAAiBgIxigNg6oPkHjCAgQIn2LJUBdlq3oSxENIhDqaf/nkNDRgmsDMzVAAAgAEAAIAAAACAAAAAAAAAAAAiBgPOwNd7FE9LF5eIsmhLSLZ9CU6g4Yeaj4OFp5qregdXphj8eHDNVAAAgAEAAIAAAACAAAAAAAAAAAABBwABCP3+AAQASDBFAiEAl0guvsbdTNjKXKvZ8DXcwWzP+Mbj6JmUp4SRfv13TzYCID31QXT+4XJcFU1Sa4ZrF0cvvCWHOp9uAYsxEQ3TP87pAUgwRQIhAO2aRERcublhAzToshkZRMg2I8GaE7mM2ECr0vYyuscmAiB5KK4ETlvrLqL0QbcRbGqrSwIa9lVuOqP3f5qCnGRMaQFpUiECI1AiHZ8q+qw7bjYVTbeGQQ3L2C2sH6CW82z8sXP1jQ0hA87A13sUT0sXl4iyaEtItn0JTqDhh5qPg4Wnmqt6B1emIQIxigNg6oPkHjCAgQIn2LJUBdlq3oSxENIhDqaf/nkNDVOuAAA="\n}\n')])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/OdLHnJ3.gif",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-12-broadcast-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-12-broadcast-transaction"}},[t._v("#")]),t._v(" Step 12: Broadcast Transaction")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd01 --descriptor $MULTI_DESCRIPTOR_01 broadcast --psbt $SECONDSIG_PSBT")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "txid": "61da2451874a483aa8d1d0787c7680d157639f284840de8885098cac43f6cc2f"\n}\n')])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/M7s0Fd6.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"verify-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#verify-transaction"}},[t._v("#")]),t._v(" Verify Transaction")]),t._v(" "),e("p",[t._v("Verify transcation in the memory pool on testnet "),e("a",{attrs:{href:"https://mempool.space/testnet",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mempool-testnet!"),e("OutboundLink")],1)])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{385:function(t,e,s){"use strict";s.r(e);var a=s(7),r=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h2",{attrs:{id:"2-of-3-multi-signature-descriptor-wallet-using-bdk-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#2-of-3-multi-signature-descriptor-wallet-using-bdk-cli"}},[t._v("#")]),t._v(" 2-of-3 Multi-Signature Descriptor Wallet using bdk-cli")]),t._v(" "),e("h2",{attrs:{id:"overview-of-the-tutorial"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#overview-of-the-tutorial"}},[t._v("#")]),t._v(" Overview of the tutorial")]),t._v(" "),e("ul",[e("li",[t._v("The purpose of this tutorial is to continue learning "),e("code",[t._v("bdk-cli")]),t._v(" as our tool to manage a 2 of 3 multi-signature wallet.")]),t._v(" "),e("li",[t._v("Generate a receive address with a spending Policy of 2 out of 3 escrow aka multi-signature.")]),t._v(" "),e("li",[t._v("Intro to more complex but standard policies to create custom encumberances aka custom spending conditions for transactions.")])]),t._v(" "),e("p",[t._v("Note that to complete this tutorial, you'll need to enable the "),e("code",[t._v("compiler")]),t._v(" and "),e("code",[t._v("electrum")]),t._v(" flags when installing or building bdk-cli, for example by installing using:")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--features")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("compiler,electrum\n")])])]),e("h2",{attrs:{id:"step-1-generate-the-xprvs-extended-keys-and-save-to-environment-variables"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-1-generate-the-xprvs-extended-keys-and-save-to-environment-variables"}},[t._v("#")]),t._v(" Step 1: Generate the XPRVs (Extended-Keys) and Save to environment variables")]),t._v(" "),e("blockquote",[e("p",[t._v("Create three private keys and each in their own environment variable")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export XPRV_00=$(bdk-cli key generate | jq -r '.xprv')")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export XPRV_01=$(bdk-cli key generate | jq -r '.xprv')")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export XPRV_02=$(bdk-cli key generate | jq -r '.xprv')")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/FwgUdwK.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"1a-verify-xprv-environment-variables-are-active"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1a-verify-xprv-environment-variables-are-active"}},[t._v("#")]),t._v(" 1a: Verify XPRV environment variables are Active")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("env | grep XPRV")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/ZerGPbO.gif",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-2-generate-xpubs-extended-public-keys-save-to-environment-variables"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-2-generate-xpubs-extended-public-keys-save-to-environment-variables"}},[t._v("#")]),t._v(" Step 2: Generate XPUBs (Extended Public Keys) & Save to environment variables")]),t._v(" "),e("blockquote",[e("p",[t._v("Generate the three individual Public Keys aka XPUBs using our Private key and descriptor path.")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export XPUB_00=$(bdk-cli key derive --xprv $XPRV_00 --path "m/84\'/1\'/0\'/0" | jq -r ".xpub")')])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export XPUB_01=$(bdk-cli key derive --xprv $XPRV_01 --path "m/84\'/1\'/0\'/0" | jq -r ".xpub")')])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export XPUB_02=$(bdk-cli key derive --xprv $XPRV_02 --path "m/84\'/1\'/0\'/0" | jq -r ".xpub")')])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/xT3KRh4.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"2a-verify-xpub-environment-variables"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#2a-verify-xpub-environment-variables"}},[t._v("#")]),t._v(" 2a: Verify XPUB environment variables")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("env | grep XPUB")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/SzAip9E.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-3-create-single-wallet-descriptors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-3-create-single-wallet-descriptors"}},[t._v("#")]),t._v(" Step 3: Create Single-Wallet Descriptors")]),t._v(" "),e("blockquote",[e("p",[t._v("Create the wallet Descriptor for each wallet")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export DESCRIPTOR_00="$XPRV_00/84h/1h/0h/0/*"')])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export DESCRIPTOR_01="$XPRV_01/84h/1h/0h/0/*"')])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export DESCRIPTOR_02="$XPRV_02/84h/1h/0h/0/*"')])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/mFrWt6b.png",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-4-create-multi-sig-descriptor-wallets"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-4-create-multi-sig-descriptor-wallets"}},[t._v("#")]),t._v(" Step 4: Create Multi-Sig-Descriptor Wallets")]),t._v(" "),e("blockquote",[e("p",[t._v("This is how you create the 2-of-3 multi-sig output descriptor. You will need (one PrivateKey and two Xpubs) It consists of using the "),e("code",[t._v("compiler")]),t._v(" function to parse "),e("code",[t._v("policy")]),t._v(" to "),e("code",[t._v("mini-script")]),t._v(" .")])]),t._v(" "),e("ul",[e("li",[t._v("When creating the descriptor the order matters so be aware of that when following tutorial if you are for any reason changing the order of the policy.")])]),t._v(" "),e("h4",{attrs:{id:"multi-sig-wallet-0"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#multi-sig-wallet-0"}},[t._v("#")]),t._v(" Multi-Sig-Wallet 0")]),t._v(" "),e("ul",[e("li",[t._v("[ ] ▶️ "),e("code",[t._v("export MULTI_DESCRIPTOR_00=$(bdk-cli compile \"thresh(2,pk($DESCRIPTOR_00),pk($XPUB_01),pk($XPUB_02))\" | jq -r '.descriptor')")])])]),t._v(" "),e("h4",{attrs:{id:"multi-sig-wallet-1"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#multi-sig-wallet-1"}},[t._v("#")]),t._v(" Multi-Sig-Wallet 1")]),t._v(" "),e("ul",[e("li",[t._v("[ ] ▶️ "),e("code",[t._v("export MULTI_DESCRIPTOR_01=$(bdk-cli compile \"thresh(2,pk($XPUB_00),pk($DESCRIPTOR_01),pk($XPUB_02))\" | jq -r '.descriptor')")])])]),t._v(" "),e("h4",{attrs:{id:"multi-sig-wallet-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#multi-sig-wallet-2"}},[t._v("#")]),t._v(" Multi-Sig-Wallet 2")]),t._v(" "),e("ul",[e("li",[t._v("[ ] ▶️ "),e("code",[t._v("export MULTI_DESCRIPTOR_02=$(bdk-cli compile \"thresh(2,pk($XPUB_00),pk($XPUB_01),pk($DESCRIPTOR_02))\" | jq -r '.descriptor')")])])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/Yb8RmFS.gif",alt:""}})]),t._v(" "),e("h4",{attrs:{id:"multi-sig-2-of-3-policy-gets-compiled-to-miniscript"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#multi-sig-2-of-3-policy-gets-compiled-to-miniscript"}},[t._v("#")]),t._v(" multi-sig 2 of 3 policy gets compiled to miniscript")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# policy")]),t._v("\nthresh"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",pk"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("XPRV_A"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",pk"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("XPUB_B"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",pk"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("XPUB_C"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("))")]),t._v(" \n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# miniscript")]),t._v("\nwsh"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multi"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",XPRV_KEY,PUBKEY_B,XPUB_C"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("))")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h3",{attrs:{id:"4a-verify-multi-sig-descriptor-environment-variables-are-active"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#4a-verify-multi-sig-descriptor-environment-variables-are-active"}},[t._v("#")]),t._v(" 4a: Verify Multi-Sig-Descriptor environment variables are active")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("env | grep MULTI")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/aAgtlsi.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-5-generate-receive-address-by-using-multi-sig-descriptor-wallets"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-5-generate-receive-address-by-using-multi-sig-descriptor-wallets"}},[t._v("#")]),t._v(" Step 5: Generate Receive Address by using Multi-Sig-Descriptor Wallets")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 get_new_address")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd01 --descriptor $MULTI_DESCRIPTOR_01 get_new_address")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd02 --descriptor $MULTI_DESCRIPTOR_02 get_new_address")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/w1fxPSn.gif",alt:""}})]),t._v(" "),e("p",[t._v("🔴 Did you generate the same address for all three? Good! Else, something might be incorrect.")]),t._v(" "),e("h2",{attrs:{id:"step-6-send-testnet-bitcoin-to-the-newly-created-receive-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-6-send-testnet-bitcoin-to-the-newly-created-receive-address"}},[t._v("#")]),t._v(" Step 6: Send Testnet Bitcoin to the newly created receive-address")]),t._v(" "),e("p",[e("a",{attrs:{href:"https://testnet-faucet.mempool.co",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Testnet Faucet link:1"),e("OutboundLink")],1),t._v(" "),e("a",{attrs:{href:"https://bitcoinfaucet.uo1.net",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Testnet Faucet link:2"),e("OutboundLink")],1)]),t._v(" "),e("h2",{attrs:{id:"step-7-sync-one-of-the-multi-sig-wallets"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-7-sync-one-of-the-multi-sig-wallets"}},[t._v("#")]),t._v(" Step 7: Sync one of the Multi-Sig Wallets")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 sync")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/GuefgeI.gif",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-8-check-balance-multi-sig-wallets"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-8-check-balance-multi-sig-wallets"}},[t._v("#")]),t._v(" Step 8: Check Balance Multi-Sig Wallets")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 get_balance")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/zNciCqF.gif",alt:""}})]),t._v(" "),e("ul",[e("li",[t._v("Every wallet has access to sync and view balance.")])]),t._v(" "),e("h2",{attrs:{id:"step-9-check-multi-sig-policies-on-descriptor-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-9-check-multi-sig-policies-on-descriptor-wallet"}},[t._v("#")]),t._v(" Step 9: Check Multi-Sig Policies on Descriptor Wallet")]),t._v(" "),e("p",[t._v("▶️"),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 policies")])]),t._v(" "),e("p",[t._v("The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"external"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"contribution"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"conditions"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"items"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"n"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sorted"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" false,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PARTIAL"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"seaxtqqn"')]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"keys"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fingerprint"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"7cdf2d46"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fingerprint"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fc7870cd"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fingerprint"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"26b03333"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"satisfaction"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"items"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"n"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sorted"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" false,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PARTIAL"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"threshold"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"MULTISIG"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"internal"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" null\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n\n")])])]),e("h3",{attrs:{id:"spendingpolicyrequired-for-complex-descriptors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#spendingpolicyrequired-for-complex-descriptors"}},[t._v("#")]),t._v(" SpendingPolicyRequired for complex descriptors")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--external_policy")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{'),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("seaxtqqn"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(': [0,1]}"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("-rootnode-"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("children "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("#0 and #1 of root node>")]),t._v("\n")])])]),e("blockquote",[e("p",[t._v("Save the \"id\": We will need to use this ''id'' later.")])]),t._v(" "),e("p",[t._v("More info on "),e("a",{attrs:{href:"https://bitcoindevkit.org/bdk-cli/interface/",target:"_blank",rel:"noopener noreferrer"}},[t._v("external policies here"),e("OutboundLink")],1)]),t._v(" "),e("h2",{attrs:{id:"step-10-create-a-transaction-psbt"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-10-create-a-transaction-psbt"}},[t._v("#")]),t._v(" Step 10: Create a Transaction (PSBT)")]),t._v(" "),e("ul",[e("li",[t._v("1st Create a PSBT using the first wallet")]),t._v(" "),e("li",[t._v("2nd Sign the PSBT with the first wallet")]),t._v(" "),e("li",[t._v("3rd Sign PSBT with the second wallet")]),t._v(" "),e("li",[t._v("Broadcast PSBT")])]),t._v(" "),e("h3",{attrs:{id:"export-unsigned-psbt-to-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#export-unsigned-psbt-to-environment-variable"}},[t._v("#")]),t._v(" Export UNSIGNED_PSBT to environment variable")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export UNSIGNED_PSBT=$(bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 create_tx --send_all --to mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt:0 --external_policy "{\\"CHANGE_ID_HERE\\": [0,1]}" | jq -r \'.psbt\')')])]),t._v(" "),e("h3",{attrs:{id:"verify-unsigned-psbt-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#verify-unsigned-psbt-environment-variable"}},[t._v("#")]),t._v(" Verify UNSIGNED_PSBT environment variable")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("env | grep UNSIGNED")]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/djHaRDq.gif",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-11-sign-the-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-11-sign-the-transaction"}},[t._v("#")]),t._v(" Step 11: SIGN the Transaction")]),t._v(" "),e("h3",{attrs:{id:"1st-wallet-signs-the-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1st-wallet-signs-the-transaction"}},[t._v("#")]),t._v(" 1st Wallet Signs the transaction")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 sign --psbt $UNSIGNED_PSBT")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export ONESIG_PSBT=$(bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 sign --psbt $UNSIGNED_PSBT | jq -r '.psbt')")])]),t._v(" "),e("p",[t._v("▶️"),e("code",[t._v("env | grep ONESIG")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "is_finalized": false,\n "psbt": "cHNidP8BAFUBAAAAAdYCtva/7Rkt+fgFu3mxAdaPh4uTbgBL3HmYZgcEKWygAAAAAAD/////AQqGAQAAAAAAGXapFDRKD0jKFQ7CuQOBdmC5tosTpnAmiKwAAAAAAAEA6gIAAAAAAQFLyGFJFK884DGBM1WgskRZ6gKp/7oZ+Z30u0+wF3pZYAEAAAAA/v///wKghgEAAAAAACIAINHcOQLE6GpJ3J+FOzn/be+HApxW8sZtGqfA3TBW+NYX91hoOAAAAAAWABTPQDZx2wYYIn+ug2pZBmWBn0Tu/gJHMEQCIHu6GmRMDgPZyTx+klFMA9VujR3qDA/Y08kSkRvOaChjAiBAtExtGAYLuQ/DDJzCqLlNZ1bMB3MV+nxsLfTdI9YcYwEhA0b8lz+kt0xHfR/tjUKOc2Nt2L61pDd5vJ/lsKi8pw9MmFUjAAEBK6CGAQAAAAAAIgAg0dw5AsToakncn4U7Of9t74cCnFbyxm0ap8DdMFb41hciAgIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDUgwRQIhAJdILr7G3UzYylyr2fA13MFsz/jG4+iZlKeEkX79d082AiA99UF0/uFyXBVNUmuGaxdHL7wlhzqfbgGLMREN0z/O6QEBBWlSIQIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDSEDzsDXexRPSxeXiLJoS0i2fQlOoOGHmo+Dhaeaq3oHV6YhAjGKA2Dqg+QeMICBAifYslQF2WrehLEQ0iEOpp/+eQ0NU64iBgIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDRh83y1GVAAAgAEAAIAAAACAAAAAAAAAAAAiBgIxigNg6oPkHjCAgQIn2LJUBdlq3oSxENIhDqaf/nkNDRgmsDMzVAAAgAEAAIAAAACAAAAAAAAAAAAiBgPOwNd7FE9LF5eIsmhLSLZ9CU6g4Yeaj4OFp5qregdXphj8eHDNVAAAgAEAAIAAAACAAAAAAAAAAAAAAA=="\n}\n')])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/0w4sK5y.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"2nd-wallet-signs-the-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#2nd-wallet-signs-the-transaction"}},[t._v("#")]),t._v(" 2nd Wallet Signs the transaction")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd01 --descriptor $MULTI_DESCRIPTOR_01 sign --psbt $ONESIG_PSBT")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export SECONDSIG_PSBT=$(bdk-cli wallet --wallet wallet_name_msd01 --descriptor $MULTI_DESCRIPTOR_01 sign --psbt $ONESIG_PSBT | jq -r '.psbt')")])]),t._v(" "),e("p",[t._v("▶️"),e("code",[t._v("env | grep SECONDSIG")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "is_finalized": true,\n "psbt": "cHNidP8BAFUBAAAAAdYCtva/7Rkt+fgFu3mxAdaPh4uTbgBL3HmYZgcEKWygAAAAAAD/////AQqGAQAAAAAAGXapFDRKD0jKFQ7CuQOBdmC5tosTpnAmiKwAAAAAAAEA6gIAAAAAAQFLyGFJFK884DGBM1WgskRZ6gKp/7oZ+Z30u0+wF3pZYAEAAAAA/v///wKghgEAAAAAACIAINHcOQLE6GpJ3J+FOzn/be+HApxW8sZtGqfA3TBW+NYX91hoOAAAAAAWABTPQDZx2wYYIn+ug2pZBmWBn0Tu/gJHMEQCIHu6GmRMDgPZyTx+klFMA9VujR3qDA/Y08kSkRvOaChjAiBAtExtGAYLuQ/DDJzCqLlNZ1bMB3MV+nxsLfTdI9YcYwEhA0b8lz+kt0xHfR/tjUKOc2Nt2L61pDd5vJ/lsKi8pw9MmFUjAAEBK6CGAQAAAAAAIgAg0dw5AsToakncn4U7Of9t74cCnFbyxm0ap8DdMFb41hciAgIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDUgwRQIhAJdILr7G3UzYylyr2fA13MFsz/jG4+iZlKeEkX79d082AiA99UF0/uFyXBVNUmuGaxdHL7wlhzqfbgGLMREN0z/O6QEiAgPOwNd7FE9LF5eIsmhLSLZ9CU6g4Yeaj4OFp5qregdXpkgwRQIhAO2aRERcublhAzToshkZRMg2I8GaE7mM2ECr0vYyuscmAiB5KK4ETlvrLqL0QbcRbGqrSwIa9lVuOqP3f5qCnGRMaQEBBWlSIQIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDSEDzsDXexRPSxeXiLJoS0i2fQlOoOGHmo+Dhaeaq3oHV6YhAjGKA2Dqg+QeMICBAifYslQF2WrehLEQ0iEOpp/+eQ0NU64iBgIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDRh83y1GVAAAgAEAAIAAAACAAAAAAAAAAAAiBgIxigNg6oPkHjCAgQIn2LJUBdlq3oSxENIhDqaf/nkNDRgmsDMzVAAAgAEAAIAAAACAAAAAAAAAAAAiBgPOwNd7FE9LF5eIsmhLSLZ9CU6g4Yeaj4OFp5qregdXphj8eHDNVAAAgAEAAIAAAACAAAAAAAAAAAABBwABCP3+AAQASDBFAiEAl0guvsbdTNjKXKvZ8DXcwWzP+Mbj6JmUp4SRfv13TzYCID31QXT+4XJcFU1Sa4ZrF0cvvCWHOp9uAYsxEQ3TP87pAUgwRQIhAO2aRERcublhAzToshkZRMg2I8GaE7mM2ECr0vYyuscmAiB5KK4ETlvrLqL0QbcRbGqrSwIa9lVuOqP3f5qCnGRMaQFpUiECI1AiHZ8q+qw7bjYVTbeGQQ3L2C2sH6CW82z8sXP1jQ0hA87A13sUT0sXl4iyaEtItn0JTqDhh5qPg4Wnmqt6B1emIQIxigNg6oPkHjCAgQIn2LJUBdlq3oSxENIhDqaf/nkNDVOuAAA="\n}\n')])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/OdLHnJ3.gif",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-12-broadcast-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-12-broadcast-transaction"}},[t._v("#")]),t._v(" Step 12: Broadcast Transaction")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd01 --descriptor $MULTI_DESCRIPTOR_01 broadcast --psbt $SECONDSIG_PSBT")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "txid": "61da2451874a483aa8d1d0787c7680d157639f284840de8885098cac43f6cc2f"\n}\n')])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/M7s0Fd6.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"verify-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#verify-transaction"}},[t._v("#")]),t._v(" Verify Transaction")]),t._v(" "),e("p",[t._v("Verify transcation in the memory pool on testnet "),e("a",{attrs:{href:"https://mempool.space/testnet",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mempool-testnet!"),e("OutboundLink")],1)])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/41.ae79f963.js b/assets/js/41.0fe241e3.js similarity index 99% rename from assets/js/41.ae79f963.js rename to assets/js/41.0fe241e3.js index f337e32136..8a49f375ce 100644 --- a/assets/js/41.ae79f963.js +++ b/assets/js/41.0fe241e3.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{385:function(t,e,a){"use strict";a.r(e);var s=a(7),n=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h2",{attrs:{id:"tutorial-goals"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tutorial-goals"}},[t._v("#")]),t._v(" Tutorial Goals")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The goal for this tutorial is to introduce you to "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-cli"),e("OutboundLink")],1),t._v(", a powerful command-line program. You will be exposed to many of the basic skills that go into creating and managing bitcoin wallets.")])]),t._v(" "),e("li",[e("p",[t._v("If you've read most of the "),e("a",{attrs:{href:"https://github.com/bitcoinbook/bitcoinbook",target:"_blank",rel:"noopener noreferrer"}},[t._v('"Mastering Bitcoin"'),e("OutboundLink")],1),t._v(" book, this tutorial could serve as a stepping stone into your Bitcoin wallet development journey.")])]),t._v(" "),e("li",[e("p",[t._v("This short tutorial will expose you to the "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("bdk library")]),t._v(" "),e("OutboundLink")],1),t._v(" and the practical knowledge needed for bitcoin wallet development. As a consequence you will deepen your technical understanding about bitcoin and the bdk library.")])]),t._v(" "),e("li",[e("p",[t._v("BDK also has "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi",target:"_blank",rel:"noopener noreferrer"}},[t._v("language-bindings"),e("OutboundLink")],1),t._v(" for "),e("strong",[t._v("Kotlin/Java, Swift, Python")]),t._v(" which enable the use of BDK's "),e("strong",[t._v("Rust")]),t._v(" library as an API. You can later use these similar steps to create your own bitcoin mobile, desktop or even WebApp by using the bdk-ffi language bindings.")])])]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"a-few-things-before-you-begin"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#a-few-things-before-you-begin"}},[t._v("#")]),t._v(" A few things before you begin:")]),t._v(" "),e("ul",[e("li",[t._v("Three things to look out for in each step of the tutorial:\n"),e("ul",[e("li",[e("ol",[e("li",[t._v("▶️ / 🔶 - Commands for the Terminal or Shell")])])]),t._v(" "),e("li",[e("ol",{attrs:{start:"2"}},[e("li",[t._v("👍 - Preview of the command output. Note, not all commands will output code.")])])]),t._v(" "),e("li",[e("ol",{attrs:{start:"3"}},[e("li",[t._v("Preview Video of the tutorial for reference of what things should look like in action.")])])])])])]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"outline-of-tutorial-and-installation-notes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#outline-of-tutorial-and-installation-notes"}},[t._v("#")]),t._v(" Outline of Tutorial and Installation notes:")]),t._v(" "),e("h3",{attrs:{id:"brief-outline-of-tutorial"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#brief-outline-of-tutorial"}},[t._v("#")]),t._v(" Brief Outline of Tutorial")]),t._v(" "),e("ul",[e("li",[t._v("Step 1: Creating a mnemonic word list + XPRV (Extended Private Key)")]),t._v(" "),e("li",[t._v("Step 2: Generate testnet Receive Address")]),t._v(" "),e("li",[t._v("Step 3: Send funds to newly generated address")]),t._v(" "),e("li",[t._v("Step 4: Sync Wallet")]),t._v(" "),e("li",[t._v("Step 5: Check Balance of Wallet")]),t._v(" "),e("li",[t._v("Step 6: Create a Transaction (PSBT)")]),t._v(" "),e("li",[t._v("Step 7: Sign the Transaction (PSBT)")]),t._v(" "),e("li",[t._v("Step 8: Broadcast Transaction")])]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"rust-and-cargo-installation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#rust-and-cargo-installation"}},[t._v("#")]),t._v(" Rust and Cargo installation:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://rustup.rs/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Rust and Cargo Installation"),e("OutboundLink")],1)])]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"bdk-cli-installation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bdk-cli-installation"}},[t._v("#")]),t._v(" "),e("code",[t._v("bdk-cli")]),t._v(" installation:")]),t._v(" "),e("ul",[e("li",[t._v("Download the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli.git",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("bdk-cli")]),t._v(" github repository locally"),e("OutboundLink")],1),t._v(" "),e("ul",[e("li",[t._v("Enter the folder "),e("code",[t._v("cd bdk-cli")])]),t._v(" "),e("li",[t._v("Install "),e("code",[t._v("cargo install --path . --features electrum,repl,compiler")])]),t._v(" "),e("li",[t._v("Once installation is done exit and reopen your terminal (command-line interface)")])])])]),t._v(" "),e("h3",{attrs:{id:"emoji-legend"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#emoji-legend"}},[t._v("#")]),t._v(" Emoji Legend:")]),t._v(" "),e("p",[t._v("▶️ : Unix/Linux Commands to copied and pasted\n🔶 : Windows Powershell Commands to copied and pasted\n👍 : Output/ preview of code")]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-0-check-version-of-bdk-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-0-check-version-of-bdk-cli"}},[t._v("#")]),t._v(" Step 0: Check Version of bdk-cli")]),t._v(" "),e("p",[t._v("▶️ / 🔶 "),e("code",[t._v("bdk-cli -V")]),t._v("\n👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("bdk-cli 0.6.0\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/IcuyeMS.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"preview-of-bdk-cli-help-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#preview-of-bdk-cli-help-menu"}},[t._v("#")]),t._v(" Preview of bdk-cli help menu")]),t._v(" "),e("p",[t._v("▶️ / 🔶 "),e("code",[t._v("bdk-cli --help")]),e("br"),t._v("\n👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[t._v("The BDK Command Line Wallet App\n\nbdk-cli is a light weight "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("command")]),t._v(" line bitcoin wallet, powered by BDK. This app can be used as a playground as well as\ntesting environment to simulate various wallet testing situations. If you are planning to use BDK "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" your wallet, bdk-\ncli is also a great intro tool to get familiar with the BDK API.\n\nBut this is not just any toy. bdk-cli is also a fully functioning bitcoin wallet with taproot support"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("\n\nFor "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("more")]),t._v(" information checkout "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("https://bitcoindevkit.org/"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\nUSAGE:\n bdk-cli "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("OPTIONS"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("SUBCOMMAND"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\nFLAGS:\n -h, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--help")]),t._v(" Prints "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("help")]),t._v(" information\n -V, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--version")]),t._v(" Prints version information\n\nOPTIONS:\n -d, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--datadir")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("DATADIR"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" Sets the wallet data directory. Default value "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(' "~/.bdk-bitcoin\n -n, '),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--network")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("NETWORK"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" Sets the network "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("default: testnet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("possible values: bitcoin, testnet, signet, regtest"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\nSUBCOMMANDS:\n compile Compile a miniscript policy to an output descriptor\n "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("help")]),t._v(" Prints this message or the "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("help")]),t._v(" of the given subcommand"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n key Subcommands "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" Key operations\n repl Options to configure a SOCKS5 proxy "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" a blockchain client connection\n wallet Wallet subcommands that can be issued without a blockchain backend\n")])])]),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-1-seed-generate"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-1-seed-generate"}},[t._v("#")]),t._v(" Step 1: Seed Generate")]),t._v(" "),e("h3",{attrs:{id:"1a-mnemonic-word-list-xprv-extended-private-key-"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1a-mnemonic-word-list-xprv-extended-private-key-"}},[t._v("#")]),t._v(" 1a: Mnemonic word-list + XPRV (Extended Private Key) 🔑")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli key generate | tee key.json")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v('bdk-cli key generate | Out-File -FilePath "key.json"')])]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fingerprint"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"42b15d2f"')]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mnemonic"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"party salon worth satoshi envelope suggest garlic dry add pitch throw clap keen narrow antique oyster ketchup purchase gasp visual work venue fog crater"')]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xprv"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tprv8ZgxMBicQKsPdwpamtjqMFpYRTafnE1bN2SphLEybCtRKakk6S1TgQCsZgiBwJuJNWe3jYdgVCTsKf9weMxj6tW4zNNKWptykszJpS2L8wE"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/ii62Hul.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1b-save-xprv-extended-private-key-into-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1b-save-xprv-extended-private-key-into-environment-variable"}},[t._v("#")]),t._v(" 1b: Save XPRV (Extended Private Key) into environment variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("export XPRV_00=$(cat key.json | jq -r .xprv)")])]),t._v(" "),e("p",[t._v("Windows Powershell:")]),t._v(" "),e("p",[t._v("🔶 "),e("code",[t._v("$json = Get-Content -Path .\\key.json | ConvertFrom-Json")])]),t._v(" "),e("p",[t._v("🔶 "),e("code",[t._v("$mykeyValue = $json.xprv")])]),t._v(" "),e("p",[t._v("🔶 "),e("code",[t._v("[System.Environment]::SetEnvironmentVariable('XPRV',$mykeyValue, 'Process')")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/KYW2Cdo.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1c-verify-environment-variable-xprv-00-is-active"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1c-verify-environment-variable-xprv-00-is-active"}},[t._v("#")]),t._v(" 1c: Verify environment variable XPRV_00 is active")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("env | grep XPRV")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("$env:XPRV")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/ZahbJwe.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1d-create-descriptor-and-save-into-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1d-create-descriptor-and-save-into-environment-variable"}},[t._v("#")]),t._v(" 1d: Create Descriptor and Save into environment variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v('export my_descriptor="wpkh($XPRV_00/84h/1h/0h/0/*)"')])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("[System.Environment]::SetEnvironmentVariable('my_descriptor', \"wpkh($env:XPRV/84h/1h/0h/0/*)\", 'Process')")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/UV4Vgsq.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1e-verify-environment-variable-my-descriptor-is-active"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1e-verify-environment-variable-my-descriptor-is-active"}},[t._v("#")]),t._v(" 1e: Verify environment variable my_descriptor is active")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("env | grep my_descriptor")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("$env:my_descriptor")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/s7ZeRQN.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-2-generate-receive-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-2-generate-receive-address"}},[t._v("#")]),t._v(" Step 2: Generate Receive-Address")]),t._v(" "),e("p",[t._v("Linux/Terminal:")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor get_new_address")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor get_new_address")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/P8PjTAo.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"address"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tb1qrh4sq5va0unqtxyfv8al9lz3sna3988cj59uya"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-3-send-testnet-bitcoin-to-the-newly-created-receive-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-3-send-testnet-bitcoin-to-the-newly-created-receive-address"}},[t._v("#")]),t._v(" Step 3: Send testnet bitcoin to the newly created receive-address")]),t._v(" "),e("p",[t._v("Use a faucet to send funds to your newly created address. Here is a link to one: "),e("a",{attrs:{href:"https://bitcoinfaucet.uo1.net",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Testnet Faucet"),e("OutboundLink")],1)]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-4-sync-the-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-4-sync-the-wallet"}},[t._v("#")]),t._v(" Step 4: Sync the wallet")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor sync")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor sync")])]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/WFYBgVB.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-5-check-the-balance"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-5-check-the-balance"}},[t._v("#")]),t._v(" Step 5: Check the balance")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor get_balance")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor get_balance")])]),t._v(" "),e("div",{staticClass:"custom-block tip"},[e("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),e("p",[t._v("Note: The balance will only show after the transaction has been confirmed in a block at least once.")])]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful:")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"satoshi"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirmed"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"immature"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"trusted_pending"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"untrusted_pending"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/v8MAYB2.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-6-create-transaction-psbt"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-6-create-transaction-psbt"}},[t._v("#")]),t._v(" Step 6: Create Transaction (PSBT)")]),t._v(" "),e("p",[t._v("To create a PSBT (partially-signed-bitcoin-transaction) run the command:")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor create_tx --to tb1qw2c3lxufxqe2x9s4rdzh65tpf4d7fssjgh8nv6:50000")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor create_tx --to tb1qjk6n943uwhqhdf7en600tnwxpslvwtr0udsehp:0 --send_all")]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/EUCovcJ.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"details"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirmation_time"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" null,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fee"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("113")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"received"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sent"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("123000")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transaction"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" null,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txid"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"029173d76253e3441f9dc26f91e6ef30dff486848e91a7941f0cacd0af25ee30"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"psbt"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cHNidP8BAFUBAAAAAak8uMR3UGkAGUKWsq8Mv45qg2fdD93JQRIsa2P0wFloAQAAAAD/////AQfgAQAAAAAAGXapFDRKD0jKFQ7CuQOBdmC5tosTpnAmiKwAAAAAAAEA3gIAAAAAAQFY9sVfEEbyjrHXSlxXDxL+71WOMnsPpVElwk+3E/J9vAAAAAAA/v///wIYZRIAAAAAABYAFBKYf7yF+ss6EFdw2rDZTfdLhep8eOABAAAAAAAWABQd6wBRnX8mBZiJYfvy/FGE+xKc+AJHMEQCIFSIkvEUI9yUgEw4JocRs1aiVsBlKKXrOQaQb3XFqR21AiBqiEVzCVVSRGjckyPDgAQBnOdSzBYR6Rw6KFcCP+E27wEhAwIlXdfM2WYnYa36Hp4MS6YkplBAgBsb1tYG9NiWFWTKzPYhAAEBH3jgAQAAAAAAFgAUHesAUZ1/JgWYiWH78vxRhPsSnPgiBgP80FpaWYQzGzCnNI9blXbei61YpAmtoezMRxpVvBJ6SxgTizKsVAAAgAEAAIAAAACAAAAAAAAAAAAAAA=="')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h3",{attrs:{id:"6a-export-psbt-to-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#6a-export-psbt-to-environment-variable"}},[t._v("#")]),t._v(" 6a: export PSBT to environment-variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v('export PSBT="PASTE_PSBT_HERE"')])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶"),e("code",[t._v("[System.Environment]::SetEnvironmentVariable('PSBT',\"PASTE_PSBT_HERE\",'Process')")]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/CEDKcPZ.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-7-sign-transaction-psbt"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-7-sign-transaction-psbt"}},[t._v("#")]),t._v(" Step 7: Sign Transaction (PSBT)")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor sign --psbt $PSBT")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor sign --psbt $env:PSBT")])]),t._v(" "),e("ul",[e("li",[t._v("DON'T FORGET to COPY the PSBT for the next step")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/f4o4Ce8.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"is_finalized"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" true,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"psbt"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cHNidP8BAFUBAAAAAak8uMR3UGkAGUKWsq8Mv45qg2fdD93JQRIsa2P0wFloAQAAAAD/////AQfgAQAAAAAAGXapFDRKD0jKFQ7CuQOBdmC5tosTpnAmiKwAAAAAAAEA3gIAAAAAAQFY9sVfEEbyjrHXSlxXDxL+71WOMnsPpVElwk+3E/J9vAAAAAAA/v///wIYZRIAAAAAABYAFBKYf7yF+ss6EFdw2rDZTfdLhep8eOABAAAAAAAWABQd6wBRnX8mBZiJYfvy/FGE+xKc+AJHMEQCIFSIkvEUI9yUgEw4JocRs1aiVsBlKKXrOQaQb3XFqR21AiBqiEVzCVVSRGjckyPDgAQBnOdSzBYR6Rw6KFcCP+E27wEhAwIlXdfM2WYnYa36Hp4MS6YkplBAgBsb1tYG9NiWFWTKzPYhAAEBH3jgAQAAAAAAFgAUHesAUZ1/JgWYiWH78vxRhPsSnPgiAgP80FpaWYQzGzCnNI9blXbei61YpAmtoezMRxpVvBJ6S0gwRQIhALWkBRSJzxuf0od4tPu3qFmEfJ2Y+/QBGtfjSFObWsPeAiA4QJx8Rk5pacrjHv5EOdw6RNHXcdtepFs+m0/Za/h0UQEiBgP80FpaWYQzGzCnNI9blXbei61YpAmtoezMRxpVvBJ6SxgTizKsVAAAgAEAAIAAAACAAAAAAAAAAAABBwABCGwCSDBFAiEAtaQFFInPG5/Sh3i0+7eoWYR8nZj79AEa1+NIU5taw94CIDhAnHxGTmlpyuMe/kQ53DpE0ddx216kWz6bT9lr+HRRASED/NBaWlmEMxswpzSPW5V23outWKQJraHszEcaVbwSeksAAA=="')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h3",{attrs:{id:"7a-export-signed-psbt-to-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#7a-export-signed-psbt-to-environment-variable"}},[t._v("#")]),t._v(" 7a: export signed psbt to environment variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v('export SIGNED_PSBT="Paste_PSBT_HERE"')])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v('$env:PSBTSIGNED = "STRINGHERE"')]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/VJsl8zR.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-8-broadcast-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-8-broadcast-transaction"}},[t._v("#")]),t._v(" Step 8: Broadcast Transaction")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor broadcast --psbt $SIGNED_PSBT")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor broadcast --psbt $env:PSBTSIGNED")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/yQZZk0d.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txid"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a0877b7ce91ea6d141ba63277673f5bdf0edfdd45f91a39ba1a1ace15f839b52"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("Verify transaction in the memory pool on testnet "),e("a",{attrs:{href:"https://mempool.space/testnet",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mempool-testnet!"),e("OutboundLink")],1)])]),t._v(" "),e("div",{staticClass:"custom-block tip"},[e("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),e("p",[t._v("Run sync one more time and see that the balance has decreased.")])]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"resources"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#resources"}},[t._v("#")]),t._v(" Resources")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP-32: Hierarchical Deterministic Wallets"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 39 - Mnemonic code for generating deterministic keys"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 44 - Multi-Account Hierarchy for Deterministic Wallets"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 84 - Derivation scheme for P2WPKH based accounts"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 174 - Partially Signed Bitcoin Transaction Format"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://blog.summerofbitcoin.org/miniscript-policy-descriptors-hidden-powers-of-bitcoin/",target:"_blank",rel:"noopener noreferrer"}},[t._v("What are Descriptors and miniscript?"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://bitcoin.stackexchange.com/questions/97242/bip39-tool-bip32-extended-private-key-vs-bip32-root-key",target:"_blank",rel:"noopener noreferrer"}},[t._v("Master Private Key and Extended Private Key"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://min.sc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Minsc A Miniscript-based scripting language for Bitcoin contracts"),e("OutboundLink")],1)])])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{387:function(t,e,a){"use strict";a.r(e);var s=a(7),n=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h2",{attrs:{id:"tutorial-goals"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tutorial-goals"}},[t._v("#")]),t._v(" Tutorial Goals")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The goal for this tutorial is to introduce you to "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-cli"),e("OutboundLink")],1),t._v(", a powerful command-line program. You will be exposed to many of the basic skills that go into creating and managing bitcoin wallets.")])]),t._v(" "),e("li",[e("p",[t._v("If you've read most of the "),e("a",{attrs:{href:"https://github.com/bitcoinbook/bitcoinbook",target:"_blank",rel:"noopener noreferrer"}},[t._v('"Mastering Bitcoin"'),e("OutboundLink")],1),t._v(" book, this tutorial could serve as a stepping stone into your Bitcoin wallet development journey.")])]),t._v(" "),e("li",[e("p",[t._v("This short tutorial will expose you to the "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("bdk library")]),t._v(" "),e("OutboundLink")],1),t._v(" and the practical knowledge needed for bitcoin wallet development. As a consequence you will deepen your technical understanding about bitcoin and the bdk library.")])]),t._v(" "),e("li",[e("p",[t._v("BDK also has "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi",target:"_blank",rel:"noopener noreferrer"}},[t._v("language-bindings"),e("OutboundLink")],1),t._v(" for "),e("strong",[t._v("Kotlin/Java, Swift, Python")]),t._v(" which enable the use of BDK's "),e("strong",[t._v("Rust")]),t._v(" library as an API. You can later use these similar steps to create your own bitcoin mobile, desktop or even WebApp by using the bdk-ffi language bindings.")])])]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"a-few-things-before-you-begin"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#a-few-things-before-you-begin"}},[t._v("#")]),t._v(" A few things before you begin:")]),t._v(" "),e("ul",[e("li",[t._v("Three things to look out for in each step of the tutorial:\n"),e("ul",[e("li",[e("ol",[e("li",[t._v("▶️ / 🔶 - Commands for the Terminal or Shell")])])]),t._v(" "),e("li",[e("ol",{attrs:{start:"2"}},[e("li",[t._v("👍 - Preview of the command output. Note, not all commands will output code.")])])]),t._v(" "),e("li",[e("ol",{attrs:{start:"3"}},[e("li",[t._v("Preview Video of the tutorial for reference of what things should look like in action.")])])])])])]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"outline-of-tutorial-and-installation-notes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#outline-of-tutorial-and-installation-notes"}},[t._v("#")]),t._v(" Outline of Tutorial and Installation notes:")]),t._v(" "),e("h3",{attrs:{id:"brief-outline-of-tutorial"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#brief-outline-of-tutorial"}},[t._v("#")]),t._v(" Brief Outline of Tutorial")]),t._v(" "),e("ul",[e("li",[t._v("Step 1: Creating a mnemonic word list + XPRV (Extended Private Key)")]),t._v(" "),e("li",[t._v("Step 2: Generate testnet Receive Address")]),t._v(" "),e("li",[t._v("Step 3: Send funds to newly generated address")]),t._v(" "),e("li",[t._v("Step 4: Sync Wallet")]),t._v(" "),e("li",[t._v("Step 5: Check Balance of Wallet")]),t._v(" "),e("li",[t._v("Step 6: Create a Transaction (PSBT)")]),t._v(" "),e("li",[t._v("Step 7: Sign the Transaction (PSBT)")]),t._v(" "),e("li",[t._v("Step 8: Broadcast Transaction")])]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"rust-and-cargo-installation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#rust-and-cargo-installation"}},[t._v("#")]),t._v(" Rust and Cargo installation:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://rustup.rs/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Rust and Cargo Installation"),e("OutboundLink")],1)])]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"bdk-cli-installation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bdk-cli-installation"}},[t._v("#")]),t._v(" "),e("code",[t._v("bdk-cli")]),t._v(" installation:")]),t._v(" "),e("ul",[e("li",[t._v("Download the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli.git",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("bdk-cli")]),t._v(" github repository locally"),e("OutboundLink")],1),t._v(" "),e("ul",[e("li",[t._v("Enter the folder "),e("code",[t._v("cd bdk-cli")])]),t._v(" "),e("li",[t._v("Install "),e("code",[t._v("cargo install --path . --features electrum,repl,compiler")])]),t._v(" "),e("li",[t._v("Once installation is done exit and reopen your terminal (command-line interface)")])])])]),t._v(" "),e("h3",{attrs:{id:"emoji-legend"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#emoji-legend"}},[t._v("#")]),t._v(" Emoji Legend:")]),t._v(" "),e("p",[t._v("▶️ : Unix/Linux Commands to copied and pasted\n🔶 : Windows Powershell Commands to copied and pasted\n👍 : Output/ preview of code")]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-0-check-version-of-bdk-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-0-check-version-of-bdk-cli"}},[t._v("#")]),t._v(" Step 0: Check Version of bdk-cli")]),t._v(" "),e("p",[t._v("▶️ / 🔶 "),e("code",[t._v("bdk-cli -V")]),t._v("\n👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("bdk-cli 0.6.0\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/IcuyeMS.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"preview-of-bdk-cli-help-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#preview-of-bdk-cli-help-menu"}},[t._v("#")]),t._v(" Preview of bdk-cli help menu")]),t._v(" "),e("p",[t._v("▶️ / 🔶 "),e("code",[t._v("bdk-cli --help")]),e("br"),t._v("\n👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[t._v("The BDK Command Line Wallet App\n\nbdk-cli is a light weight "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("command")]),t._v(" line bitcoin wallet, powered by BDK. This app can be used as a playground as well as\ntesting environment to simulate various wallet testing situations. If you are planning to use BDK "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" your wallet, bdk-\ncli is also a great intro tool to get familiar with the BDK API.\n\nBut this is not just any toy. bdk-cli is also a fully functioning bitcoin wallet with taproot support"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("\n\nFor "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("more")]),t._v(" information checkout "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("https://bitcoindevkit.org/"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\nUSAGE:\n bdk-cli "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("OPTIONS"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("SUBCOMMAND"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\nFLAGS:\n -h, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--help")]),t._v(" Prints "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("help")]),t._v(" information\n -V, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--version")]),t._v(" Prints version information\n\nOPTIONS:\n -d, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--datadir")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("DATADIR"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" Sets the wallet data directory. Default value "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(' "~/.bdk-bitcoin\n -n, '),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--network")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("NETWORK"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" Sets the network "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("default: testnet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("possible values: bitcoin, testnet, signet, regtest"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\nSUBCOMMANDS:\n compile Compile a miniscript policy to an output descriptor\n "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("help")]),t._v(" Prints this message or the "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("help")]),t._v(" of the given subcommand"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n key Subcommands "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" Key operations\n repl Options to configure a SOCKS5 proxy "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" a blockchain client connection\n wallet Wallet subcommands that can be issued without a blockchain backend\n")])])]),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-1-seed-generate"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-1-seed-generate"}},[t._v("#")]),t._v(" Step 1: Seed Generate")]),t._v(" "),e("h3",{attrs:{id:"1a-mnemonic-word-list-xprv-extended-private-key-"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1a-mnemonic-word-list-xprv-extended-private-key-"}},[t._v("#")]),t._v(" 1a: Mnemonic word-list + XPRV (Extended Private Key) 🔑")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli key generate | tee key.json")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v('bdk-cli key generate | Out-File -FilePath "key.json"')])]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fingerprint"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"42b15d2f"')]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mnemonic"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"party salon worth satoshi envelope suggest garlic dry add pitch throw clap keen narrow antique oyster ketchup purchase gasp visual work venue fog crater"')]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xprv"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tprv8ZgxMBicQKsPdwpamtjqMFpYRTafnE1bN2SphLEybCtRKakk6S1TgQCsZgiBwJuJNWe3jYdgVCTsKf9weMxj6tW4zNNKWptykszJpS2L8wE"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/ii62Hul.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1b-save-xprv-extended-private-key-into-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1b-save-xprv-extended-private-key-into-environment-variable"}},[t._v("#")]),t._v(" 1b: Save XPRV (Extended Private Key) into environment variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("export XPRV_00=$(cat key.json | jq -r .xprv)")])]),t._v(" "),e("p",[t._v("Windows Powershell:")]),t._v(" "),e("p",[t._v("🔶 "),e("code",[t._v("$json = Get-Content -Path .\\key.json | ConvertFrom-Json")])]),t._v(" "),e("p",[t._v("🔶 "),e("code",[t._v("$mykeyValue = $json.xprv")])]),t._v(" "),e("p",[t._v("🔶 "),e("code",[t._v("[System.Environment]::SetEnvironmentVariable('XPRV',$mykeyValue, 'Process')")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/KYW2Cdo.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1c-verify-environment-variable-xprv-00-is-active"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1c-verify-environment-variable-xprv-00-is-active"}},[t._v("#")]),t._v(" 1c: Verify environment variable XPRV_00 is active")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("env | grep XPRV")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("$env:XPRV")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/ZahbJwe.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1d-create-descriptor-and-save-into-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1d-create-descriptor-and-save-into-environment-variable"}},[t._v("#")]),t._v(" 1d: Create Descriptor and Save into environment variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v('export my_descriptor="wpkh($XPRV_00/84h/1h/0h/0/*)"')])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("[System.Environment]::SetEnvironmentVariable('my_descriptor', \"wpkh($env:XPRV/84h/1h/0h/0/*)\", 'Process')")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/UV4Vgsq.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1e-verify-environment-variable-my-descriptor-is-active"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1e-verify-environment-variable-my-descriptor-is-active"}},[t._v("#")]),t._v(" 1e: Verify environment variable my_descriptor is active")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("env | grep my_descriptor")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("$env:my_descriptor")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/s7ZeRQN.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-2-generate-receive-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-2-generate-receive-address"}},[t._v("#")]),t._v(" Step 2: Generate Receive-Address")]),t._v(" "),e("p",[t._v("Linux/Terminal:")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor get_new_address")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor get_new_address")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/P8PjTAo.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"address"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tb1qrh4sq5va0unqtxyfv8al9lz3sna3988cj59uya"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-3-send-testnet-bitcoin-to-the-newly-created-receive-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-3-send-testnet-bitcoin-to-the-newly-created-receive-address"}},[t._v("#")]),t._v(" Step 3: Send testnet bitcoin to the newly created receive-address")]),t._v(" "),e("p",[t._v("Use a faucet to send funds to your newly created address. Here is a link to one: "),e("a",{attrs:{href:"https://bitcoinfaucet.uo1.net",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Testnet Faucet"),e("OutboundLink")],1)]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-4-sync-the-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-4-sync-the-wallet"}},[t._v("#")]),t._v(" Step 4: Sync the wallet")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor sync")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor sync")])]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/WFYBgVB.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-5-check-the-balance"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-5-check-the-balance"}},[t._v("#")]),t._v(" Step 5: Check the balance")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor get_balance")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor get_balance")])]),t._v(" "),e("div",{staticClass:"custom-block tip"},[e("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),e("p",[t._v("Note: The balance will only show after the transaction has been confirmed in a block at least once.")])]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful:")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"satoshi"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirmed"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"immature"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"trusted_pending"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"untrusted_pending"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/v8MAYB2.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-6-create-transaction-psbt"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-6-create-transaction-psbt"}},[t._v("#")]),t._v(" Step 6: Create Transaction (PSBT)")]),t._v(" "),e("p",[t._v("To create a PSBT (partially-signed-bitcoin-transaction) run the command:")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor create_tx --to tb1qw2c3lxufxqe2x9s4rdzh65tpf4d7fssjgh8nv6:50000")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor create_tx --to tb1qjk6n943uwhqhdf7en600tnwxpslvwtr0udsehp:0 --send_all")]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/EUCovcJ.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"details"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirmation_time"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" null,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fee"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("113")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"received"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sent"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("123000")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transaction"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" null,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txid"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"029173d76253e3441f9dc26f91e6ef30dff486848e91a7941f0cacd0af25ee30"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"psbt"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cHNidP8BAFUBAAAAAak8uMR3UGkAGUKWsq8Mv45qg2fdD93JQRIsa2P0wFloAQAAAAD/////AQfgAQAAAAAAGXapFDRKD0jKFQ7CuQOBdmC5tosTpnAmiKwAAAAAAAEA3gIAAAAAAQFY9sVfEEbyjrHXSlxXDxL+71WOMnsPpVElwk+3E/J9vAAAAAAA/v///wIYZRIAAAAAABYAFBKYf7yF+ss6EFdw2rDZTfdLhep8eOABAAAAAAAWABQd6wBRnX8mBZiJYfvy/FGE+xKc+AJHMEQCIFSIkvEUI9yUgEw4JocRs1aiVsBlKKXrOQaQb3XFqR21AiBqiEVzCVVSRGjckyPDgAQBnOdSzBYR6Rw6KFcCP+E27wEhAwIlXdfM2WYnYa36Hp4MS6YkplBAgBsb1tYG9NiWFWTKzPYhAAEBH3jgAQAAAAAAFgAUHesAUZ1/JgWYiWH78vxRhPsSnPgiBgP80FpaWYQzGzCnNI9blXbei61YpAmtoezMRxpVvBJ6SxgTizKsVAAAgAEAAIAAAACAAAAAAAAAAAAAAA=="')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h3",{attrs:{id:"6a-export-psbt-to-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#6a-export-psbt-to-environment-variable"}},[t._v("#")]),t._v(" 6a: export PSBT to environment-variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v('export PSBT="PASTE_PSBT_HERE"')])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶"),e("code",[t._v("[System.Environment]::SetEnvironmentVariable('PSBT',\"PASTE_PSBT_HERE\",'Process')")]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/CEDKcPZ.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-7-sign-transaction-psbt"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-7-sign-transaction-psbt"}},[t._v("#")]),t._v(" Step 7: Sign Transaction (PSBT)")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor sign --psbt $PSBT")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor sign --psbt $env:PSBT")])]),t._v(" "),e("ul",[e("li",[t._v("DON'T FORGET to COPY the PSBT for the next step")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/f4o4Ce8.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"is_finalized"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" true,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"psbt"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cHNidP8BAFUBAAAAAak8uMR3UGkAGUKWsq8Mv45qg2fdD93JQRIsa2P0wFloAQAAAAD/////AQfgAQAAAAAAGXapFDRKD0jKFQ7CuQOBdmC5tosTpnAmiKwAAAAAAAEA3gIAAAAAAQFY9sVfEEbyjrHXSlxXDxL+71WOMnsPpVElwk+3E/J9vAAAAAAA/v///wIYZRIAAAAAABYAFBKYf7yF+ss6EFdw2rDZTfdLhep8eOABAAAAAAAWABQd6wBRnX8mBZiJYfvy/FGE+xKc+AJHMEQCIFSIkvEUI9yUgEw4JocRs1aiVsBlKKXrOQaQb3XFqR21AiBqiEVzCVVSRGjckyPDgAQBnOdSzBYR6Rw6KFcCP+E27wEhAwIlXdfM2WYnYa36Hp4MS6YkplBAgBsb1tYG9NiWFWTKzPYhAAEBH3jgAQAAAAAAFgAUHesAUZ1/JgWYiWH78vxRhPsSnPgiAgP80FpaWYQzGzCnNI9blXbei61YpAmtoezMRxpVvBJ6S0gwRQIhALWkBRSJzxuf0od4tPu3qFmEfJ2Y+/QBGtfjSFObWsPeAiA4QJx8Rk5pacrjHv5EOdw6RNHXcdtepFs+m0/Za/h0UQEiBgP80FpaWYQzGzCnNI9blXbei61YpAmtoezMRxpVvBJ6SxgTizKsVAAAgAEAAIAAAACAAAAAAAAAAAABBwABCGwCSDBFAiEAtaQFFInPG5/Sh3i0+7eoWYR8nZj79AEa1+NIU5taw94CIDhAnHxGTmlpyuMe/kQ53DpE0ddx216kWz6bT9lr+HRRASED/NBaWlmEMxswpzSPW5V23outWKQJraHszEcaVbwSeksAAA=="')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h3",{attrs:{id:"7a-export-signed-psbt-to-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#7a-export-signed-psbt-to-environment-variable"}},[t._v("#")]),t._v(" 7a: export signed psbt to environment variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v('export SIGNED_PSBT="Paste_PSBT_HERE"')])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v('$env:PSBTSIGNED = "STRINGHERE"')]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/VJsl8zR.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-8-broadcast-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-8-broadcast-transaction"}},[t._v("#")]),t._v(" Step 8: Broadcast Transaction")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor broadcast --psbt $SIGNED_PSBT")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor broadcast --psbt $env:PSBTSIGNED")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/yQZZk0d.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txid"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a0877b7ce91ea6d141ba63277673f5bdf0edfdd45f91a39ba1a1ace15f839b52"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("Verify transaction in the memory pool on testnet "),e("a",{attrs:{href:"https://mempool.space/testnet",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mempool-testnet!"),e("OutboundLink")],1)])]),t._v(" "),e("div",{staticClass:"custom-block tip"},[e("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),e("p",[t._v("Run sync one more time and see that the balance has decreased.")])]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"resources"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#resources"}},[t._v("#")]),t._v(" Resources")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP-32: Hierarchical Deterministic Wallets"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 39 - Mnemonic code for generating deterministic keys"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 44 - Multi-Account Hierarchy for Deterministic Wallets"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 84 - Derivation scheme for P2WPKH based accounts"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 174 - Partially Signed Bitcoin Transaction Format"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://blog.summerofbitcoin.org/miniscript-policy-descriptors-hidden-powers-of-bitcoin/",target:"_blank",rel:"noopener noreferrer"}},[t._v("What are Descriptors and miniscript?"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://bitcoin.stackexchange.com/questions/97242/bip39-tool-bip32-extended-private-key-vs-bip32-root-key",target:"_blank",rel:"noopener noreferrer"}},[t._v("Master Private Key and Extended Private Key"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://min.sc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Minsc A Miniscript-based scripting language for Bitcoin contracts"),e("OutboundLink")],1)])])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/42.9a10d494.js b/assets/js/42.bd54d519.js similarity index 99% rename from assets/js/42.9a10d494.js rename to assets/js/42.bd54d519.js index a707cf2ea6..a81698357d 100644 --- a/assets/js/42.9a10d494.js +++ b/assets/js/42.bd54d519.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{391:function(t,s,a){"use strict";a.r(s);var n=a(7),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("It’s easy to underestimate the importance of privacy tech for Bitcoin,\nespecially when connecting to third party services. They can learn your\nIP address and associate the transactions you sent over it. You can only\nhope that this information will not be leaked anytime in the future with\nunpredictable consequences. In order to use Bitcoin privately, you need\nto encrypt and anonymize the data you send over the Internet.")]),t._v(" "),s("p",[t._v("Tor is one of the must-have privacy preserving tools for the Internet in\ngeneral, and for Bitcoin in particular. Tor network consists of nodes that\nuse clever cryptographic methods to encrypt user data and transfer them as\nanonymously as possible.")]),t._v(" "),s("p",[t._v("In this article we show how to integrate Tor with your BDK application.")]),t._v(" "),s("h2",{attrs:{id:"prerequisite"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#prerequisite"}},[t._v("#")]),t._v(" Prerequisite")]),t._v(" "),s("p",[t._v("First, you would need to have a Tor daemon up and running.")]),t._v(" "),s("p",[t._v("On Mac OS X you can install with Homebrew.")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("brew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" tor\nbrew services start tor\n")])])]),s("p",[t._v("On Ubuntu or other Debian-based distributions.")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sudo")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" tor\n")])])]),s("p",[t._v("In some cases you'll need to wait a minute or two for the bootstrapping to finish.\nIn general, Tor is not the fastest network, so if any of the examples below fail\ndue to timeout, simply restart it.")]),t._v(" "),s("p",[t._v("At the very end of the article we’ll show how to integrate Tor directly to\nyour application.")]),t._v(" "),s("p",[t._v("By default, Tor creates a "),s("a",{attrs:{href:"https://en.wikipedia.org/wiki/SOCKS",target:"_blank",rel:"noopener noreferrer"}},[t._v("SOCKS5"),s("OutboundLink")],1),t._v(" proxy\nendpoint and listens on port 9050. Your application should connect to the\nproxy on "),s("code",[t._v("localhost:9050")]),t._v(" and use it for its network activities.")]),t._v(" "),s("h2",{attrs:{id:"setting-up"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setting-up"}},[t._v("#")]),t._v(" Setting Up")]),t._v(" "),s("p",[t._v("Create a new cargo project.")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mkdir")]),t._v(" ~/tutorial\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" tutorial\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" new bdk-tor\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" bdk-tor\n")])])]),s("p",[t._v("Open "),s("code",[t._v("src/main.rs")]),t._v(" file remove all its contents and add these lines.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("FromStr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("database"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("template"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Bip84")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SyncOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// add additional imports here")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" network "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xpriv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xpriv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create_wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Syncing the wallet..."')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SyncOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The wallet synced. Height: {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_height")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Bip84")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("External")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Bip84")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Internal")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In this code we create a testnet wallet with "),s("code",[t._v("create_wallet()")]),t._v(" function and\ntry to sync it with a specific blockchain client implementation. We create a\nblockchain client using "),s("code",[t._v("create_blockchain()")]),t._v(" function. We’ll implement it\nlater for each type of blockchain client supported by BDK.")]),t._v(" "),s("h2",{attrs:{id:"electrumblockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#electrumblockchain"}},[t._v("#")]),t._v(" ElectrumBlockchain")]),t._v(" "),s("p",[t._v("The Electrum client is enabled by default so the "),s("code",[t._v("Cargo.toml")]),t._v(" dependencies\nsection will look like this.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("And the imports look like this.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("electrum_client"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Socks5Config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("Here is the implementation of "),s("code",[t._v("create_blockchain()")]),t._v(" function for the\nElectrum client.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ssl://electrum.blockstream.info:60002"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("socks5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Socks5Config")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n credentials"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" client "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("client"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In this example we create an instance of "),s("code",[t._v("Socks5Config")]),t._v(" which defines the\nTor proxy parameters for "),s("code",[t._v("ElectrumBlockchain")]),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"blocking-esplorablockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#blocking-esplorablockchain"}},[t._v("#")]),t._v(" Blocking EsploraBlockchain")]),t._v(" "),s("p",[t._v("The blocking version of "),s("code",[t._v("EsploraBlockchain")]),t._v(" uses "),s("code",[t._v("ureq")]),t._v(" crate to send HTTP\nrequests to Eslora backends. By default, its SOCKS5 feature is disabled,\nso we need to enable it in "),s("code",[t._v("Cargo.toml")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("default-features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"use-esplora-blocking"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The imports are")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("esplora"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("And "),s("code",[t._v("create_blockchain()")]),t._v(" implementation is")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/testnet/api"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"socks5://127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n base_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n proxy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n concurrency"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n stop_gap"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timeout"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("120")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Here we use "),s("code",[t._v("proxy()")]),t._v(" method of the config builder to set the Tor proxy\naddress. Please note, that unlike the previous examples, the Esplora client\nbuilder requires not just a proxy address, but a URL\n“socks5://127.0.0.1:9050”.")]),t._v(" "),s("h2",{attrs:{id:"asynchronous-esplorablockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#asynchronous-esplorablockchain"}},[t._v("#")]),t._v(" Asynchronous EsploraBlockchain")]),t._v(" "),s("p",[t._v("There’s no need in enabling SOCKS5 for the asynchronous Esplora client,\nso we are good to go without additional dependencies.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("default-features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"use-esplora-async"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The imports are the same as in previous example.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("esplora"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[s("code",[t._v("create_blockchain()")]),t._v(" is almost identical.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/testnet/api"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"socks5h://127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n base_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n proxy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n concurrency"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n stop_gap"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timeout"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("120")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("There are two notable differences though. First, we call "),s("code",[t._v("build_async()")]),t._v(" to\ncreate an asynchronous Esplora client. Second the SOCKS5 URL scheme is\n“socks5h”. It’s not a typo. The async client supports two SOCKS5 schemes\n“socks5” and “socks5h”. The difference between them is that the former\nmakes the client to resolve domain names, and the latter does not, so the\nclient passes them to the proxy as is. A regular DNS resolver cannot\nresolve Tor onion addresses, so we should use “socks5h” here.")]),t._v(" "),s("h2",{attrs:{id:"compactfiltersblockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#compactfiltersblockchain"}},[t._v("#")]),t._v(" CompactFiltersBlockchain")]),t._v(" "),s("p",[t._v("Add these lines to the dependencies section of "),s("code",[t._v("Cargo.toml")]),t._v(" file to enable\nBIP-157/BIP-158 compact filter support.")]),t._v(" "),s("p",[t._v("It can take a while to sync a wallet using compact filters over Tor, so be\npatient.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("default-features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"compact_filters"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Now add the required imports into "),s("code",[t._v("src/main.rs")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("sync"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Arc")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("compact_filters"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mempool")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Peer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CompactFiltersBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[s("code",[t._v("create_blockchain()")]),t._v(" function will look like this.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CompactFiltersBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" peer_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"neutrino.testnet3.suredbits.com:18333"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" mempool "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Arc")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mempool")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" peer_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" peer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Peer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("connect_proxy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("peer_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" mempool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CompactFiltersBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("vec!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("peer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./wallet-filters"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Here we use "),s("code",[t._v("Peer::connect_proxy()")]),t._v(" which accepts the address to the SOCKS5\nproxy and performs all the heavy lifting for us.")]),t._v(" "),s("h2",{attrs:{id:"integrated-tor-daemon"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#integrated-tor-daemon"}},[t._v("#")]),t._v(" Integrated Tor daemon")]),t._v(" "),s("p",[t._v("As an application developer you don’t have to rely on your users to install\nand start Tor to use your application. Using "),s("code",[t._v("libtor")]),t._v(" crate you can bundle\nTor daemon with your app.")]),t._v(" "),s("p",[s("code",[t._v("libtor")]),t._v(" builds a Tor binary from the source files. Since Tor is written in C\nyou'll need a C compiler and build tools.")]),t._v(" "),s("p",[t._v("Install these packages on Mac OS X:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("xcode-select "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--install")]),t._v("\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" autoconf\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" automake\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" libtool\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" openssl\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" pkg-config\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("export")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("LDFLAGS")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-L/opt/homebrew/opt/openssl/lib"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("export")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("CPPFLAGS")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-I/opt/homebrew/opt/openssl/include"')]),t._v("\n")])])]),s("p",[t._v("Or these packages on Ubuntu or another Debian-based Linux distribution:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sudo")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" autoconf automake clang "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("file")]),t._v(" libtool openssl pkg-config\n")])])]),s("p",[t._v("Then add these dependencies to the "),s("code",[t._v("Cargo.toml")]),t._v(" file.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("libtor")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"47.8.0+0.4.7.x"')]),t._v("\n")])])]),s("p",[t._v("This is an example of how we can use "),s("code",[t._v("libtor")]),t._v(" to start a Tor daemon.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("File")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("prelude"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("thread"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("time"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Duration")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("libtor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogDestination")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("libtor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogLevel")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("libtor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HiddenServiceVersion")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorAddress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("env"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("start_tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_port "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("19050")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" data_dir "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("format!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{}/{}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("env"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("temp_dir")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("display")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bdk-tor"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" log_file_name "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("format!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{}/{}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("data_dir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"log"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Staring Tor in {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("data_dir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("truncate_log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("log_file_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DataDirectory")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data_dir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogTo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogLevel")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Notice")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogDestination")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("File")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("log_file_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("as_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SocksPort")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("socks_port"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Custom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ExitPolicy reject *:*"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Custom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BridgeRelay 0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("start_background")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" started "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("while")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("started "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" tries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("120")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("panic!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"It took too long to start Tor. See {} for details"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("log_file_name\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("thread"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sleep")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Duration")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_millis")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n started "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find_string_in_log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("log_file_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Bootstrapped 100%"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Tor started"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("format!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:{}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" socks_port"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("First, we create a Tor object, and then we call "),s("code",[t._v("start_background()")]),t._v(" method\nto start it in the background. After that, we continuously try to find\n“Bootstrapped 100%” string in the log file. Once we find it, Tor is\nready to proxy our connections. We use port 19050 because, the user can\nhave their own instance of Tor running already.")]),t._v(" "),s("p",[t._v("Next you can modify "),s("code",[t._v("create_blockchain()")]),t._v(" like this")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ssl://electrum.blockstream.info:60002"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("start_tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In this example we start Tor first, then use the address returned by\n"),s("code",[t._v("start_tor()")]),t._v(" function as proxy address.")]),t._v(" "),s("p",[t._v("We omitted "),s("code",[t._v("find_string_in_log()")]),t._v(" and "),s("code",[t._v("truncate_log()")]),t._v(" for brevity. You\ncan find their implementations in "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/master/examples/esplora_backend_with_tor.rs",target:"_blank",rel:"noopener noreferrer"}},[t._v("esplora_backend_with_tor.rs"),s("OutboundLink")],1)])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{389:function(t,s,a){"use strict";a.r(s);var n=a(7),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("It’s easy to underestimate the importance of privacy tech for Bitcoin,\nespecially when connecting to third party services. They can learn your\nIP address and associate the transactions you sent over it. You can only\nhope that this information will not be leaked anytime in the future with\nunpredictable consequences. In order to use Bitcoin privately, you need\nto encrypt and anonymize the data you send over the Internet.")]),t._v(" "),s("p",[t._v("Tor is one of the must-have privacy preserving tools for the Internet in\ngeneral, and for Bitcoin in particular. Tor network consists of nodes that\nuse clever cryptographic methods to encrypt user data and transfer them as\nanonymously as possible.")]),t._v(" "),s("p",[t._v("In this article we show how to integrate Tor with your BDK application.")]),t._v(" "),s("h2",{attrs:{id:"prerequisite"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#prerequisite"}},[t._v("#")]),t._v(" Prerequisite")]),t._v(" "),s("p",[t._v("First, you would need to have a Tor daemon up and running.")]),t._v(" "),s("p",[t._v("On Mac OS X you can install with Homebrew.")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("brew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" tor\nbrew services start tor\n")])])]),s("p",[t._v("On Ubuntu or other Debian-based distributions.")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sudo")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" tor\n")])])]),s("p",[t._v("In some cases you'll need to wait a minute or two for the bootstrapping to finish.\nIn general, Tor is not the fastest network, so if any of the examples below fail\ndue to timeout, simply restart it.")]),t._v(" "),s("p",[t._v("At the very end of the article we’ll show how to integrate Tor directly to\nyour application.")]),t._v(" "),s("p",[t._v("By default, Tor creates a "),s("a",{attrs:{href:"https://en.wikipedia.org/wiki/SOCKS",target:"_blank",rel:"noopener noreferrer"}},[t._v("SOCKS5"),s("OutboundLink")],1),t._v(" proxy\nendpoint and listens on port 9050. Your application should connect to the\nproxy on "),s("code",[t._v("localhost:9050")]),t._v(" and use it for its network activities.")]),t._v(" "),s("h2",{attrs:{id:"setting-up"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setting-up"}},[t._v("#")]),t._v(" Setting Up")]),t._v(" "),s("p",[t._v("Create a new cargo project.")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mkdir")]),t._v(" ~/tutorial\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" tutorial\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" new bdk-tor\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" bdk-tor\n")])])]),s("p",[t._v("Open "),s("code",[t._v("src/main.rs")]),t._v(" file remove all its contents and add these lines.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("FromStr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("database"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("template"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Bip84")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SyncOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// add additional imports here")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" network "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xpriv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xpriv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create_wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Syncing the wallet..."')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SyncOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The wallet synced. Height: {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_height")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Bip84")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("External")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Bip84")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Internal")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In this code we create a testnet wallet with "),s("code",[t._v("create_wallet()")]),t._v(" function and\ntry to sync it with a specific blockchain client implementation. We create a\nblockchain client using "),s("code",[t._v("create_blockchain()")]),t._v(" function. We’ll implement it\nlater for each type of blockchain client supported by BDK.")]),t._v(" "),s("h2",{attrs:{id:"electrumblockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#electrumblockchain"}},[t._v("#")]),t._v(" ElectrumBlockchain")]),t._v(" "),s("p",[t._v("The Electrum client is enabled by default so the "),s("code",[t._v("Cargo.toml")]),t._v(" dependencies\nsection will look like this.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("And the imports look like this.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("electrum_client"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Socks5Config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("Here is the implementation of "),s("code",[t._v("create_blockchain()")]),t._v(" function for the\nElectrum client.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ssl://electrum.blockstream.info:60002"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("socks5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Socks5Config")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n credentials"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" client "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("client"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In this example we create an instance of "),s("code",[t._v("Socks5Config")]),t._v(" which defines the\nTor proxy parameters for "),s("code",[t._v("ElectrumBlockchain")]),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"blocking-esplorablockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#blocking-esplorablockchain"}},[t._v("#")]),t._v(" Blocking EsploraBlockchain")]),t._v(" "),s("p",[t._v("The blocking version of "),s("code",[t._v("EsploraBlockchain")]),t._v(" uses "),s("code",[t._v("ureq")]),t._v(" crate to send HTTP\nrequests to Eslora backends. By default, its SOCKS5 feature is disabled,\nso we need to enable it in "),s("code",[t._v("Cargo.toml")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("default-features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"use-esplora-blocking"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The imports are")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("esplora"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("And "),s("code",[t._v("create_blockchain()")]),t._v(" implementation is")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/testnet/api"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"socks5://127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n base_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n proxy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n concurrency"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n stop_gap"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timeout"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("120")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Here we use "),s("code",[t._v("proxy()")]),t._v(" method of the config builder to set the Tor proxy\naddress. Please note, that unlike the previous examples, the Esplora client\nbuilder requires not just a proxy address, but a URL\n“socks5://127.0.0.1:9050”.")]),t._v(" "),s("h2",{attrs:{id:"asynchronous-esplorablockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#asynchronous-esplorablockchain"}},[t._v("#")]),t._v(" Asynchronous EsploraBlockchain")]),t._v(" "),s("p",[t._v("There’s no need in enabling SOCKS5 for the asynchronous Esplora client,\nso we are good to go without additional dependencies.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("default-features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"use-esplora-async"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The imports are the same as in previous example.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("esplora"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[s("code",[t._v("create_blockchain()")]),t._v(" is almost identical.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/testnet/api"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"socks5h://127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n base_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n proxy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n concurrency"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n stop_gap"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timeout"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("120")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("There are two notable differences though. First, we call "),s("code",[t._v("build_async()")]),t._v(" to\ncreate an asynchronous Esplora client. Second the SOCKS5 URL scheme is\n“socks5h”. It’s not a typo. The async client supports two SOCKS5 schemes\n“socks5” and “socks5h”. The difference between them is that the former\nmakes the client to resolve domain names, and the latter does not, so the\nclient passes them to the proxy as is. A regular DNS resolver cannot\nresolve Tor onion addresses, so we should use “socks5h” here.")]),t._v(" "),s("h2",{attrs:{id:"compactfiltersblockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#compactfiltersblockchain"}},[t._v("#")]),t._v(" CompactFiltersBlockchain")]),t._v(" "),s("p",[t._v("Add these lines to the dependencies section of "),s("code",[t._v("Cargo.toml")]),t._v(" file to enable\nBIP-157/BIP-158 compact filter support.")]),t._v(" "),s("p",[t._v("It can take a while to sync a wallet using compact filters over Tor, so be\npatient.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("default-features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"compact_filters"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Now add the required imports into "),s("code",[t._v("src/main.rs")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("sync"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Arc")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("compact_filters"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mempool")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Peer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CompactFiltersBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[s("code",[t._v("create_blockchain()")]),t._v(" function will look like this.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CompactFiltersBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" peer_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"neutrino.testnet3.suredbits.com:18333"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" mempool "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Arc")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mempool")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" peer_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" peer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Peer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("connect_proxy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("peer_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" mempool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CompactFiltersBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("vec!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("peer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./wallet-filters"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Here we use "),s("code",[t._v("Peer::connect_proxy()")]),t._v(" which accepts the address to the SOCKS5\nproxy and performs all the heavy lifting for us.")]),t._v(" "),s("h2",{attrs:{id:"integrated-tor-daemon"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#integrated-tor-daemon"}},[t._v("#")]),t._v(" Integrated Tor daemon")]),t._v(" "),s("p",[t._v("As an application developer you don’t have to rely on your users to install\nand start Tor to use your application. Using "),s("code",[t._v("libtor")]),t._v(" crate you can bundle\nTor daemon with your app.")]),t._v(" "),s("p",[s("code",[t._v("libtor")]),t._v(" builds a Tor binary from the source files. Since Tor is written in C\nyou'll need a C compiler and build tools.")]),t._v(" "),s("p",[t._v("Install these packages on Mac OS X:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("xcode-select "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--install")]),t._v("\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" autoconf\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" automake\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" libtool\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" openssl\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" pkg-config\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("export")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("LDFLAGS")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-L/opt/homebrew/opt/openssl/lib"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("export")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("CPPFLAGS")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-I/opt/homebrew/opt/openssl/include"')]),t._v("\n")])])]),s("p",[t._v("Or these packages on Ubuntu or another Debian-based Linux distribution:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sudo")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" autoconf automake clang "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("file")]),t._v(" libtool openssl pkg-config\n")])])]),s("p",[t._v("Then add these dependencies to the "),s("code",[t._v("Cargo.toml")]),t._v(" file.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("libtor")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"47.8.0+0.4.7.x"')]),t._v("\n")])])]),s("p",[t._v("This is an example of how we can use "),s("code",[t._v("libtor")]),t._v(" to start a Tor daemon.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("File")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("prelude"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("thread"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("time"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Duration")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("libtor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogDestination")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("libtor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogLevel")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("libtor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HiddenServiceVersion")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorAddress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("env"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("start_tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_port "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("19050")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" data_dir "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("format!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{}/{}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("env"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("temp_dir")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("display")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bdk-tor"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" log_file_name "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("format!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{}/{}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("data_dir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"log"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Staring Tor in {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("data_dir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("truncate_log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("log_file_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DataDirectory")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data_dir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogTo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogLevel")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Notice")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogDestination")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("File")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("log_file_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("as_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SocksPort")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("socks_port"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Custom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ExitPolicy reject *:*"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Custom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BridgeRelay 0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("start_background")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" started "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("while")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("started "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" tries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("120")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("panic!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"It took too long to start Tor. See {} for details"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("log_file_name\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("thread"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sleep")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Duration")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_millis")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n started "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find_string_in_log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("log_file_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Bootstrapped 100%"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Tor started"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("format!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:{}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" socks_port"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("First, we create a Tor object, and then we call "),s("code",[t._v("start_background()")]),t._v(" method\nto start it in the background. After that, we continuously try to find\n“Bootstrapped 100%” string in the log file. Once we find it, Tor is\nready to proxy our connections. We use port 19050 because, the user can\nhave their own instance of Tor running already.")]),t._v(" "),s("p",[t._v("Next you can modify "),s("code",[t._v("create_blockchain()")]),t._v(" like this")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ssl://electrum.blockstream.info:60002"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("start_tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In this example we start Tor first, then use the address returned by\n"),s("code",[t._v("start_tor()")]),t._v(" function as proxy address.")]),t._v(" "),s("p",[t._v("We omitted "),s("code",[t._v("find_string_in_log()")]),t._v(" and "),s("code",[t._v("truncate_log()")]),t._v(" for brevity. You\ncan find their implementations in "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/master/examples/esplora_backend_with_tor.rs",target:"_blank",rel:"noopener noreferrer"}},[t._v("esplora_backend_with_tor.rs"),s("OutboundLink")],1)])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/43.481500e2.js b/assets/js/43.3b234b14.js similarity index 99% rename from assets/js/43.481500e2.js rename to assets/js/43.3b234b14.js index 4963ce7856..922c259dc3 100644 --- a/assets/js/43.481500e2.js +++ b/assets/js/43.3b234b14.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{392:function(e,t,i){"use strict";i.r(t);var r=i(7),o=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[t("strong",[e._v("tldr;")]),e._v(" "),t("em",[e._v("we can't produce and maintain bindings for all Rust crates we get requests for, but we are working to help others build their own bindings by (1) making our architecture composable and reusable, and (2) building strong examples and documentation on how to do it for other crates.")])]),e._v(" "),t("br"),e._v(" "),t("p",[e._v("Over the past 2 years, the Bitcoin Development Kit team has been successful at building and releasing language bindings for our Rust library. In particular, over the past 18 months we have locked in and solidified our approach for the iOS, Android, Kotlin, Java, and Python bindings by using a Rust library called "),t("a",{attrs:{href:"https://github.com/mozilla/uniffi-rs",target:"_blank",rel:"noopener noreferrer"}},[e._v("Uniffi"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Over the course of the year, we've had many requests to add to the bindings certain features that are not directly in the Rust BDK library. These request mainly break down into two groups:")]),e._v(" "),t("ol",[t("li",[e._v('Features that are part of crates "upstream" of BDK (rust-bitcoin, rust-miniscript)')]),e._v(" "),t("li",[e._v("Features that are not but that have Rust crates and would be useful on mobile (payjoin, coinjoin implementations, silent payments, BIP-47)")])]),e._v(" "),t("h2",{attrs:{id:"current-architecture"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#current-architecture"}},[e._v("#")]),e._v(" Current architecture")]),e._v(" "),t("p",[e._v("The current architecture for the BDK bindings is more or less wrapping the bdk, rust-bitcoin, and rust-miniscript crates and exposing an API that allows users to leverage them similarly to how they would BDK in Rust if they were using it in a Rust project.")]),e._v(" "),t("p",[e._v('While we started with a simplified version of the Rust BDK API, over time users asked for more and more functionality, and exposing some of the underlying rust-bitcoin constructs became important. This makes sense, and indeed users of the bitcoin development kit in Rust have access to all the related APIs by simply importing rust-bitcoin and rust-miniscript, hence our desire to accommodate these use cases as well. However, this is currently done all in one "bindings" library (i.e. if you import '),t("code",[e._v("bdk-android")]),e._v(" in a project, you'll have access to an API that is mostly bdk-based, but also contains a bit of rust-bitcoin and rust-miniscript).")]),e._v(" "),t("h2",{attrs:{id:"moving-forward-building-a-family-of-libraries"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#moving-forward-building-a-family-of-libraries"}},[e._v("#")]),e._v(" Moving forward: building a family of libraries")]),e._v(" "),t("p",[e._v("At the same time, other Rust-based libraries started using the uniffi approach (a good example is "),t("a",{attrs:{href:"https://github.com/lightningdevkit/ldk-node",target:"_blank",rel:"noopener noreferrer"}},[e._v("ldk-node"),t("OutboundLink")],1),e._v(") to expose bindings. When developing and using those libraries together, it quickly became clear that much of the work was duplicated; both libraries needed access to underlying rust-bitcoin types, but they both exposed their own versions of it.")]),e._v(" "),t("p",[e._v("Over the coming months, the team is looking at extracting the rust-bitcoin part of the BDK bindings library (bdk-ffi) and publishing that library on "),t("a",{attrs:{href:"https://crates.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("crates.io"),t("OutboundLink")],1),e._v(" so as to make it available to others who wish to build Rust bindings using uniffi.")]),e._v(" "),t("h2",{attrs:{id:"why-cant-we-just-build-one-big-bdk-library-with-everything-in-it"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-cant-we-just-build-one-big-bdk-library-with-everything-in-it"}},[e._v("#")]),e._v(" Why can't we just build one big BDK library with "),t("em",[e._v("everything")]),e._v(" in it?")]),e._v(" "),t("ol",[t("li",[e._v("The short answer to this is that it would simply not be maintainable. If we rely on many underlying Rust crates, we'd need to release patches every time one of the underlying libraries patches a bug. We'd also need to keep them all in sync (what API versions work with what), and we'd be relying on work from teams that may or may not have the capacity to keep their crates up to date.")]),e._v(" "),t("li",[e._v("Scope creep. Unless we define a narrow and structured scope for the library, we will forever be handling requests for features that may or may not be feasible to accommodate.")]),e._v(" "),t("li",[e._v("Library size. Because one of our primary focus for the bindings is mobile devices, we need to make sure we don't build a library that is too big. This is a more nuanced issue, but it relates to point (2), where too large a scope would eventually produce a library that is potentially not optimal for mobile devices because it attempts to do too much all in one package.")])]),e._v(" "),t("h2",{attrs:{id:"are-you-looking-to-build-rust-bindings-yourself"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#are-you-looking-to-build-rust-bindings-yourself"}},[e._v("#")]),e._v(" Are you looking to build Rust bindings yourself?")]),e._v(" "),t("p",[e._v("We got your back! The Bitcoin Development Kit team intends to help others in the Rust bitcoin ecosystem build bindings if they wish to. To that effect, we maintain 3 repositories that should help you get going with bindings in no time:")]),e._v(" "),t("ol",[t("li",[t("strong",[t("a",{attrs:{href:"https://github.com/thunderbiscuit/uniffi-bindings-template",target:"_blank",rel:"noopener noreferrer"}},[e._v("Uniffi library template"),t("OutboundLink")],1)]),e._v(". This is a repository you can fork and start adding code to produce bindings directly for iOS and Android. Included are our custom-made Gradle plugin and Swift release shell scripts, as well as information about the little build quirks you need to know about for smooth releases.")]),e._v(" "),t("li",[t("strong",[t("a",{attrs:{href:"https://github.com/thunderbiscuit/uniffi-examples",target:"_blank",rel:"noopener noreferrer"}},[e._v("Uniffi examples"),t("OutboundLink")],1)]),e._v(". This repository provides boiled-down examples of APIs exposed using uniffi, with an "),t("a",{attrs:{href:"https://thunderbiscuit.github.io/uniffi-examples/",target:"_blank",rel:"noopener noreferrer"}},[e._v("accompanying documentation website"),t("OutboundLink")],1),e._v(". Functions, enums, objects, callbacks, multi-libraries, a lot of information and examples to get you started.")]),e._v(" "),t("li",[t("strong",[t("a",{attrs:{href:"https://github.com/thunderbiscuit/bitcoin-frontier",target:"_blank",rel:"noopener noreferrer"}},[e._v("Sandbox library "),t("code",[e._v("bitcoin-frontier")]),t("OutboundLink")],1)]),e._v(". This repository is meant as a sandbox to start developing and testing your own bindings. Simply fork it and start adding code! It comes with a fully working Android app you can leverage to test out whatever bindings you're building.")])])])}),[],!1,null,null,null);t.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{390:function(e,t,i){"use strict";i.r(t);var r=i(7),o=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[t("strong",[e._v("tldr;")]),e._v(" "),t("em",[e._v("we can't produce and maintain bindings for all Rust crates we get requests for, but we are working to help others build their own bindings by (1) making our architecture composable and reusable, and (2) building strong examples and documentation on how to do it for other crates.")])]),e._v(" "),t("br"),e._v(" "),t("p",[e._v("Over the past 2 years, the Bitcoin Development Kit team has been successful at building and releasing language bindings for our Rust library. In particular, over the past 18 months we have locked in and solidified our approach for the iOS, Android, Kotlin, Java, and Python bindings by using a Rust library called "),t("a",{attrs:{href:"https://github.com/mozilla/uniffi-rs",target:"_blank",rel:"noopener noreferrer"}},[e._v("Uniffi"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Over the course of the year, we've had many requests to add to the bindings certain features that are not directly in the Rust BDK library. These request mainly break down into two groups:")]),e._v(" "),t("ol",[t("li",[e._v('Features that are part of crates "upstream" of BDK (rust-bitcoin, rust-miniscript)')]),e._v(" "),t("li",[e._v("Features that are not but that have Rust crates and would be useful on mobile (payjoin, coinjoin implementations, silent payments, BIP-47)")])]),e._v(" "),t("h2",{attrs:{id:"current-architecture"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#current-architecture"}},[e._v("#")]),e._v(" Current architecture")]),e._v(" "),t("p",[e._v("The current architecture for the BDK bindings is more or less wrapping the bdk, rust-bitcoin, and rust-miniscript crates and exposing an API that allows users to leverage them similarly to how they would BDK in Rust if they were using it in a Rust project.")]),e._v(" "),t("p",[e._v('While we started with a simplified version of the Rust BDK API, over time users asked for more and more functionality, and exposing some of the underlying rust-bitcoin constructs became important. This makes sense, and indeed users of the bitcoin development kit in Rust have access to all the related APIs by simply importing rust-bitcoin and rust-miniscript, hence our desire to accommodate these use cases as well. However, this is currently done all in one "bindings" library (i.e. if you import '),t("code",[e._v("bdk-android")]),e._v(" in a project, you'll have access to an API that is mostly bdk-based, but also contains a bit of rust-bitcoin and rust-miniscript).")]),e._v(" "),t("h2",{attrs:{id:"moving-forward-building-a-family-of-libraries"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#moving-forward-building-a-family-of-libraries"}},[e._v("#")]),e._v(" Moving forward: building a family of libraries")]),e._v(" "),t("p",[e._v("At the same time, other Rust-based libraries started using the uniffi approach (a good example is "),t("a",{attrs:{href:"https://github.com/lightningdevkit/ldk-node",target:"_blank",rel:"noopener noreferrer"}},[e._v("ldk-node"),t("OutboundLink")],1),e._v(") to expose bindings. When developing and using those libraries together, it quickly became clear that much of the work was duplicated; both libraries needed access to underlying rust-bitcoin types, but they both exposed their own versions of it.")]),e._v(" "),t("p",[e._v("Over the coming months, the team is looking at extracting the rust-bitcoin part of the BDK bindings library (bdk-ffi) and publishing that library on "),t("a",{attrs:{href:"https://crates.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("crates.io"),t("OutboundLink")],1),e._v(" so as to make it available to others who wish to build Rust bindings using uniffi.")]),e._v(" "),t("h2",{attrs:{id:"why-cant-we-just-build-one-big-bdk-library-with-everything-in-it"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-cant-we-just-build-one-big-bdk-library-with-everything-in-it"}},[e._v("#")]),e._v(" Why can't we just build one big BDK library with "),t("em",[e._v("everything")]),e._v(" in it?")]),e._v(" "),t("ol",[t("li",[e._v("The short answer to this is that it would simply not be maintainable. If we rely on many underlying Rust crates, we'd need to release patches every time one of the underlying libraries patches a bug. We'd also need to keep them all in sync (what API versions work with what), and we'd be relying on work from teams that may or may not have the capacity to keep their crates up to date.")]),e._v(" "),t("li",[e._v("Scope creep. Unless we define a narrow and structured scope for the library, we will forever be handling requests for features that may or may not be feasible to accommodate.")]),e._v(" "),t("li",[e._v("Library size. Because one of our primary focus for the bindings is mobile devices, we need to make sure we don't build a library that is too big. This is a more nuanced issue, but it relates to point (2), where too large a scope would eventually produce a library that is potentially not optimal for mobile devices because it attempts to do too much all in one package.")])]),e._v(" "),t("h2",{attrs:{id:"are-you-looking-to-build-rust-bindings-yourself"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#are-you-looking-to-build-rust-bindings-yourself"}},[e._v("#")]),e._v(" Are you looking to build Rust bindings yourself?")]),e._v(" "),t("p",[e._v("We got your back! The Bitcoin Development Kit team intends to help others in the Rust bitcoin ecosystem build bindings if they wish to. To that effect, we maintain 3 repositories that should help you get going with bindings in no time:")]),e._v(" "),t("ol",[t("li",[t("strong",[t("a",{attrs:{href:"https://github.com/thunderbiscuit/uniffi-bindings-template",target:"_blank",rel:"noopener noreferrer"}},[e._v("Uniffi library template"),t("OutboundLink")],1)]),e._v(". This is a repository you can fork and start adding code to produce bindings directly for iOS and Android. Included are our custom-made Gradle plugin and Swift release shell scripts, as well as information about the little build quirks you need to know about for smooth releases.")]),e._v(" "),t("li",[t("strong",[t("a",{attrs:{href:"https://github.com/thunderbiscuit/uniffi-examples",target:"_blank",rel:"noopener noreferrer"}},[e._v("Uniffi examples"),t("OutboundLink")],1)]),e._v(". This repository provides boiled-down examples of APIs exposed using uniffi, with an "),t("a",{attrs:{href:"https://thunderbiscuit.github.io/uniffi-examples/",target:"_blank",rel:"noopener noreferrer"}},[e._v("accompanying documentation website"),t("OutboundLink")],1),e._v(". Functions, enums, objects, callbacks, multi-libraries, a lot of information and examples to get you started.")]),e._v(" "),t("li",[t("strong",[t("a",{attrs:{href:"https://github.com/thunderbiscuit/bitcoin-frontier",target:"_blank",rel:"noopener noreferrer"}},[e._v("Sandbox library "),t("code",[e._v("bitcoin-frontier")]),t("OutboundLink")],1)]),e._v(". This repository is meant as a sandbox to start developing and testing your own bindings. Simply fork it and start adding code! It comes with a fully working Android app you can leverage to test out whatever bindings you're building.")])])])}),[],!1,null,null,null);t.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/44.4d519937.js b/assets/js/44.1195b75f.js similarity index 99% rename from assets/js/44.4d519937.js rename to assets/js/44.1195b75f.js index e4c0ee6823..86cb616f3e 100644 --- a/assets/js/44.4d519937.js +++ b/assets/js/44.1195b75f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{390:function(a,e,t){"use strict";t.r(e);var s=t(7),r=Object(s.a)({},(function(){var a=this,e=a._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),e("h3",{attrs:{id:"compact-filters"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#compact-filters"}},[a._v("#")]),a._v(" Compact Filters:")]),a._v(" "),e("p",[a._v("Compact filters are the latest specification of Bitcoin SPV node implementation as per "),e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP157"),e("OutboundLink")],1),a._v(" and "),e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP158"),e("OutboundLink")],1),a._v(". Such light clients were envisioned by Satoshi himself in his original white paper, but due to lack of robust privacy and trust guarantees using conventional "),e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[a._v("bloomfilters"),e("OutboundLink")],1),a._v(", these type of nodes never got popular.")]),a._v(" "),e("p",[a._v("Enters "),e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP157"),e("OutboundLink")],1),a._v(", which described a new type of filters for Bitcoin Blockchain data, known as "),e("code",[a._v("compact_filters")]),a._v(". The "),e("a",{attrs:{href:"https://github.com/lightninglabs/neutrino",target:"_blank",rel:"noopener noreferrer"}},[a._v("Neutrino"),e("OutboundLink")],1),a._v(' project pioneered the use of compact filter based light client nodes for using with Lightning Network wallets. Using compact filters, a light-node can talk to one or more full nodes, and fetch relevant information from the blockchain, with much more robust privacy and security guarantees than previously possible. Compact filter based nodes are best suitable to be used with mobile wallets, to create more trustless mobile applications on Bitcoin. Any wallet application that needs to have an "eye on the blockchain" has an use for such light clients.')]),a._v(" "),e("p",[e("code",[a._v("BIP157")]),a._v(" type filters allows to create tiny sized SPV nodes, that can fetch blockchain data and can identify inconsistency, so it can actively defend itself, while also preserving its privacy. Such nodes are most useful for Lightning Network mobile applications.")]),a._v(" "),e("p",[a._v("Example of such "),e("code",[a._v("compact_filters")]),a._v(" wallets in wild is "),e("a",{attrs:{href:"https://github.com/breez/breezmobile",target:"_blank",rel:"noopener noreferrer"}},[a._v("Breeze"),e("OutboundLink")],1),a._v(" Lightning mobile wallet.")]),a._v(" "),e("p",[a._v("Bitcoin core supports serving "),e("code",[a._v("BIP157")]),a._v(" type filters from "),e("code",[a._v("v0.21.0")]),a._v(".")]),a._v(" "),e("h3",{attrs:{id:"bdk-and-compact-filters"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bdk-and-compact-filters"}},[a._v("#")]),a._v(" BDK and Compact filters")]),a._v(" "),e("p",[a._v("BDK is a bitcoin wallet development library that can be used to create bitcoin wallets with custom "),e("code",[a._v("Database")]),a._v(" and "),e("code",[a._v("Blockchain")]),a._v(" backends. BDK is a "),e("a",{attrs:{href:"https://bitcoindevkit.org/descriptors/",target:"_blank",rel:"noopener noreferrer"}},[a._v("descriptor"),e("OutboundLink")],1),a._v(" based wallet, i.e. the wallet keychain is described by a set of descriptors.")]),a._v(" "),e("p",[a._v("Using BDK one can instantiate wallets of various kinds as per requirement. BDK abstracts away all the heavy lifting works, and allow wallet devs to concentrate on logic that they care about, i.e. writing wallet codes. For more detailed documentation on BDK capabilities check these "),e("a",{attrs:{href:"https://bitcoindevkit.org/blog/2020/12/hello-world/",target:"_blank",rel:"noopener noreferrer"}},[a._v("blog"),e("OutboundLink")],1),a._v(", "),e("a",{attrs:{href:"https://bitcoindevkit.org/blog/2020/11/descriptors-in-the-wild/",target:"_blank",rel:"noopener noreferrer"}},[a._v("bog"),e("OutboundLink")],1),a._v(" and "),e("a",{attrs:{href:"https://docs.rs/bdk/",target:"_blank",rel:"noopener noreferrer"}},[a._v("docs"),e("OutboundLink")],1),a._v(".")]),a._v(" "),e("p",[a._v("The main three components of abstraction in BDK are")]),a._v(" "),e("ul",[e("li",[e("code",[a._v("Database")])]),a._v(" "),e("li",[e("code",[a._v("Descriptors")])]),a._v(" "),e("li",[e("code",[a._v("Blockchain")])])]),a._v(" "),e("p",[a._v("BDK comes with default implementations of all them that developers can start with out of the box. Developers can also create their own custom implementations and plug it into BDK (thanks to rust magic of "),e("code",[a._v("Traits")]),a._v(").")]),a._v(" "),e("p",[a._v("BDK also supports "),e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP158"),e("OutboundLink")],1),a._v(" communication protocol, which allows creation of "),e("code",[a._v("BIP157")]),a._v(" type compact filter SPV nodes. This capability is extended to wallet with BDK's "),e("code",[a._v("Blockchain")]),a._v(" data structure. The "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a._v("API"),e("OutboundLink")],1),a._v(" for "),e("code",[a._v("compact_filters")]),a._v(" backend is similar to any other kind of backends, so wallet devs don't need to worry about all the details. Its ok if the dev haven't even heard of "),e("code",[a._v("BIP157")]),a._v(", BDK takes care of that in background.")]),a._v(" "),e("p",[a._v("This capability can be unlocked by compiling BDK with the "),e("code",[a._v("compact_filters")]),a._v(" feature. Once enabled, BDK will be able to create wallets with the "),e("code",[a._v("compact_filters")]),a._v(" type "),e("code",[a._v("Blockchain")]),a._v(" backend. (The default backend is electrum server)")]),a._v(" "),e("h3",{attrs:{id:"bdk-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bdk-cli"}},[a._v("#")]),a._v(" bdk-cli")]),a._v(" "),e("p",[e("code",[a._v("bdk-cli")]),a._v(" is a lightweight "),e("a",{attrs:{href:"https://codewith.mu/en/tutorials/1.0/repl",target:"_blank",rel:"noopener noreferrer"}},[a._v("REPL"),e("OutboundLink")],1),a._v(" wrapper over the BDK library to facilitate quick and easy demonstration of BDK capabilities in command-line. Wallet devs can use this tool to quickly try out different possibilities with BDK.")]),a._v(" "),e("p",[a._v("In this tutorial, We will use "),e("code",[a._v("bdk-cli")]),a._v(" to demonstrate some basic wallet functionalities using "),e("code",[a._v("compact_filters")]),a._v(" backend.")]),a._v(" "),e("h2",{attrs:{id:"tutorial-scope"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tutorial-scope"}},[a._v("#")]),a._v(" Tutorial Scope")]),a._v(" "),e("p",[a._v("Basic wallet workflow we will cover:")]),a._v(" "),e("ul",[e("li",[a._v("create and sync a wallet,")]),a._v(" "),e("li",[a._v("receive a transaction,")]),a._v(" "),e("li",[a._v("create a transaction,")]),a._v(" "),e("li",[a._v("sign and broadcast the transaction,")]),a._v(" "),e("li",[a._v("fetch updated balance,")])]),a._v(" "),e("p",[a._v("The BDK wallet will have a "),e("code",[a._v("BIP157")]),a._v(" SPV backend (aka "),e("code",[a._v("compact_filters")]),a._v(" backend) that will connect with a Bitcoin core node serving filter data.")]),a._v(" "),e("p",[a._v("It will publish and extract transaction data through that node.")]),a._v(" "),e("p",[a._v("We will have a Bitcoin Core wallet and a BDK wallet, sending and receiving transactions between each other, in regtest.")]),a._v(" "),e("h2",{attrs:{id:"prerequisites"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites"}},[a._v("#")]),a._v(" Prerequisites")]),a._v(" "),e("p",[a._v("Following things are required to start with the tutorial.")]),a._v(" "),e("ol",[e("li",[a._v("A Bitcoin Core regtest node listening at "),e("code",[a._v("localhost:18444")]),a._v(" signalling for compact filter support.")]),a._v(" "),e("li",[e("code",[a._v("bdk-cli")]),a._v(" compiled with "),e("code",[a._v("compact_filter")]),a._v(" features.")])]),a._v(" "),e("p",[a._v("If you already have these two setup and working, you can skip this and jump to the "),e("a",{attrs:{href:"#tutorial"}},[a._v("Tutorial")]),a._v(" section.")]),a._v(" "),e("h3",{attrs:{id:"install-and-run-bitcoind"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#install-and-run-bitcoind"}},[a._v("#")]),a._v(" Install and run "),e("code",[a._v("bitcoind")])]),a._v(" "),e("p",[a._v("You can definitely do it with your own "),e("code",[a._v("bitcoind")]),a._v(" installation. "),e("code",[a._v("BIP157")]),a._v(" support has been included in Bitcoin Core "),e("code",[a._v("v0.21.0")]),a._v(". So anything above that will work.")]),a._v(" "),e("p",[a._v("You also need to ensure proper configuration settings for signalling "),e("code",[a._v("compact_filters")]),a._v(" support.")]),a._v(" "),e("p",[a._v("For ease of testing, the BDK project hosts docker images that can be used to spawn Bitcoin Core with all the relevant configurations.")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("spawn a regtest node using "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bitcoin-regtest-box",target:"_blank",rel:"noopener noreferrer"}},[a._v("bitcoin-regtest-box"),e("OutboundLink")],1),a._v(" docker file.")]),a._v(" "),e("p",[a._v("Start the regtest box docker container.")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" run "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--detach")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--rm")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-p")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("127.0")]),a._v(".0.1:18443-18444:18443-18444/tcp "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--name")]),a._v(" bdk-box bitcoindevkit/bitcoind\n")])])]),e("p",[a._v("This will spin up a docker container running "),e("code",[a._v("bicoind")]),a._v(" and listening to port "),e("code",[a._v("18444")]),a._v(" and "),e("code",[a._v("18333")]),a._v(". You can keep this terminal alive to see communication events with BDK and the node.")])]),a._v(" "),e("li",[e("p",[a._v("Check node is reachable")]),a._v(" "),e("p",[a._v("In another terminal try connecting to the node with "),e("code",[a._v("bitcoin-cli")])]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" getnetworkinfo\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"version"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("210000")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"subversion"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/Satoshi:0.21.1/"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"protocolversion"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("70016")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"localservices"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0000000000000449"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"localservicesnames"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NETWORK"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"WITNESS"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"COMPACT_FILTERS"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NETWORK_LIMITED"')]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n")])])]),e("p",[a._v("In the output, the "),e("code",[a._v("version")]),a._v(" should show "),e("code",[a._v("210000")]),a._v(". "),e("code",[a._v("localservicesnames")]),a._v(" should contain "),e("code",[a._v('"COMPACT_FILTERS"')]),a._v(". If you see this, then Bitcoin Core is correctly configured.")])])]),a._v(" "),e("h3",{attrs:{id:"install-and-run-bdk-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#install-and-run-bdk-cli"}},[a._v("#")]),a._v(" Install and run bdk-cli")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("Install "),e("code",[a._v("bdk-cli")]),a._v(" with "),e("code",[a._v("compact_filters")]),a._v(" feature")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("cargo")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--git")]),a._v(" https://github.com/bitcoindevkit/bdk-cli.git bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--features")]),a._v(" compact_filters\n")])])])]),a._v(" "),e("li",[e("p",[a._v("Check installation")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--help")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\nUSAGE:\n bdk-cli "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("OPTIONS"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("SUBCOMMAND"),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v("\nFLAGS:\n -h, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--help")]),a._v(" Prints "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("help")]),a._v(" information\n -V, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--version")]),a._v(" Prints version information\nOPTIONS:\n -n, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("NETWORK"),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" Sets the network "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("default: testnet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n\nSUBCOMMANDS:\n "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("help")]),a._v(" Prints this message or the "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("help")]),a._v(" of the given subcommand"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),a._v("s"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n key Key management sub-commands\n repl Enter REPL "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("command")]),a._v(" loop mode\n wallet Wallet options and sub-commands\n")])])])])]),a._v(" "),e("p",[a._v("Once these are setup correctly, you can start with the tutorial next.")]),a._v(" "),e("h2",{attrs:{id:"tutorial"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tutorial"}},[a._v("#")]),a._v(" Tutorial")]),a._v(" "),e("p",[a._v("[Note: For brevity "),e("code",[a._v("bdk-cli")]),a._v(" results are stored in command line variables using "),e("code",[a._v("jq")]),a._v(" tool. It is recommended to check the full results to see different information returned by "),e("code",[a._v("bdk-cli")]),a._v(" commands.]")]),a._v(" "),e("h3",{attrs:{id:"bitcoin-core-wallet-generation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-core-wallet-generation"}},[a._v("#")]),a._v(" Bitcoin Core Wallet Generation")]),a._v(" "),e("p",[a._v("This is standard procedure with "),e("code",[a._v("bitcoin-cli")]),a._v(".")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("Create a wallet and generate 101 blocks.")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" createwallet "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("test")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"test"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"warning"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('""')]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" getnewaddress\nbcrt1qatd7yq0jukwusuaufltlejmeydpvnpv43r5gc2\n")])])]),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" generatetoaddress "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("101")]),a._v(" bcrt1qatd7yq0jukwusuaufltlejmeydpvnpv43r5gc2\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3813ed6eb716f4743b9657d918799acf743add985a8ded28d8aa3629dd4496b6"')]),a._v(",\n"),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"70da855913bdf791b6e458c611cebdef79b7a9840eb103ce58c71c1c7e3c49bc"')]),a._v(",\n"),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"682ca732ef72719cd6f82c5047c7690fb1cd2df2543d035ac4ea99e974b8d172"')]),a._v(",\n"),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"78799e4771017d4f46aa3c240054e2d61f54cea07ec44cb18ae712761e0aaa1e"')]),a._v(",\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n")])])]),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" getbalance\n"),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("50.00000000")]),a._v("\n")])])]),e("p",[a._v("Now the core wallet has generated new blocks and is funded with test bitcoin.")])])]),a._v(" "),e("h3",{attrs:{id:"bdk-wallet-generation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bdk-wallet-generation"}},[a._v("#")]),a._v(" BDK Wallet Generation")]),a._v(" "),e("p",[a._v("BDK is a descriptor based wallet library. So in order to use it we will need some descriptors to work with.")]),a._v(" "),e("p",[a._v("BDK wallet will ask for two descriptors as input, corresponding to "),e("code",[a._v("receive")]),a._v(" and "),e("code",[a._v("change")]),a._v(" addresses. Its recommended to have these two descriptors separate as BDK will handle them separately and ensure "),e("code",[a._v("change")]),a._v(" addresses are never used for receiving funds.")]),a._v(" "),e("p",[a._v("Or developers can decide to use a single descriptor too, in that case BDK will use that descriptor for deriving both "),e("code",[a._v("receive")]),a._v(" and "),e("code",[a._v("change")]),a._v(" addresses.")]),a._v(" "),e("p",[a._v("We will use "),e("code",[a._v("bdk-cli")]),a._v(" itself to generate such descriptors.")]),a._v(" "),e("ul",[e("li",[e("h4",{attrs:{id:"generate-a-privatekey"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#generate-a-privatekey"}},[a._v("#")]),a._v(" Generate a privatekey")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BDK_xprv")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key generate "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n$ "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_xprv")]),a._v("\ntprv8ZgxMBicQKsPefY7tdq7EKny81n9tfSvUYfSHAZByXdjPAZVysvaB6sFd2YavqfqMBgbHaXUG5oWM6sYvdJn6vnUizzQKTYAJ36bQsfPv4N\n")])])]),e("p",[e("code",[a._v("bdk-cli key generate")]),a._v(" will generate a fresh master key with "),e("code",[a._v("mnemonic")]),a._v(" and "),e("code",[a._v("xprv")]),a._v(". We have extracted the value of extended private key and stored it in "),e("code",[a._v("BDK_xprv")]),a._v(" variable.")]),a._v(" "),e("p",[a._v("The returned "),e("code",[a._v("mnemonic")]),a._v(" can be used to restore back the wallet if wallet data directory is lost.")])]),a._v(" "),e("li",[e("h4",{attrs:{id:"generate-descriptors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#generate-descriptors"}},[a._v("#")]),a._v(" Generate Descriptors")]),a._v(" "),e("p",[e("code",[a._v("bdk-cli key derive")]),a._v(" can derive an "),e("code",[a._v("xpub")]),a._v("s given a "),e("code",[a._v("master key")]),a._v(" and "),e("code",[a._v("derivation_path")]),a._v(".")]),a._v(" "),e("p",[a._v("We will use the following paths for our "),e("code",[a._v("receive")]),a._v(" and "),e("code",[a._v("change")]),a._v(" descriptors")]),a._v(" "),e("ul",[e("li",[e("code",[a._v("receive")]),a._v(" path: "),e("code",[a._v("m/84h/1h/0h/0")])]),a._v(" "),e("li",[e("code",[a._v("change")]),a._v(" path: "),e("code",[a._v("m/84h/1h/0h/1")]),a._v(",")])]),a._v(" "),e("p",[a._v("We can then simply wrap them in a "),e("code",[a._v('"wpkh()"')]),a._v(" to create our descriptors string and store them.")]),a._v(" "),e("p",[a._v("When asked for a new address, BDK will derive one from the "),e("code",[a._v("receive")]),a._v(" descriptor.")]),a._v(" "),e("p",[a._v("And while constructing transaction, BDK will use the "),e("code",[a._v("change")]),a._v(" descriptor to derive change address.")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BDK_recv_desc")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wpkh('),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" m/84h/1h/0h/0 "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $BDK_xprv "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v(')"')]),a._v("\n$ "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v("\nwpkh"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("ff09c7c9/84"),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'/1'")]),a._v("/0'/0"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("tprv8hkdEGgwLLnqsdfkJFidpTj5d6z5qFdP6Qwzsviea3HrS9C2mXXaDivPKCCgcaWvnGNX9eciLUQs91PWYXJqrChfnAagViCgG6L5phaNyWr/*"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n")])])]),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BDK_chng_desc")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wpkh('),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" m/84h/1h/0h/1 "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $BDK_xprv "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v(')"')]),a._v("\n$ "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v("\nwpkh"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("ff09c7c9/84"),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'/1'")]),a._v("/0'/1"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("tprv8hkdEGgwLLnqtbYkGG7fSy7v43RF2SQGGjNuZtmBzEHh7H8xgpXBETQAbVPqi8rkvLNFKLYY4rDzXA4fn5Ha1yuazZqhQPe3uNKmFS7648s/*"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n")])])]),e("p",[a._v("Note: "),e("code",[a._v("BDK_xprv")]),a._v(" has been used as the "),e("code",[a._v("master key")]),a._v(", this will allow BDK to have signing capabilities.\nWe could have used an "),e("code",[a._v("xpub")]),a._v(" master key here instead, that would create an "),e("code",[a._v("watch-only")]),a._v(" wallet.")])]),a._v(" "),e("li",[e("h4",{attrs:{id:"create-and-sync-a-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-and-sync-a-wallet"}},[a._v("#")]),a._v(" Create and Sync a wallet")]),a._v(" "),e("p",[a._v("We will now instruct BDK to create a new wallet with following instructions")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),e("ul",[e("li",[a._v("name ("),e("code",[a._v("--wallet")]),a._v(") "),e("code",[a._v("bdk-test")]),a._v(",")]),a._v(" "),e("li",[e("code",[a._v("receive")]),a._v(" descriptor ("),e("code",[a._v("-d")]),a._v(") as "),e("code",[a._v("$BDK_recv_desc")]),a._v(" and change descriptor ("),e("code",[a._v("-c")]),a._v(") as "),e("code",[a._v("$BDK_chng_desc")]),a._v(",")]),a._v(" "),e("li",[a._v("connected to a full node ("),e("code",[a._v("--node")]),a._v(") listening at "),e("code",[a._v("127.0.0.1:18444")]),a._v(",")]),a._v(" "),e("li",[a._v("and finally create and sync the wallet with the "),e("code",[a._v("sync")]),a._v(" command.")])]),a._v(" "),e("p",[a._v("If you are using a "),e("code",[a._v("regtest")]),a._v(" node, also add "),e("code",[a._v("--network regtest")]),a._v(", the default is "),e("code",[a._v("testnet")]),a._v(".")]),a._v(" "),e("p",[e("code",[a._v("bdk-cli")]),a._v(" makes multiple parallel connections that can be configured with the "),e("code",[a._v("--conn-count")]),a._v(" parameter (default is 4). This makes syncing parallel and fast. Use "),e("code",[a._v("bdk-cli --help")]),a._v(" to see all other options.")]),a._v(" "),e("p",[a._v("Getting an empty return means wallet creation succeeded.")]),a._v(" "),e("p",[a._v("BDK has created a wallet named "),e("code",[a._v("bdk-test")]),a._v(" in its data directory. Which is by default stored at "),e("code",[a._v("~/.bdk-bitcoin/compact_filters")]),a._v(" folder.")]),a._v(" "),e("p",[a._v("Looking into that folder different files and directories maintained by BDK can be seen.")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("ls")]),a._v(" .bdk-bitcoin/compact_filters/\n000004.log CURRENT LOCK MANIFEST-000003 OPTIONS-000010\nbdk-test IDENTITY LOG OPTIONS-000008\n")])])])])]),a._v(" "),e("h3",{attrs:{id:"recieve-coins"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#recieve-coins"}},[a._v("#")]),a._v(" Recieve Coins")]),a._v(" "),e("p",[a._v("We will use the "),e("code",[a._v("core")]),a._v(" wallet to send 5 BTC to our"),e("code",[a._v("bdk-test")]),a._v(" wallet.")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("Fetch a new address using "),e("code",[a._v("bdk-cli")])]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v(" get_new_address\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"address"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bcrt1qx2479wywulf50pqx5uy64zhxq9f3tuvlh8u0s9"')]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])])]),a._v(" "),e("li",[e("p",[a._v("Transfer funds to the previous address and generate a block, using "),e("code",[a._v("bitcoin-cli")])]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" sendtoaddress bcrt1qx2479wywulf50pqx5uy64zhxq9f3tuvlh8u0s9 "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("5")]),a._v("\n\n\n$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" generatetoaddress "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("1")]),a._v(" bcrt1qw3ht9xtc9pgyvmqay0ap9fw8mxd27az8el0uz3\n")])])]),e("p",[e("code",[a._v("core")]),a._v(" has sent 5 BTC to our "),e("code",[a._v("bdk-test")]),a._v(" wallet. Which is confirmed in a new block.")]),a._v(" "),e("p",[e("code",[a._v("bdk-test")]),a._v(" can see that now by syncing again.")]),a._v(" "),e("p",[a._v("(Note: BDK required explicit "),e("code",[a._v("sync()")]),a._v(" calls to give wallet developers flexibility on when to sync).")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n$ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v(" get_balance\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("500000000")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),e("p",[a._v("We can see "),e("code",[a._v("500000000")]),a._v(" sats balance in our "),e("code",[a._v("bdk-test")]),a._v(" wallet.")]),a._v(" "),e("p",[a._v("BDK has fetched blockchain details concerning its wallet descriptors, from the core node, using compact filters.")])])]),a._v(" "),e("h3",{attrs:{id:"creating-a-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#creating-a-transaction"}},[a._v("#")]),a._v(" Creating a transaction.")]),a._v(" "),e("p",[a._v("Now we want to create a transaction sending coins from "),e("code",[a._v("bdk-test")]),a._v(" wallet to the "),e("code",[a._v("core")]),a._v(" wallet.")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("fetch a new "),e("code",[a._v("core")]),a._v(" address")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("core_addrs")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" getnewaddress "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("tr")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'\\r'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])])]),a._v(" "),e("li",[e("p",[a._v("Create a raw transaction using "),e("code",[a._v("bdk-cli")]),a._v(" to the above address. This will generate a "),e("code",[a._v("psbt")]),a._v(" which we will sign.")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("psbt")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $BDK_recv_desc "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" $BDK_chng_desc create_tx "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" $core_addrs:200000000 "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.psbt'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])]),e("p",[a._v("(Recommended to check all the other information returned by "),e("code",[a._v("bdk-cli create_tx")]),a._v(")")])])]),a._v(" "),e("h3",{attrs:{id:"sign-and-broadcast-the-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#sign-and-broadcast-the-transaction"}},[a._v("#")]),a._v(" Sign and Broadcast the transaction")]),a._v(" "),e("p",[a._v("Asking BDK to sign a transaction is as straight forward as it can get. BDK already holds the "),e("code",[a._v("xprv")]),a._v(" deatils to sign a transaction. It returns a finalised "),e("code",[a._v("signed_psbt")]),a._v(" which we will next broadcast to the network.")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("Sign the transaction")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("signed_psbt")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $BDK_recv_desc "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" $BDK_chng_desc sign "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $psbt "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.psbt'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])])]),a._v(" "),e("li",[e("p",[a._v("Broadcast the transaction")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v(" broadcast "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$signed_psbt")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"c343f5b25372e285308eba912d1fe8fade9f64afde6d95306e248e52e0852252"')]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),e("p",[a._v("This makes BDK broadcast the transaction via the connected core node, and it returns the corresponding Txid.")])])]),a._v(" "),e("h3",{attrs:{id:"confirming-the-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#confirming-the-transaction"}},[a._v("#")]),a._v(" Confirming the Transaction")]),a._v(" "),e("p",[a._v("The transaction has been received by the "),e("code",[a._v("core")]),a._v(" node and waiting in its mempool for inclusion in block.\nWe can see the transaction via its "),e("code",[a._v("txid")]),a._v(" received in previous step.")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("Check transaction in mempool")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" gettransaction c343f5b25372e285308eba912d1fe8fade9f64afde6d95306e2248e52e0852252\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"amount"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("2.00000000")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"confirmations"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"trusted"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" false,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"c343f5b25372e285308eba912d1fe8fade9f64afde6d95306e248e52e0852252"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"walletconflicts"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"time"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("1621697202")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"timereceived"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("1621697202")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bip125-replaceable"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"no"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"details"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"address"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bcrt1q3h4hs6mve5dcl7da3d4acmlp20hh8c3t4mldwe"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"category"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"receive"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"amount"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("2.00000000")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"label"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('""')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"vout"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("1")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"hex"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"01000000000101d84e8cb7477f9fe6f265b56d5416ff47da9a70be18f65ec50731b8257c67f2bd0100000000ffffffff0273a2e11100000000160014874270187001febc4cebd8cb083cf2c783e8f1ac00c2eb0b000000001600148deb786b6ccd1b8ff9bd8b6bdc6fe153ef73e22b0247304402201037d9ef5b80392296311c8899b1f12a0987778d694a442a88bafa6fbd7a7c9a022011293176255897444d9c71b0b9cd13b2aedb749b142577566c90a63d61025e2c01210202427d16b29c1c8546255363a74326ee9ab3196770bb3fccc7b679d52f9c1ccf00000000"')]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),e("p",[a._v("This means, core has recieved the transaction in its mempool and waiting for confirmation.")])]),a._v(" "),e("li",[e("p",[a._v("Generate 1 block to confirm the transaction")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" generatetoaddress "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("1")]),a._v(" bcrt1qatd7yq0jukwusuaufltlejmeydpvnpv43r5gc2\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"55436ff0169bbb3e70ab10cb7cdd45ab86204d5d7864a109142d91120d023197"')]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n")])])])]),a._v(" "),e("li",[e("p",[a._v("Sync the "),e("code",[a._v("bdk-test")]),a._v(" wallet and ask for available balance.")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v(" $ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n $ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v(" get_balance\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n \t"),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("299999859")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),e("p",[a._v("If you see the balance updated, voila!")]),a._v(" "),e("p",[a._v("What happened here is:")]),a._v(" "),e("ul",[e("li",[a._v("core created a new block containing the transaction.")]),a._v(" "),e("li",[e("code",[a._v("bdk-cli")]),a._v(" fetched the corresponding filter data.")]),a._v(" "),e("li",[a._v("It noticed it got a concerning transaction.")]),a._v(" "),e("li",[a._v("It asked for the details of that transaction from the core node.")]),a._v(" "),e("li",[a._v("It updated its wallet details with this new information.")]),a._v(" "),e("li",[a._v("The update is reflected in the wallet balance.")])])])]),a._v(" "),e("h3",{attrs:{id:"shutdown-docker"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#shutdown-docker"}},[a._v("#")]),a._v(" Shutdown Docker")]),a._v(" "),e("p",[a._v("You may now shutdown the regtest docker container.")]),a._v(" "),e("p",[a._v("Note: This will also clean up any data in the bitcoin core, including the wallet.")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("kill")]),a._v(" bdk-box\n")])])]),e("h2",{attrs:{id:"end-words"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#end-words"}},[a._v("#")]),a._v(" End Words")]),a._v(" "),e("p",[a._v("In this tutorial we went through the process of receiving, creating, signing and broadcasting transaction using the BDK wallet with "),e("code",[a._v("compact_filters")]),a._v(" feature. This demonstrates how BDK capabilities can be used to create SPV light wallets with integrated "),e("code",[a._v("BIP157")]),a._v(" type "),e("code",[a._v("compact_filters")]),a._v(" node.")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{392:function(a,e,t){"use strict";t.r(e);var s=t(7),r=Object(s.a)({},(function(){var a=this,e=a._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),e("h3",{attrs:{id:"compact-filters"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#compact-filters"}},[a._v("#")]),a._v(" Compact Filters:")]),a._v(" "),e("p",[a._v("Compact filters are the latest specification of Bitcoin SPV node implementation as per "),e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP157"),e("OutboundLink")],1),a._v(" and "),e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP158"),e("OutboundLink")],1),a._v(". Such light clients were envisioned by Satoshi himself in his original white paper, but due to lack of robust privacy and trust guarantees using conventional "),e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[a._v("bloomfilters"),e("OutboundLink")],1),a._v(", these type of nodes never got popular.")]),a._v(" "),e("p",[a._v("Enters "),e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP157"),e("OutboundLink")],1),a._v(", which described a new type of filters for Bitcoin Blockchain data, known as "),e("code",[a._v("compact_filters")]),a._v(". The "),e("a",{attrs:{href:"https://github.com/lightninglabs/neutrino",target:"_blank",rel:"noopener noreferrer"}},[a._v("Neutrino"),e("OutboundLink")],1),a._v(' project pioneered the use of compact filter based light client nodes for using with Lightning Network wallets. Using compact filters, a light-node can talk to one or more full nodes, and fetch relevant information from the blockchain, with much more robust privacy and security guarantees than previously possible. Compact filter based nodes are best suitable to be used with mobile wallets, to create more trustless mobile applications on Bitcoin. Any wallet application that needs to have an "eye on the blockchain" has an use for such light clients.')]),a._v(" "),e("p",[e("code",[a._v("BIP157")]),a._v(" type filters allows to create tiny sized SPV nodes, that can fetch blockchain data and can identify inconsistency, so it can actively defend itself, while also preserving its privacy. Such nodes are most useful for Lightning Network mobile applications.")]),a._v(" "),e("p",[a._v("Example of such "),e("code",[a._v("compact_filters")]),a._v(" wallets in wild is "),e("a",{attrs:{href:"https://github.com/breez/breezmobile",target:"_blank",rel:"noopener noreferrer"}},[a._v("Breeze"),e("OutboundLink")],1),a._v(" Lightning mobile wallet.")]),a._v(" "),e("p",[a._v("Bitcoin core supports serving "),e("code",[a._v("BIP157")]),a._v(" type filters from "),e("code",[a._v("v0.21.0")]),a._v(".")]),a._v(" "),e("h3",{attrs:{id:"bdk-and-compact-filters"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bdk-and-compact-filters"}},[a._v("#")]),a._v(" BDK and Compact filters")]),a._v(" "),e("p",[a._v("BDK is a bitcoin wallet development library that can be used to create bitcoin wallets with custom "),e("code",[a._v("Database")]),a._v(" and "),e("code",[a._v("Blockchain")]),a._v(" backends. BDK is a "),e("a",{attrs:{href:"https://bitcoindevkit.org/descriptors/",target:"_blank",rel:"noopener noreferrer"}},[a._v("descriptor"),e("OutboundLink")],1),a._v(" based wallet, i.e. the wallet keychain is described by a set of descriptors.")]),a._v(" "),e("p",[a._v("Using BDK one can instantiate wallets of various kinds as per requirement. BDK abstracts away all the heavy lifting works, and allow wallet devs to concentrate on logic that they care about, i.e. writing wallet codes. For more detailed documentation on BDK capabilities check these "),e("a",{attrs:{href:"https://bitcoindevkit.org/blog/2020/12/hello-world/",target:"_blank",rel:"noopener noreferrer"}},[a._v("blog"),e("OutboundLink")],1),a._v(", "),e("a",{attrs:{href:"https://bitcoindevkit.org/blog/2020/11/descriptors-in-the-wild/",target:"_blank",rel:"noopener noreferrer"}},[a._v("bog"),e("OutboundLink")],1),a._v(" and "),e("a",{attrs:{href:"https://docs.rs/bdk/",target:"_blank",rel:"noopener noreferrer"}},[a._v("docs"),e("OutboundLink")],1),a._v(".")]),a._v(" "),e("p",[a._v("The main three components of abstraction in BDK are")]),a._v(" "),e("ul",[e("li",[e("code",[a._v("Database")])]),a._v(" "),e("li",[e("code",[a._v("Descriptors")])]),a._v(" "),e("li",[e("code",[a._v("Blockchain")])])]),a._v(" "),e("p",[a._v("BDK comes with default implementations of all them that developers can start with out of the box. Developers can also create their own custom implementations and plug it into BDK (thanks to rust magic of "),e("code",[a._v("Traits")]),a._v(").")]),a._v(" "),e("p",[a._v("BDK also supports "),e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP158"),e("OutboundLink")],1),a._v(" communication protocol, which allows creation of "),e("code",[a._v("BIP157")]),a._v(" type compact filter SPV nodes. This capability is extended to wallet with BDK's "),e("code",[a._v("Blockchain")]),a._v(" data structure. The "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a._v("API"),e("OutboundLink")],1),a._v(" for "),e("code",[a._v("compact_filters")]),a._v(" backend is similar to any other kind of backends, so wallet devs don't need to worry about all the details. Its ok if the dev haven't even heard of "),e("code",[a._v("BIP157")]),a._v(", BDK takes care of that in background.")]),a._v(" "),e("p",[a._v("This capability can be unlocked by compiling BDK with the "),e("code",[a._v("compact_filters")]),a._v(" feature. Once enabled, BDK will be able to create wallets with the "),e("code",[a._v("compact_filters")]),a._v(" type "),e("code",[a._v("Blockchain")]),a._v(" backend. (The default backend is electrum server)")]),a._v(" "),e("h3",{attrs:{id:"bdk-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bdk-cli"}},[a._v("#")]),a._v(" bdk-cli")]),a._v(" "),e("p",[e("code",[a._v("bdk-cli")]),a._v(" is a lightweight "),e("a",{attrs:{href:"https://codewith.mu/en/tutorials/1.0/repl",target:"_blank",rel:"noopener noreferrer"}},[a._v("REPL"),e("OutboundLink")],1),a._v(" wrapper over the BDK library to facilitate quick and easy demonstration of BDK capabilities in command-line. Wallet devs can use this tool to quickly try out different possibilities with BDK.")]),a._v(" "),e("p",[a._v("In this tutorial, We will use "),e("code",[a._v("bdk-cli")]),a._v(" to demonstrate some basic wallet functionalities using "),e("code",[a._v("compact_filters")]),a._v(" backend.")]),a._v(" "),e("h2",{attrs:{id:"tutorial-scope"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tutorial-scope"}},[a._v("#")]),a._v(" Tutorial Scope")]),a._v(" "),e("p",[a._v("Basic wallet workflow we will cover:")]),a._v(" "),e("ul",[e("li",[a._v("create and sync a wallet,")]),a._v(" "),e("li",[a._v("receive a transaction,")]),a._v(" "),e("li",[a._v("create a transaction,")]),a._v(" "),e("li",[a._v("sign and broadcast the transaction,")]),a._v(" "),e("li",[a._v("fetch updated balance,")])]),a._v(" "),e("p",[a._v("The BDK wallet will have a "),e("code",[a._v("BIP157")]),a._v(" SPV backend (aka "),e("code",[a._v("compact_filters")]),a._v(" backend) that will connect with a Bitcoin core node serving filter data.")]),a._v(" "),e("p",[a._v("It will publish and extract transaction data through that node.")]),a._v(" "),e("p",[a._v("We will have a Bitcoin Core wallet and a BDK wallet, sending and receiving transactions between each other, in regtest.")]),a._v(" "),e("h2",{attrs:{id:"prerequisites"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites"}},[a._v("#")]),a._v(" Prerequisites")]),a._v(" "),e("p",[a._v("Following things are required to start with the tutorial.")]),a._v(" "),e("ol",[e("li",[a._v("A Bitcoin Core regtest node listening at "),e("code",[a._v("localhost:18444")]),a._v(" signalling for compact filter support.")]),a._v(" "),e("li",[e("code",[a._v("bdk-cli")]),a._v(" compiled with "),e("code",[a._v("compact_filter")]),a._v(" features.")])]),a._v(" "),e("p",[a._v("If you already have these two setup and working, you can skip this and jump to the "),e("a",{attrs:{href:"#tutorial"}},[a._v("Tutorial")]),a._v(" section.")]),a._v(" "),e("h3",{attrs:{id:"install-and-run-bitcoind"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#install-and-run-bitcoind"}},[a._v("#")]),a._v(" Install and run "),e("code",[a._v("bitcoind")])]),a._v(" "),e("p",[a._v("You can definitely do it with your own "),e("code",[a._v("bitcoind")]),a._v(" installation. "),e("code",[a._v("BIP157")]),a._v(" support has been included in Bitcoin Core "),e("code",[a._v("v0.21.0")]),a._v(". So anything above that will work.")]),a._v(" "),e("p",[a._v("You also need to ensure proper configuration settings for signalling "),e("code",[a._v("compact_filters")]),a._v(" support.")]),a._v(" "),e("p",[a._v("For ease of testing, the BDK project hosts docker images that can be used to spawn Bitcoin Core with all the relevant configurations.")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("spawn a regtest node using "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bitcoin-regtest-box",target:"_blank",rel:"noopener noreferrer"}},[a._v("bitcoin-regtest-box"),e("OutboundLink")],1),a._v(" docker file.")]),a._v(" "),e("p",[a._v("Start the regtest box docker container.")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" run "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--detach")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--rm")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-p")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("127.0")]),a._v(".0.1:18443-18444:18443-18444/tcp "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--name")]),a._v(" bdk-box bitcoindevkit/bitcoind\n")])])]),e("p",[a._v("This will spin up a docker container running "),e("code",[a._v("bicoind")]),a._v(" and listening to port "),e("code",[a._v("18444")]),a._v(" and "),e("code",[a._v("18333")]),a._v(". You can keep this terminal alive to see communication events with BDK and the node.")])]),a._v(" "),e("li",[e("p",[a._v("Check node is reachable")]),a._v(" "),e("p",[a._v("In another terminal try connecting to the node with "),e("code",[a._v("bitcoin-cli")])]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" getnetworkinfo\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"version"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("210000")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"subversion"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"/Satoshi:0.21.1/"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"protocolversion"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("70016")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"localservices"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0000000000000449"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"localservicesnames"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NETWORK"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"WITNESS"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"COMPACT_FILTERS"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NETWORK_LIMITED"')]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n")])])]),e("p",[a._v("In the output, the "),e("code",[a._v("version")]),a._v(" should show "),e("code",[a._v("210000")]),a._v(". "),e("code",[a._v("localservicesnames")]),a._v(" should contain "),e("code",[a._v('"COMPACT_FILTERS"')]),a._v(". If you see this, then Bitcoin Core is correctly configured.")])])]),a._v(" "),e("h3",{attrs:{id:"install-and-run-bdk-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#install-and-run-bdk-cli"}},[a._v("#")]),a._v(" Install and run bdk-cli")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("Install "),e("code",[a._v("bdk-cli")]),a._v(" with "),e("code",[a._v("compact_filters")]),a._v(" feature")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("cargo")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--git")]),a._v(" https://github.com/bitcoindevkit/bdk-cli.git bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--features")]),a._v(" compact_filters\n")])])])]),a._v(" "),e("li",[e("p",[a._v("Check installation")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--help")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\nUSAGE:\n bdk-cli "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("OPTIONS"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("SUBCOMMAND"),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v("\nFLAGS:\n -h, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--help")]),a._v(" Prints "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("help")]),a._v(" information\n -V, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--version")]),a._v(" Prints version information\nOPTIONS:\n -n, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("NETWORK"),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v(" Sets the network "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("default: testnet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n\nSUBCOMMANDS:\n "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("help")]),a._v(" Prints this message or the "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("help")]),a._v(" of the given subcommand"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),a._v("s"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n key Key management sub-commands\n repl Enter REPL "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("command")]),a._v(" loop mode\n wallet Wallet options and sub-commands\n")])])])])]),a._v(" "),e("p",[a._v("Once these are setup correctly, you can start with the tutorial next.")]),a._v(" "),e("h2",{attrs:{id:"tutorial"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tutorial"}},[a._v("#")]),a._v(" Tutorial")]),a._v(" "),e("p",[a._v("[Note: For brevity "),e("code",[a._v("bdk-cli")]),a._v(" results are stored in command line variables using "),e("code",[a._v("jq")]),a._v(" tool. It is recommended to check the full results to see different information returned by "),e("code",[a._v("bdk-cli")]),a._v(" commands.]")]),a._v(" "),e("h3",{attrs:{id:"bitcoin-core-wallet-generation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-core-wallet-generation"}},[a._v("#")]),a._v(" Bitcoin Core Wallet Generation")]),a._v(" "),e("p",[a._v("This is standard procedure with "),e("code",[a._v("bitcoin-cli")]),a._v(".")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("Create a wallet and generate 101 blocks.")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" createwallet "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("test")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"test"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"warning"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('""')]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" getnewaddress\nbcrt1qatd7yq0jukwusuaufltlejmeydpvnpv43r5gc2\n")])])]),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" generatetoaddress "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("101")]),a._v(" bcrt1qatd7yq0jukwusuaufltlejmeydpvnpv43r5gc2\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3813ed6eb716f4743b9657d918799acf743add985a8ded28d8aa3629dd4496b6"')]),a._v(",\n"),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"70da855913bdf791b6e458c611cebdef79b7a9840eb103ce58c71c1c7e3c49bc"')]),a._v(",\n"),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"682ca732ef72719cd6f82c5047c7690fb1cd2df2543d035ac4ea99e974b8d172"')]),a._v(",\n"),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"78799e4771017d4f46aa3c240054e2d61f54cea07ec44cb18ae712761e0aaa1e"')]),a._v(",\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n")])])]),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" getbalance\n"),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("50.00000000")]),a._v("\n")])])]),e("p",[a._v("Now the core wallet has generated new blocks and is funded with test bitcoin.")])])]),a._v(" "),e("h3",{attrs:{id:"bdk-wallet-generation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bdk-wallet-generation"}},[a._v("#")]),a._v(" BDK Wallet Generation")]),a._v(" "),e("p",[a._v("BDK is a descriptor based wallet library. So in order to use it we will need some descriptors to work with.")]),a._v(" "),e("p",[a._v("BDK wallet will ask for two descriptors as input, corresponding to "),e("code",[a._v("receive")]),a._v(" and "),e("code",[a._v("change")]),a._v(" addresses. Its recommended to have these two descriptors separate as BDK will handle them separately and ensure "),e("code",[a._v("change")]),a._v(" addresses are never used for receiving funds.")]),a._v(" "),e("p",[a._v("Or developers can decide to use a single descriptor too, in that case BDK will use that descriptor for deriving both "),e("code",[a._v("receive")]),a._v(" and "),e("code",[a._v("change")]),a._v(" addresses.")]),a._v(" "),e("p",[a._v("We will use "),e("code",[a._v("bdk-cli")]),a._v(" itself to generate such descriptors.")]),a._v(" "),e("ul",[e("li",[e("h4",{attrs:{id:"generate-a-privatekey"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#generate-a-privatekey"}},[a._v("#")]),a._v(" Generate a privatekey")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BDK_xprv")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key generate "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n$ "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_xprv")]),a._v("\ntprv8ZgxMBicQKsPefY7tdq7EKny81n9tfSvUYfSHAZByXdjPAZVysvaB6sFd2YavqfqMBgbHaXUG5oWM6sYvdJn6vnUizzQKTYAJ36bQsfPv4N\n")])])]),e("p",[e("code",[a._v("bdk-cli key generate")]),a._v(" will generate a fresh master key with "),e("code",[a._v("mnemonic")]),a._v(" and "),e("code",[a._v("xprv")]),a._v(". We have extracted the value of extended private key and stored it in "),e("code",[a._v("BDK_xprv")]),a._v(" variable.")]),a._v(" "),e("p",[a._v("The returned "),e("code",[a._v("mnemonic")]),a._v(" can be used to restore back the wallet if wallet data directory is lost.")])]),a._v(" "),e("li",[e("h4",{attrs:{id:"generate-descriptors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#generate-descriptors"}},[a._v("#")]),a._v(" Generate Descriptors")]),a._v(" "),e("p",[e("code",[a._v("bdk-cli key derive")]),a._v(" can derive an "),e("code",[a._v("xpub")]),a._v("s given a "),e("code",[a._v("master key")]),a._v(" and "),e("code",[a._v("derivation_path")]),a._v(".")]),a._v(" "),e("p",[a._v("We will use the following paths for our "),e("code",[a._v("receive")]),a._v(" and "),e("code",[a._v("change")]),a._v(" descriptors")]),a._v(" "),e("ul",[e("li",[e("code",[a._v("receive")]),a._v(" path: "),e("code",[a._v("m/84h/1h/0h/0")])]),a._v(" "),e("li",[e("code",[a._v("change")]),a._v(" path: "),e("code",[a._v("m/84h/1h/0h/1")]),a._v(",")])]),a._v(" "),e("p",[a._v("We can then simply wrap them in a "),e("code",[a._v('"wpkh()"')]),a._v(" to create our descriptors string and store them.")]),a._v(" "),e("p",[a._v("When asked for a new address, BDK will derive one from the "),e("code",[a._v("receive")]),a._v(" descriptor.")]),a._v(" "),e("p",[a._v("And while constructing transaction, BDK will use the "),e("code",[a._v("change")]),a._v(" descriptor to derive change address.")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BDK_recv_desc")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wpkh('),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" m/84h/1h/0h/0 "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $BDK_xprv "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v(')"')]),a._v("\n$ "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v("\nwpkh"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("ff09c7c9/84"),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'/1'")]),a._v("/0'/0"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("tprv8hkdEGgwLLnqsdfkJFidpTj5d6z5qFdP6Qwzsviea3HrS9C2mXXaDivPKCCgcaWvnGNX9eciLUQs91PWYXJqrChfnAagViCgG6L5phaNyWr/*"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n")])])]),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BDK_chng_desc")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wpkh('),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" m/84h/1h/0h/1 "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $BDK_xprv "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v(')"')]),a._v("\n$ "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v("\nwpkh"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("ff09c7c9/84"),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'/1'")]),a._v("/0'/1"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("tprv8hkdEGgwLLnqtbYkGG7fSy7v43RF2SQGGjNuZtmBzEHh7H8xgpXBETQAbVPqi8rkvLNFKLYY4rDzXA4fn5Ha1yuazZqhQPe3uNKmFS7648s/*"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n")])])]),e("p",[a._v("Note: "),e("code",[a._v("BDK_xprv")]),a._v(" has been used as the "),e("code",[a._v("master key")]),a._v(", this will allow BDK to have signing capabilities.\nWe could have used an "),e("code",[a._v("xpub")]),a._v(" master key here instead, that would create an "),e("code",[a._v("watch-only")]),a._v(" wallet.")])]),a._v(" "),e("li",[e("h4",{attrs:{id:"create-and-sync-a-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-and-sync-a-wallet"}},[a._v("#")]),a._v(" Create and Sync a wallet")]),a._v(" "),e("p",[a._v("We will now instruct BDK to create a new wallet with following instructions")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),e("ul",[e("li",[a._v("name ("),e("code",[a._v("--wallet")]),a._v(") "),e("code",[a._v("bdk-test")]),a._v(",")]),a._v(" "),e("li",[e("code",[a._v("receive")]),a._v(" descriptor ("),e("code",[a._v("-d")]),a._v(") as "),e("code",[a._v("$BDK_recv_desc")]),a._v(" and change descriptor ("),e("code",[a._v("-c")]),a._v(") as "),e("code",[a._v("$BDK_chng_desc")]),a._v(",")]),a._v(" "),e("li",[a._v("connected to a full node ("),e("code",[a._v("--node")]),a._v(") listening at "),e("code",[a._v("127.0.0.1:18444")]),a._v(",")]),a._v(" "),e("li",[a._v("and finally create and sync the wallet with the "),e("code",[a._v("sync")]),a._v(" command.")])]),a._v(" "),e("p",[a._v("If you are using a "),e("code",[a._v("regtest")]),a._v(" node, also add "),e("code",[a._v("--network regtest")]),a._v(", the default is "),e("code",[a._v("testnet")]),a._v(".")]),a._v(" "),e("p",[e("code",[a._v("bdk-cli")]),a._v(" makes multiple parallel connections that can be configured with the "),e("code",[a._v("--conn-count")]),a._v(" parameter (default is 4). This makes syncing parallel and fast. Use "),e("code",[a._v("bdk-cli --help")]),a._v(" to see all other options.")]),a._v(" "),e("p",[a._v("Getting an empty return means wallet creation succeeded.")]),a._v(" "),e("p",[a._v("BDK has created a wallet named "),e("code",[a._v("bdk-test")]),a._v(" in its data directory. Which is by default stored at "),e("code",[a._v("~/.bdk-bitcoin/compact_filters")]),a._v(" folder.")]),a._v(" "),e("p",[a._v("Looking into that folder different files and directories maintained by BDK can be seen.")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("ls")]),a._v(" .bdk-bitcoin/compact_filters/\n000004.log CURRENT LOCK MANIFEST-000003 OPTIONS-000010\nbdk-test IDENTITY LOG OPTIONS-000008\n")])])])])]),a._v(" "),e("h3",{attrs:{id:"recieve-coins"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#recieve-coins"}},[a._v("#")]),a._v(" Recieve Coins")]),a._v(" "),e("p",[a._v("We will use the "),e("code",[a._v("core")]),a._v(" wallet to send 5 BTC to our"),e("code",[a._v("bdk-test")]),a._v(" wallet.")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("Fetch a new address using "),e("code",[a._v("bdk-cli")])]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v(" get_new_address\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"address"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bcrt1qx2479wywulf50pqx5uy64zhxq9f3tuvlh8u0s9"')]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])])]),a._v(" "),e("li",[e("p",[a._v("Transfer funds to the previous address and generate a block, using "),e("code",[a._v("bitcoin-cli")])]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" sendtoaddress bcrt1qx2479wywulf50pqx5uy64zhxq9f3tuvlh8u0s9 "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("5")]),a._v("\n\n\n$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" generatetoaddress "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("1")]),a._v(" bcrt1qw3ht9xtc9pgyvmqay0ap9fw8mxd27az8el0uz3\n")])])]),e("p",[e("code",[a._v("core")]),a._v(" has sent 5 BTC to our "),e("code",[a._v("bdk-test")]),a._v(" wallet. Which is confirmed in a new block.")]),a._v(" "),e("p",[e("code",[a._v("bdk-test")]),a._v(" can see that now by syncing again.")]),a._v(" "),e("p",[a._v("(Note: BDK required explicit "),e("code",[a._v("sync()")]),a._v(" calls to give wallet developers flexibility on when to sync).")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n$ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v(" get_balance\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("500000000")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),e("p",[a._v("We can see "),e("code",[a._v("500000000")]),a._v(" sats balance in our "),e("code",[a._v("bdk-test")]),a._v(" wallet.")]),a._v(" "),e("p",[a._v("BDK has fetched blockchain details concerning its wallet descriptors, from the core node, using compact filters.")])])]),a._v(" "),e("h3",{attrs:{id:"creating-a-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#creating-a-transaction"}},[a._v("#")]),a._v(" Creating a transaction.")]),a._v(" "),e("p",[a._v("Now we want to create a transaction sending coins from "),e("code",[a._v("bdk-test")]),a._v(" wallet to the "),e("code",[a._v("core")]),a._v(" wallet.")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("fetch a new "),e("code",[a._v("core")]),a._v(" address")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("core_addrs")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" getnewaddress "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("tr")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'\\r'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])])]),a._v(" "),e("li",[e("p",[a._v("Create a raw transaction using "),e("code",[a._v("bdk-cli")]),a._v(" to the above address. This will generate a "),e("code",[a._v("psbt")]),a._v(" which we will sign.")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("psbt")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $BDK_recv_desc "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" $BDK_chng_desc create_tx "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" $core_addrs:200000000 "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.psbt'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])]),e("p",[a._v("(Recommended to check all the other information returned by "),e("code",[a._v("bdk-cli create_tx")]),a._v(")")])])]),a._v(" "),e("h3",{attrs:{id:"sign-and-broadcast-the-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#sign-and-broadcast-the-transaction"}},[a._v("#")]),a._v(" Sign and Broadcast the transaction")]),a._v(" "),e("p",[a._v("Asking BDK to sign a transaction is as straight forward as it can get. BDK already holds the "),e("code",[a._v("xprv")]),a._v(" deatils to sign a transaction. It returns a finalised "),e("code",[a._v("signed_psbt")]),a._v(" which we will next broadcast to the network.")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("Sign the transaction")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("signed_psbt")]),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $BDK_recv_desc "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" $BDK_chng_desc sign "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $psbt "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.psbt'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])])]),a._v(" "),e("li",[e("p",[a._v("Broadcast the transaction")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v(" broadcast "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$signed_psbt")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"c343f5b25372e285308eba912d1fe8fade9f64afde6d95306e248e52e0852252"')]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),e("p",[a._v("This makes BDK broadcast the transaction via the connected core node, and it returns the corresponding Txid.")])])]),a._v(" "),e("h3",{attrs:{id:"confirming-the-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#confirming-the-transaction"}},[a._v("#")]),a._v(" Confirming the Transaction")]),a._v(" "),e("p",[a._v("The transaction has been received by the "),e("code",[a._v("core")]),a._v(" node and waiting in its mempool for inclusion in block.\nWe can see the transaction via its "),e("code",[a._v("txid")]),a._v(" received in previous step.")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("Check transaction in mempool")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" gettransaction c343f5b25372e285308eba912d1fe8fade9f64afde6d95306e2248e52e0852252\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"amount"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("2.00000000")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"confirmations"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"trusted"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" false,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"c343f5b25372e285308eba912d1fe8fade9f64afde6d95306e248e52e0852252"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"walletconflicts"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"time"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("1621697202")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"timereceived"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("1621697202")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bip125-replaceable"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"no"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"details"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"address"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"bcrt1q3h4hs6mve5dcl7da3d4acmlp20hh8c3t4mldwe"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"category"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"receive"')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"amount"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("2.00000000")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"label"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('""')]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"vout"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("1")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"hex"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"01000000000101d84e8cb7477f9fe6f265b56d5416ff47da9a70be18f65ec50731b8257c67f2bd0100000000ffffffff0273a2e11100000000160014874270187001febc4cebd8cb083cf2c783e8f1ac00c2eb0b000000001600148deb786b6ccd1b8ff9bd8b6bdc6fe153ef73e22b0247304402201037d9ef5b80392296311c8899b1f12a0987778d694a442a88bafa6fbd7a7c9a022011293176255897444d9c71b0b9cd13b2aedb749b142577566c90a63d61025e2c01210202427d16b29c1c8546255363a74326ee9ab3196770bb3fccc7b679d52f9c1ccf00000000"')]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),e("p",[a._v("This means, core has recieved the transaction in its mempool and waiting for confirmation.")])]),a._v(" "),e("li",[e("p",[a._v("Generate 1 block to confirm the transaction")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exec")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-it")]),a._v(" bdk-box /root/bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-regtest")]),a._v(" generatetoaddress "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("1")]),a._v(" bcrt1qatd7yq0jukwusuaufltlejmeydpvnpv43r5gc2\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"55436ff0169bbb3e70ab10cb7cdd45ab86204d5d7864a109142d91120d023197"')]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n")])])])]),a._v(" "),e("li",[e("p",[a._v("Sync the "),e("code",[a._v("bdk-test")]),a._v(" wallet and ask for available balance.")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v(" $ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n $ bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--network")]),a._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--node")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"127.0.0.1:18444"')]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--wallet")]),a._v(" bdk-test "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_recv_desc")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-c")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BDK_chng_desc")]),a._v(" get_balance\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n \t"),e("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[a._v("299999859")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),e("p",[a._v("If you see the balance updated, voila!")]),a._v(" "),e("p",[a._v("What happened here is:")]),a._v(" "),e("ul",[e("li",[a._v("core created a new block containing the transaction.")]),a._v(" "),e("li",[e("code",[a._v("bdk-cli")]),a._v(" fetched the corresponding filter data.")]),a._v(" "),e("li",[a._v("It noticed it got a concerning transaction.")]),a._v(" "),e("li",[a._v("It asked for the details of that transaction from the core node.")]),a._v(" "),e("li",[a._v("It updated its wallet details with this new information.")]),a._v(" "),e("li",[a._v("The update is reflected in the wallet balance.")])])])]),a._v(" "),e("h3",{attrs:{id:"shutdown-docker"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#shutdown-docker"}},[a._v("#")]),a._v(" Shutdown Docker")]),a._v(" "),e("p",[a._v("You may now shutdown the regtest docker container.")]),a._v(" "),e("p",[a._v("Note: This will also clean up any data in the bitcoin core, including the wallet.")]),a._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[a._v("$ "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("docker")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("kill")]),a._v(" bdk-box\n")])])]),e("h2",{attrs:{id:"end-words"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#end-words"}},[a._v("#")]),a._v(" End Words")]),a._v(" "),e("p",[a._v("In this tutorial we went through the process of receiving, creating, signing and broadcasting transaction using the BDK wallet with "),e("code",[a._v("compact_filters")]),a._v(" feature. This demonstrates how BDK capabilities can be used to create SPV light wallets with integrated "),e("code",[a._v("BIP157")]),a._v(" type "),e("code",[a._v("compact_filters")]),a._v(" node.")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/45.251f6700.js b/assets/js/45.41387e37.js similarity index 99% rename from assets/js/45.251f6700.js rename to assets/js/45.41387e37.js index 9be704531f..04e953750d 100644 --- a/assets/js/45.251f6700.js +++ b/assets/js/45.41387e37.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[45],{393:function(e,t,a){"use strict";a.r(t);var s=a(7),r=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("In this post, we will use the "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" tool to create a multi-owned descriptor-based paper wallet. We will use "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk"),t("OutboundLink")],1),e._v(" via the "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" tool to test our descriptor and to be able to sweep the funds from our paper wallet to a new address.")]),e._v(" "),t("h2",{attrs:{id:"about-paper-wallets"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#about-paper-wallets"}},[e._v("#")]),e._v(" About paper wallets")]),e._v(" "),t("p",[e._v("Paper wallets have a lot of drawbacks, as explained in the "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/Paper_wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("paper wallet Wiki article"),t("OutboundLink")],1),e._v(", as always, do your own research before deciding to use it with mainnet bitcoins. In this post we will\nonly be using testnet coins.")]),e._v(" "),t("h2",{attrs:{id:"descriptors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#descriptors"}},[e._v("#")]),e._v(" Descriptors")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet/tree/339fa4418d94f6fdd96f3d0301cab8a0bc09e8bd",target:"_blank",rel:"noopener noreferrer"}},[e._v("previous version"),t("OutboundLink")],1),e._v(" of the "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" followed the original paper wallet design: WIF"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v(" as secret part with the option to generate a different kind of addresses (legacy, nested segwit, and segwit).")]),e._v(" "),t("p",[e._v("There were plans to "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet/issues/5",target:"_blank",rel:"noopener noreferrer"}},[e._v("support mnemonic"),t("OutboundLink")],1),e._v(" instead of WIF keys because it may"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn2",id:"fnref2"}},[e._v("[2]")])]),e._v(" save the sweep transaction"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn3",id:"fnref3"}},[e._v("[3]")])]),e._v(" and there are more wallets capable of importing a mnemonic instead of a WIF.")]),e._v(" "),t("p",[e._v("However, choosing a single address type or having wallet support for a specific format is the kind of problem "),t("a",{attrs:{href:"/descriptors"}},[e._v("descriptors")]),e._v(" solve perfectly, so the latest "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" version now accepts a descriptor and the network as parameters.")]),e._v(" "),t("h2",{attrs:{id:"example-use-case"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#example-use-case"}},[e._v("#")]),e._v(" Example use case")]),e._v(" "),t("p",[e._v("So let's say your grandma wants to buy bitcoin and asked for your help.")]),e._v(" "),t("p",[e._v("You are a little afraid she may lose the private key. At the same time, you don't want to duplicate the keys and give those to her daughters Alice and Barbara, because both of them could spend and accuse the other of having done so.")]),e._v(" "),t("p",[e._v("Even though we trust everyone in the family it is better to play it safe and divide the responsibility of protecting Grandma's bitcoin.")]),e._v(" "),t("p",[e._v("This is a perfect case for a 2 of 3 multi-signature paper wallet. This way also protects the participants from having their copy of the wallet stolen. To compromise Grandma's wallet a thief would need to find and steal at least two of them.")]),e._v(" "),t("p",[e._v("Note that you as the wallet creator are still the single point of trust because you are going to generate the keys for everyone. Setups combining self generated keys from the participants is possible future work.")]),e._v(" "),t("h2",{attrs:{id:"creating-the-paper-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-the-paper-wallet"}},[e._v("#")]),e._v(" Creating the paper wallet")]),e._v(" "),t("p",[e._v("For this example the spending descriptor would be:")]),e._v(" "),t("p",[t("code",[e._v("wsh(multi(2,Grandma,Alice,Barbara))")])]),e._v(" "),t("p",[e._v("You need "),t("a",{attrs:{href:"https://www.rust-lang.org/tools/install",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust"),t("OutboundLink")],1),e._v(" installed to use "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(". The -n option below explicitly selects\ngenerating "),t("code",[e._v("testnet")]),e._v(" keys. Use "),t("code",[e._v("rusty-paper-wallet --help")]),e._v(" to see usage instructions and other\noptions.")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("cargo")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" rusty-paper-wallet\n$ rusty-paper-wallet "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"wsh(multi(2,Grandma,Alice,Barbara))"')]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-n")]),e._v(" testnet\ndata:text/html"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("base64,PCFET0N"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("..")]),e._v(".\n")])])]),t("p",[e._v("The "),t("a",{attrs:{href:"/descriptor-based-paper-wallets/data-url.txt"}},[e._v("output")]),e._v(" of the command is very long and has been shortened. The string is a "),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/Data_URI_scheme",target:"_blank",rel:"noopener noreferrer"}},[e._v("data URI scheme"),t("OutboundLink")],1),e._v(" paste-able in the address bar of a browser. By using a data URI no files are written on the hard disk, leaving less trace of secret material on the computer.\nIt's also a good idea to use incognito mode in the browser to prevent it from saving the page in the history.")]),e._v(" "),t("p",[e._v("The following is the result:")]),e._v(" "),t("iframe",{staticClass:"example",attrs:{src:"/descriptor-based-paper-wallets/Bitcoin_Paper_Wallet.html"}}),e._v(" "),t("p",[e._v("Under the hood, the command created a key pair randomly for every alias present in the descriptor, then replaced the aliases with the created keys and generated the corresponding address. This address is the same for every paper wallet and it is shown in the upper part of the paper wallet (the public part) along with the alias, linking the paper wallet to the owner.")]),e._v(" "),t("p",[e._v("The lower part is the secret part, the written part is the descriptor with the aliases, followed by a legend linking the aliases with the keys. In the legend, all the keys are public but the one of the owner which is a private WIF. The secret QR code instead contains the descriptor already with the keys.")]),e._v(" "),t("p",[e._v("The paper wallet must then be printed, and it is better to use a printer without wifi and also to be aware that some sensitive data may remain in the printer's cache.")]),e._v(" "),t("p",[e._v("Then the paper wallet must be cut along the dotted lines, the secret part should be folded twice over the black zone"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn4",id:"fnref4"}},[e._v("[4]")])]),e._v(". The black zone helps to avoid showing the secret parts in the presence of back-light. Once the folding is done the paper wallet should be plasticized to prevent being damaged by water.")]),e._v(" "),t("h2",{attrs:{id:"bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk"}},[e._v("#")]),e._v(" BDK")]),e._v(" "),t("p",[e._v("Any descriptor based wallet can be used to check the balance of and sweep the funds from\nGrandma's paper wallet. For this post we'll demonstrate using the "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" tool to do these steps.\nAnother area where "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk"),t("OutboundLink")],1),e._v(" could be used with "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" is to compile a more\ncomplicated miniscript spending policy into a descriptor, as we have done in the "),t("RouterLink",{attrs:{to:"/blog/2021/02/spending-policy-demo/#step-4-create-wallet-descriptors-for-each-participant"}},[e._v("spending policy demo")]),e._v(" post.")],1),e._v(" "),t("h2",{attrs:{id:"funding-tx"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#funding-tx"}},[e._v("#")]),e._v(" Funding tx")]),e._v(" "),t("p",[e._v("Since Grandma's wallet was created as a "),t("code",[e._v("wsh")]),e._v(" descriptor, bitcoin can be sent to it from any\nsegwit capable wallet, we'll use a public "),t("a",{attrs:{href:"https://bitcoinfaucet.uo1.net/",target:"_blank",rel:"noopener noreferrer"}},[e._v("bitcoin testnet faucet"),t("OutboundLink")],1),e._v(". Once the funds are sent the\ndeposit address "),t("code",[e._v("tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw")]),e._v(" we can also use this\naddress and a testnet explorer to "),t("a",{attrs:{href:"https://mempool.space/testnet/address/tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw",target:"_blank",rel:"noopener noreferrer"}},[e._v("confirm the funds were received"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"sweep-tx"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#sweep-tx"}},[e._v("#")]),e._v(" Sweep tx")]),e._v(" "),t("p",[e._v("Now that Grandma's paper wallet is funded it's time to demonstrate how to use "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" to sweep these\nfunds to a new address. Let's assume Grandma lost her original paper wallet and has asked\nher daughters to sweep them to a new single signature wallet so she can spend them.")]),e._v(" "),t("h3",{attrs:{id:"step-1-alice-creates-and-signs-a-psbt"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-1-alice-creates-and-signs-a-psbt"}},[e._v("#")]),e._v(" Step 1: Alice creates and signs a PSBT")]),e._v(" "),t("p",[e._v("Alice uses the private text or QR code from her paper wallet to find her private key and the\npublic keys for Grandma and Barbara. With this info she creates a PSBT to sweep Grandma's funds\nto a new address (in this example we'll send them back to our "),t("a",{attrs:{href:"https://bitcoinfaucet.uo1.net/",target:"_blank",rel:"noopener noreferrer"}},[e._v("bitcoin testnet faucet"),t("OutboundLink")],1),e._v("). Notice how Alice\nincludes her wallet's descriptor checksum '#em3q73l5', this "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md#checksums",target:"_blank",rel:"noopener noreferrer"}},[e._v("guarantees"),t("OutboundLink")],1),e._v(" she has entered her descriptor correctly.")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("SWEEP_TO_ADDR")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2\n\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_WIF")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("cSSKRHDmQEEutp5LD14tAcixu2ehSNPDTqNek1zMa9Pet98qxHq3\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("BARBARA_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("02a3f3f2658b9812ddeabfbde2fde03f8a65369e4ed621f29fa8ba0cc519b789fb\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("GRANDMA_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("03f1bd2bff8e9c61f58a8d46d18fd8f3149b1f2d76b3c423a7874a5d5811d67cee\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_DESCRIPTOR")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"wsh(multi(2,'),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$GRANDMA_PUBKEY")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_WIF")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_PUBKEY")]),e._v('))#em3q73l5"')]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# confirm descriptor creates the expected deposit address")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_DESCRIPTOR")]),e._v(" get_new_address\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"address"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw"')]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# sync the wallet and show the balance")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_DESCRIPTOR")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("sync")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_DESCRIPTOR")]),e._v(" get_balance\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"satoshi"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("10000")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# create and sign PSBT")]),e._v("\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("UNSIGNED_PSBT")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token variable"}},[t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$(")]),e._v("bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" $ALICE_DESCRIPTOR create_tx "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--send_all")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--to")]),e._v(" $SWEEP_TO_ADDR:0 "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("|")]),e._v(" jq "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-r")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('".psbt"')]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v(")")])]),e._v("\n\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_SIGNED_PSBT")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token variable"}},[t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$(")]),e._v("bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" $ALICE_DESCRIPTOR sign "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--psbt")]),e._v(" $UNSIGNED_PSBT "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("|")]),e._v(" jq "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-r")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('".psbt"')]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v(")")])]),e._v("\n")])])]),t("h3",{attrs:{id:"step-2-barbara-signs-alices-signed-psbt-and-broadcasts-the-tx"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-2-barbara-signs-alices-signed-psbt-and-broadcasts-the-tx"}},[e._v("#")]),e._v(" Step 2: Barbara signs Alice's signed PSBT and broadcasts the tx")]),e._v(" "),t("p",[e._v("Now it's Barbara's turn to use the private text or QR code from her paper wallet to get her private\nkey and the public keys for Grandma and Alice. With this info plus Alice's signed PSBT she can\ncreate a fully signed PSBT to broadcast and complete the sweep of Grandma's funds.")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("02e486e32f0f87136fa042cb53219ace8537ea1d036deb2f4293570b94325d11cb\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("BARBARA_WIF")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("cSfMLzSZ9NjWUTqL3sFpgWJssnu2qgmE2cm5N1jPDRRJuDcrsPEB\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("GRANDMA_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("03f1bd2bff8e9c61f58a8d46d18fd8f3149b1f2d76b3c423a7874a5d5811d67cee\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("BARBARA_DESCRIPTOR")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"wsh(multi(2,'),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$GRANDMA_PUBKEY")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_PUBKEY")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_WIF")]),e._v('))#nxfa5n0z"')]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# confirm descriptor creates the expected deposit address")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" get_new_address\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"address"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw"')]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# sync the wallet and show the balance")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("sync")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" get_balance\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"satoshi"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("10000")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("FINAL_PSBT")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token variable"}},[t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$(")]),e._v("bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" $BARBARA_DESCRIPTOR sign "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--psbt")]),e._v(" $ALICE_SIGNED_PSBT "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("|")]),e._v(" jq "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-r")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('".psbt"')]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v(")")])]),e._v("\n\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" broadcast "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--psbt")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$FINAL_PSBT")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"txid"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"9ecd8e6be92b7edd8bf1799f8f7090e58f813825f826bdb771b4cdb444cdeb59"')]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("And finally we verify that Alice and Barbara successfully created and broadcast Grandma's "),t("a",{attrs:{href:"https://mempool.space/testnet/tx/9ecd8e6be92b7edd8bf1799f8f7090e58f813825f826bdb771b4cdb444cdeb59",target:"_blank",rel:"noopener noreferrer"}},[e._v("sweep tx"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"conclusion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),t("p",[e._v("In this post we showed how to create a multi-sig descriptor based paper wallet using\n"),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" and then sweep the funds from our example paper wallet to a new address. If you\nfound this post interesting please comment below. Or give it a try yourself and if you run into any\nproblems or would like to suggest improvements leave an issue in the "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" or\n"),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" github repos. Thanks!")]),e._v(" "),t("hr",{staticClass:"footnotes-sep"}),e._v(" "),t("section",{staticClass:"footnotes"},[t("ol",{staticClass:"footnotes-list"},[t("li",{staticClass:"footnote-item",attrs:{id:"fn1"}},[t("p",[e._v("Wallet Input Format, a string encoding a ECDSA private key https://en.bitcoin.it/wiki/Wallet_import_format "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn2"}},[t("p",[e._v("Unless the user import the WIF directly into bitcoin core "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref2"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn3"}},[t("p",[e._v("Some wallets refers to sweep as the action to create a transaction taking all the funds from the paper wallet and sending those to the wallet itself. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref3"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn4"}},[t("p",[e._v("Ideally, the black zone should be twice as long as the secret part to cover it back and front, long descriptor may leave a shorter black zone, ensure to have you printer set with vertical layout for best results. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref4"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[45],{394:function(e,t,a){"use strict";a.r(t);var s=a(7),r=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("In this post, we will use the "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" tool to create a multi-owned descriptor-based paper wallet. We will use "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk"),t("OutboundLink")],1),e._v(" via the "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" tool to test our descriptor and to be able to sweep the funds from our paper wallet to a new address.")]),e._v(" "),t("h2",{attrs:{id:"about-paper-wallets"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#about-paper-wallets"}},[e._v("#")]),e._v(" About paper wallets")]),e._v(" "),t("p",[e._v("Paper wallets have a lot of drawbacks, as explained in the "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/Paper_wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("paper wallet Wiki article"),t("OutboundLink")],1),e._v(", as always, do your own research before deciding to use it with mainnet bitcoins. In this post we will\nonly be using testnet coins.")]),e._v(" "),t("h2",{attrs:{id:"descriptors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#descriptors"}},[e._v("#")]),e._v(" Descriptors")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet/tree/339fa4418d94f6fdd96f3d0301cab8a0bc09e8bd",target:"_blank",rel:"noopener noreferrer"}},[e._v("previous version"),t("OutboundLink")],1),e._v(" of the "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" followed the original paper wallet design: WIF"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v(" as secret part with the option to generate a different kind of addresses (legacy, nested segwit, and segwit).")]),e._v(" "),t("p",[e._v("There were plans to "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet/issues/5",target:"_blank",rel:"noopener noreferrer"}},[e._v("support mnemonic"),t("OutboundLink")],1),e._v(" instead of WIF keys because it may"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn2",id:"fnref2"}},[e._v("[2]")])]),e._v(" save the sweep transaction"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn3",id:"fnref3"}},[e._v("[3]")])]),e._v(" and there are more wallets capable of importing a mnemonic instead of a WIF.")]),e._v(" "),t("p",[e._v("However, choosing a single address type or having wallet support for a specific format is the kind of problem "),t("a",{attrs:{href:"/descriptors"}},[e._v("descriptors")]),e._v(" solve perfectly, so the latest "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" version now accepts a descriptor and the network as parameters.")]),e._v(" "),t("h2",{attrs:{id:"example-use-case"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#example-use-case"}},[e._v("#")]),e._v(" Example use case")]),e._v(" "),t("p",[e._v("So let's say your grandma wants to buy bitcoin and asked for your help.")]),e._v(" "),t("p",[e._v("You are a little afraid she may lose the private key. At the same time, you don't want to duplicate the keys and give those to her daughters Alice and Barbara, because both of them could spend and accuse the other of having done so.")]),e._v(" "),t("p",[e._v("Even though we trust everyone in the family it is better to play it safe and divide the responsibility of protecting Grandma's bitcoin.")]),e._v(" "),t("p",[e._v("This is a perfect case for a 2 of 3 multi-signature paper wallet. This way also protects the participants from having their copy of the wallet stolen. To compromise Grandma's wallet a thief would need to find and steal at least two of them.")]),e._v(" "),t("p",[e._v("Note that you as the wallet creator are still the single point of trust because you are going to generate the keys for everyone. Setups combining self generated keys from the participants is possible future work.")]),e._v(" "),t("h2",{attrs:{id:"creating-the-paper-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-the-paper-wallet"}},[e._v("#")]),e._v(" Creating the paper wallet")]),e._v(" "),t("p",[e._v("For this example the spending descriptor would be:")]),e._v(" "),t("p",[t("code",[e._v("wsh(multi(2,Grandma,Alice,Barbara))")])]),e._v(" "),t("p",[e._v("You need "),t("a",{attrs:{href:"https://www.rust-lang.org/tools/install",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust"),t("OutboundLink")],1),e._v(" installed to use "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(". The -n option below explicitly selects\ngenerating "),t("code",[e._v("testnet")]),e._v(" keys. Use "),t("code",[e._v("rusty-paper-wallet --help")]),e._v(" to see usage instructions and other\noptions.")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("cargo")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" rusty-paper-wallet\n$ rusty-paper-wallet "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"wsh(multi(2,Grandma,Alice,Barbara))"')]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-n")]),e._v(" testnet\ndata:text/html"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("base64,PCFET0N"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("..")]),e._v(".\n")])])]),t("p",[e._v("The "),t("a",{attrs:{href:"/descriptor-based-paper-wallets/data-url.txt"}},[e._v("output")]),e._v(" of the command is very long and has been shortened. The string is a "),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/Data_URI_scheme",target:"_blank",rel:"noopener noreferrer"}},[e._v("data URI scheme"),t("OutboundLink")],1),e._v(" paste-able in the address bar of a browser. By using a data URI no files are written on the hard disk, leaving less trace of secret material on the computer.\nIt's also a good idea to use incognito mode in the browser to prevent it from saving the page in the history.")]),e._v(" "),t("p",[e._v("The following is the result:")]),e._v(" "),t("iframe",{staticClass:"example",attrs:{src:"/descriptor-based-paper-wallets/Bitcoin_Paper_Wallet.html"}}),e._v(" "),t("p",[e._v("Under the hood, the command created a key pair randomly for every alias present in the descriptor, then replaced the aliases with the created keys and generated the corresponding address. This address is the same for every paper wallet and it is shown in the upper part of the paper wallet (the public part) along with the alias, linking the paper wallet to the owner.")]),e._v(" "),t("p",[e._v("The lower part is the secret part, the written part is the descriptor with the aliases, followed by a legend linking the aliases with the keys. In the legend, all the keys are public but the one of the owner which is a private WIF. The secret QR code instead contains the descriptor already with the keys.")]),e._v(" "),t("p",[e._v("The paper wallet must then be printed, and it is better to use a printer without wifi and also to be aware that some sensitive data may remain in the printer's cache.")]),e._v(" "),t("p",[e._v("Then the paper wallet must be cut along the dotted lines, the secret part should be folded twice over the black zone"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn4",id:"fnref4"}},[e._v("[4]")])]),e._v(". The black zone helps to avoid showing the secret parts in the presence of back-light. Once the folding is done the paper wallet should be plasticized to prevent being damaged by water.")]),e._v(" "),t("h2",{attrs:{id:"bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk"}},[e._v("#")]),e._v(" BDK")]),e._v(" "),t("p",[e._v("Any descriptor based wallet can be used to check the balance of and sweep the funds from\nGrandma's paper wallet. For this post we'll demonstrate using the "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" tool to do these steps.\nAnother area where "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk"),t("OutboundLink")],1),e._v(" could be used with "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" is to compile a more\ncomplicated miniscript spending policy into a descriptor, as we have done in the "),t("RouterLink",{attrs:{to:"/blog/2021/02/spending-policy-demo/#step-4-create-wallet-descriptors-for-each-participant"}},[e._v("spending policy demo")]),e._v(" post.")],1),e._v(" "),t("h2",{attrs:{id:"funding-tx"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#funding-tx"}},[e._v("#")]),e._v(" Funding tx")]),e._v(" "),t("p",[e._v("Since Grandma's wallet was created as a "),t("code",[e._v("wsh")]),e._v(" descriptor, bitcoin can be sent to it from any\nsegwit capable wallet, we'll use a public "),t("a",{attrs:{href:"https://bitcoinfaucet.uo1.net/",target:"_blank",rel:"noopener noreferrer"}},[e._v("bitcoin testnet faucet"),t("OutboundLink")],1),e._v(". Once the funds are sent the\ndeposit address "),t("code",[e._v("tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw")]),e._v(" we can also use this\naddress and a testnet explorer to "),t("a",{attrs:{href:"https://mempool.space/testnet/address/tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw",target:"_blank",rel:"noopener noreferrer"}},[e._v("confirm the funds were received"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"sweep-tx"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#sweep-tx"}},[e._v("#")]),e._v(" Sweep tx")]),e._v(" "),t("p",[e._v("Now that Grandma's paper wallet is funded it's time to demonstrate how to use "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" to sweep these\nfunds to a new address. Let's assume Grandma lost her original paper wallet and has asked\nher daughters to sweep them to a new single signature wallet so she can spend them.")]),e._v(" "),t("h3",{attrs:{id:"step-1-alice-creates-and-signs-a-psbt"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-1-alice-creates-and-signs-a-psbt"}},[e._v("#")]),e._v(" Step 1: Alice creates and signs a PSBT")]),e._v(" "),t("p",[e._v("Alice uses the private text or QR code from her paper wallet to find her private key and the\npublic keys for Grandma and Barbara. With this info she creates a PSBT to sweep Grandma's funds\nto a new address (in this example we'll send them back to our "),t("a",{attrs:{href:"https://bitcoinfaucet.uo1.net/",target:"_blank",rel:"noopener noreferrer"}},[e._v("bitcoin testnet faucet"),t("OutboundLink")],1),e._v("). Notice how Alice\nincludes her wallet's descriptor checksum '#em3q73l5', this "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md#checksums",target:"_blank",rel:"noopener noreferrer"}},[e._v("guarantees"),t("OutboundLink")],1),e._v(" she has entered her descriptor correctly.")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("SWEEP_TO_ADDR")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2\n\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_WIF")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("cSSKRHDmQEEutp5LD14tAcixu2ehSNPDTqNek1zMa9Pet98qxHq3\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("BARBARA_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("02a3f3f2658b9812ddeabfbde2fde03f8a65369e4ed621f29fa8ba0cc519b789fb\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("GRANDMA_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("03f1bd2bff8e9c61f58a8d46d18fd8f3149b1f2d76b3c423a7874a5d5811d67cee\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_DESCRIPTOR")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"wsh(multi(2,'),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$GRANDMA_PUBKEY")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_WIF")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_PUBKEY")]),e._v('))#em3q73l5"')]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# confirm descriptor creates the expected deposit address")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_DESCRIPTOR")]),e._v(" get_new_address\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"address"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw"')]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# sync the wallet and show the balance")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_DESCRIPTOR")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("sync")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_DESCRIPTOR")]),e._v(" get_balance\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"satoshi"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("10000")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# create and sign PSBT")]),e._v("\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("UNSIGNED_PSBT")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token variable"}},[t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$(")]),e._v("bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" $ALICE_DESCRIPTOR create_tx "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--send_all")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--to")]),e._v(" $SWEEP_TO_ADDR:0 "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("|")]),e._v(" jq "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-r")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('".psbt"')]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v(")")])]),e._v("\n\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_SIGNED_PSBT")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token variable"}},[t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$(")]),e._v("bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" $ALICE_DESCRIPTOR sign "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--psbt")]),e._v(" $UNSIGNED_PSBT "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("|")]),e._v(" jq "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-r")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('".psbt"')]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v(")")])]),e._v("\n")])])]),t("h3",{attrs:{id:"step-2-barbara-signs-alices-signed-psbt-and-broadcasts-the-tx"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-2-barbara-signs-alices-signed-psbt-and-broadcasts-the-tx"}},[e._v("#")]),e._v(" Step 2: Barbara signs Alice's signed PSBT and broadcasts the tx")]),e._v(" "),t("p",[e._v("Now it's Barbara's turn to use the private text or QR code from her paper wallet to get her private\nkey and the public keys for Grandma and Alice. With this info plus Alice's signed PSBT she can\ncreate a fully signed PSBT to broadcast and complete the sweep of Grandma's funds.")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("02e486e32f0f87136fa042cb53219ace8537ea1d036deb2f4293570b94325d11cb\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("BARBARA_WIF")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("cSfMLzSZ9NjWUTqL3sFpgWJssnu2qgmE2cm5N1jPDRRJuDcrsPEB\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("GRANDMA_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("03f1bd2bff8e9c61f58a8d46d18fd8f3149b1f2d76b3c423a7874a5d5811d67cee\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("BARBARA_DESCRIPTOR")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"wsh(multi(2,'),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$GRANDMA_PUBKEY")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_PUBKEY")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_WIF")]),e._v('))#nxfa5n0z"')]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# confirm descriptor creates the expected deposit address")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" get_new_address\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"address"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw"')]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# sync the wallet and show the balance")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("sync")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" get_balance\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"satoshi"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("10000")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("FINAL_PSBT")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token variable"}},[t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$(")]),e._v("bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" $BARBARA_DESCRIPTOR sign "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--psbt")]),e._v(" $ALICE_SIGNED_PSBT "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("|")]),e._v(" jq "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-r")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('".psbt"')]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v(")")])]),e._v("\n\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" broadcast "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--psbt")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$FINAL_PSBT")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"txid"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"9ecd8e6be92b7edd8bf1799f8f7090e58f813825f826bdb771b4cdb444cdeb59"')]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("And finally we verify that Alice and Barbara successfully created and broadcast Grandma's "),t("a",{attrs:{href:"https://mempool.space/testnet/tx/9ecd8e6be92b7edd8bf1799f8f7090e58f813825f826bdb771b4cdb444cdeb59",target:"_blank",rel:"noopener noreferrer"}},[e._v("sweep tx"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"conclusion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),t("p",[e._v("In this post we showed how to create a multi-sig descriptor based paper wallet using\n"),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" and then sweep the funds from our example paper wallet to a new address. If you\nfound this post interesting please comment below. Or give it a try yourself and if you run into any\nproblems or would like to suggest improvements leave an issue in the "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" or\n"),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" github repos. Thanks!")]),e._v(" "),t("hr",{staticClass:"footnotes-sep"}),e._v(" "),t("section",{staticClass:"footnotes"},[t("ol",{staticClass:"footnotes-list"},[t("li",{staticClass:"footnote-item",attrs:{id:"fn1"}},[t("p",[e._v("Wallet Input Format, a string encoding a ECDSA private key https://en.bitcoin.it/wiki/Wallet_import_format "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn2"}},[t("p",[e._v("Unless the user import the WIF directly into bitcoin core "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref2"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn3"}},[t("p",[e._v("Some wallets refers to sweep as the action to create a transaction taking all the funds from the paper wallet and sending those to the wallet itself. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref3"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn4"}},[t("p",[e._v("Ideally, the black zone should be twice as long as the secret part to cover it back and front, long descriptor may leave a shorter black zone, ensure to have you printer set with vertical layout for best results. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref4"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/46.5deb1292.js b/assets/js/46.883464d4.js similarity index 99% rename from assets/js/46.5deb1292.js rename to assets/js/46.883464d4.js index 3920b4ef57..3340e76c61 100644 --- a/assets/js/46.5deb1292.js +++ b/assets/js/46.883464d4.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{394:function(e,t,r){"use strict";r.r(t);var a=r(7),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("I have tried to setup a 2 of 2 multi signature infrastructure with two\ndifferent wallets, which know nothing about each other, but are compliant with\ntwo very important protocols: "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("Partially Signed\nBitcoin Transactions"),t("OutboundLink")],1),e._v(" described in BIP 174.")]),e._v(" "),t("p",[e._v("Before these two protocols came into existence, making a multi signature setup\nand spending from it was possible only if the involved parties were using the\nsame wallet (eg. Electrum Desktop Wallet). This limitation was due to the fact\nthat the two parties had to agree:")]),e._v(" "),t("ul",[t("li",[e._v("on the particular type of script and address to use")]),e._v(" "),t("li",[e._v("on the way the transaction would be shared composed and signed with all the\ninvolved parties.")])]),e._v(" "),t("p",[t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(" are a way to express which kind scriptPubKey and\naddresses to produce with a key or a series of keys.")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("PSBT"),t("OutboundLink")],1),e._v(" is instead the standard protocol used to create a transaction and to enrich\nit with the necessary signatures and other components, to make it valid and complete.")]),e._v(" "),t("p",[e._v("Together they provide a common ground to create and use a multi signature\ninfrastructure in a heterogeneous environment, and this is what I have put\nto test.")]),e._v(" "),t("h2",{attrs:{id:"the-use-case"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-use-case"}},[e._v("#")]),e._v(" The use case")]),e._v(" "),t("p",[e._v("Imagine Alice and Bob owning a company and being willing to put the corporate cash\nin a 2of2 multi signature setup, so that each one of them have to agree and sign each\ntransaction.")]),e._v(" "),t("h2",{attrs:{id:"the-role-of-descriptors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-role-of-descriptors"}},[e._v("#")]),e._v(" The role of Descriptors")]),e._v(" "),t("p",[e._v("If Alice and Bob cannot agree on the software to use, to monitor the same financial\nsituation, the two software must control and produce exactly the same series\nof multisignature addresses.")]),e._v(" "),t("p",[e._v("To make two different software produce the same addresses in a deterministic way\nwe must ensure that they:")]),e._v(" "),t("ul",[t("li",[e._v("produce the same pair of public keys")]),e._v(" "),t("li",[e._v("combine them in the same order")]),e._v(" "),t("li",[e._v("put them inside the same scriptPubKey to produce the same address")])]),e._v(" "),t("p",[e._v("Here is where the "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(" come into play. They describe:")]),e._v(" "),t("ul",[t("li",[e._v("the sequence of public keys each extended key (xpub) will produce")]),e._v(" "),t("li",[e._v("the sequence in which the new public keys of various parties will enter into\nthe script")]),e._v(" "),t("li",[e._v("the type of script the wallet will prepare with that group keys and so the type\nof address the group of keys will produce.")])]),e._v(" "),t("p",[t("strong",[e._v("By sharing the same Descriptor, every compliant wallet will derive\ndeterministically the same series of multisig addresses")]),e._v(".")]),e._v(" "),t("p",[e._v("Imagine Alice using Bitcoin Core (from now on "),t("a",{attrs:{href:"https://bitcoincore.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v('"Core"'),t("OutboundLink")],1),e._v(') as a\nWallet and Bob using a "Last generation" wallet, Bitcoin Development Kit\n(from now on '),t("a",{attrs:{href:"https://bitcoindevkit.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v('"BDK"'),t("OutboundLink")],1),e._v("), which uses descriptors and miniscript natively.")]),e._v(" "),t("p",[e._v("Each of these two software wallets should be able to:")]),e._v(" "),t("ul",[t("li",[e._v("Create a new address which is seen as belonging to the multi signature\nwallet in both software")]),e._v(" "),t("li",[e._v("Express the consent of each party by partially signing the transaction in a way\nthe other wallet can understand and complete it with its own signature.")])]),e._v(" "),t("p",[e._v("The infrastructure of multiple Extended keys combined toghether to produce\nmultiple multisignature addresses is often referred as\n"),t("em",[t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[e._v("Hierarchical Deterministic"),t("OutboundLink")],1),e._v(" multi signature wallet or HDM")]),e._v(".")]),e._v(" "),t("p",[e._v("What follows are the steps to create the HDM usable both in Core and\nin BDK.")]),e._v(" "),t("p",[t("em",[e._v("Note: In Core, "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/pull/16528",target:"_blank",rel:"noopener noreferrer"}},[e._v("Descriptor wallets"),t("OutboundLink")],1),e._v(" are still experimental and in general,\nboth wallets should be tested for descriptor capabilities only in testnet.")])]),e._v(" "),t("h2",{attrs:{id:"our-playground"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#our-playground"}},[e._v("#")]),e._v(" Our playground")]),e._v(" "),t("p",[e._v("We will build a 2of2 key set up that will be used cooperatively by Bitcoin Core\nand Bitcoin Development Kit.\nThe steps Alice and Bob will do are:")]),e._v(" "),t("ol",[t("li",[e._v("creation of the seed and the derived Extended Master Public and send it to\nthe other party")]),e._v(" "),t("li",[e._v("Create the multi signature descriptor for each wallet")]),e._v(" "),t("li",[e._v("Use each other's software to receive testnet coins from a faucet")]),e._v(" "),t("li",[e._v("return part of the coins to the faucet signing the transaction with both\nwallets.")])]),e._v(" "),t("p",[e._v("We need:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://bitcoindevkit.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Dev Kit"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://bitcoincore.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Core"),t("OutboundLink")],1),e._v(" (v0.21.0 or later)")])]),e._v(" "),t("h3",{attrs:{id:"1-creating-the-seeds-and-the-derived-extended-public-keys"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#1-creating-the-seeds-and-the-derived-extended-public-keys"}},[e._v("#")]),e._v(" 1. Creating the seeds and the derived Extended Public keys")]),e._v(" "),t("h4",{attrs:{id:"seeds-and-extended-master-public"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#seeds-and-extended-master-public"}},[e._v("#")]),e._v(" Seeds and Extended Master Public")]),e._v(" "),t("p",[e._v("We build an Extended Private Master Key for both wallet and derive a BIP84\nExtended Master Public for Bitcoin Core and then for BDK.")]),e._v(" "),t("p",[e._v("For Bitcoin Core (Alice):")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("# new Extended wallet data\nexport core_key=$(bdk-cli key generate)\n\n# New Extended Master Private\n\nexport core_xprv=$(echo $core_key | jq -r '.xprv')\n\n# Now I derive the xpubs (one for receiving and one for the change)\n# together with informations about the derivation path to be communicated\n# to BDK wallet's owner (Bob).\n\nexport core_xpub_84_for_rec_desc=$(bdk-cli key derive --path m/84h/0h/0h/0 --xprv $core_xprv | jq -r '.xpub')\nexport core_xpub_84_for_chg_desc=$(bdk-cli key derive --path m/84h/0h/0h/1 --xprv $core_xprv | jq -r '.xpub')\n")])])]),t("p",[e._v("For BDK (Bob) we do the same:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("# new Extended wallet data\n\nexport BDK_key=$(bdk-cli key generate)\n\n# New Extended Master Private\n\nexport BDK_xprv=$(echo $BDK_key | jq -r '.xprv')\n\n# Now I build the derived xpubs to be communicated (to Alice).\n\nexport BDK_xpub_84_for_rec_desc=$(bdk-cli key derive --path m/84h/0h/0h/0 --xprv $BDK_xprv | jq -r '.xpub')\nexport BDK_xpub_84_for_chg_desc=$(bdk-cli key derive --path m/84h/0h/0h/1 --xprv $BDK_xprv | jq -r '.xpub')\n")])])]),t("h3",{attrs:{id:"2-creation-of-the-multi-signature-descriptor-for-each-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#2-creation-of-the-multi-signature-descriptor-for-each-wallet"}},[e._v("#")]),e._v(" 2. Creation of the multi signature descriptor for each wallet")]),e._v(" "),t("p",[e._v("To build a multisig wallet, each wallet owner must compose the descriptor\nadding:")]),e._v(" "),t("ul",[t("li",[e._v("his derived extended "),t("strong",[e._v("private")]),e._v(" key AND")]),e._v(" "),t("li",[e._v("all the extended "),t("strong",[e._v("public")]),e._v(" keys of the other wallets involved in the\nmulti signature setup")])]),e._v(" "),t("p",[t("em",[e._v("The different nature of the two keys (one is private and one is public) is\ndue to the fact that each wallet, to be able to partially sign the transaction,\n"),t("strong",[e._v("must manage the private key of the wallet's owner")])]),e._v(" AND have the other\nparty's public key. Otherwise, if we put both public keys, we would obtain\na watch-only wallet unable to sign the transactions. If we\nhad both extended private keys inside the descriptor, we would allow each party\nto finalize the transactions autonomously.")]),e._v(" "),t("h4",{attrs:{id:"in-bitcoin-core"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#in-bitcoin-core"}},[e._v("#")]),e._v(" In Bitcoin Core:")]),e._v(" "),t("p",[e._v("In our case, the multi signature descriptor for Bitcoin Core will be composed\nwith:")]),e._v(" "),t("ul",[t("li",[e._v("The BIP84 derived Extended "),t("strong",[e._v("Public")]),e._v(" Key from BDK")]),e._v(" "),t("li",[e._v("The BIP84 derived Extended "),t("strong",[e._v("Private")]),e._v(" Key from Core.")])]),e._v(" "),t("p",[e._v("BDK wallet's owner will send to Core's owner the derived xpub for this purpose.\nThis is how the Core's multisig descriptor will be created and put into an\nenvironment variable:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export core_rec_desc=\"wsh(multi(2,$BDK_xpub_84_for_rec_desc,$core_xprv/84'/0'/0'/0/*))\"\n")])])]),t("p",[e._v("Where of course "),t("code",[e._v("$BDK_xpub_84_for_rec_desc")]),e._v("is the derived master public created\nin BDK and received by Core's owner.")]),e._v(" "),t("p",[e._v("The meaning of what is before and after is illustrated in the doc that explain\nthe use of "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors in Bitcoin Core"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("We add the necessary checksum using the specific "),t("code",[e._v("bitcoin-cli")]),e._v(" call.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export core_rec_desc_chksum=$core_rec_desc#$(bitcoin-cli -testnet getdescriptorinfo $core_rec_desc | jq -r '.checksum')\n")])])]),t("p",[e._v("We repeat the same to build the descriptor to receive the change.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export core_chg_desc=\"wsh(multi(2,$BDK_xpub_84_for_chg_desc,$core_xprv/84'/0'/0'/1/*))\"\nexport core_chg_desc_chksum=$core_chg_desc#$(bitcoin-cli -testnet getdescriptorinfo $core_chg_desc|jq -r '.checksum')\n")])])]),t("h4",{attrs:{id:"in-bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#in-bdk"}},[e._v("#")]),e._v(" In BDK:")]),e._v(" "),t("p",[e._v("For BDK we set the derivation for receiving addresses and change addresses\nin the command line (maybe setting an alias)")]),e._v(" "),t("p",[e._v("Building the descriptor:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export BDK_rec_desc=\"wsh(multi(2,$BDK_xprv/84'/0'/0'/0/*,$core_xpub_84_for_rec_desc))\"`\n")])])]),t("p",[e._v("Please note that the order of the extended key in the descriptor MUST be the\nsame in the 2 wallets.")]),e._v(" "),t("p",[t("em",[e._v("We have chosen to put BDK first and in each software wallet, the public key\nderived from BDK will always come first. In alternative, we could have chosen to\nproduce the descriptor, "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/pull/17056?ref=tokendaily",target:"_blank",rel:"noopener noreferrer"}},[e._v("chosing a "),t("code",[e._v("soretedmulti")]),e._v(" multisignature setup"),t("OutboundLink")],1)]),e._v(".")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export BDK_rec_desc_chksum=$BDK_rec_desc#$(bitcoin-cli -testnet getdescriptorinfo $BDK_rec_desc | jq -r '.checksum')\nexport BDK_chg_desc=\"wsh(multi(2,$BDK_xprv/84'/0'/0'/1/*,$core_xpub_84_for_chg_desc))\"\nexport BDK_chg_desc_chksum=$BDK_chg_desc#$(bitcoin-cli -testnet getdescriptorinfo $BDK_chg_desc | jq -r '.checksum')\n")])])]),t("p",[e._v("To take a look at the variables we have produced so far:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("env | grep 'core_'\nenv | grep 'BDK_'\n")])])]),t("p",[e._v("Now we will use the multisig descriptor wallet to receive testnet coins with\nAlice and Bob's software")]),e._v(" "),t("h3",{attrs:{id:"3-use-each-others-software-to-receive-testnet-coins-from-a-faucet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#3-use-each-others-software-to-receive-testnet-coins-from-a-faucet"}},[e._v("#")]),e._v(" 3. Use each other's software to receive testnet coins from a faucet")]),e._v(" "),t("h4",{attrs:{id:"in-bitcoin-core-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#in-bitcoin-core-2"}},[e._v("#")]),e._v(" In Bitcoin Core")]),e._v(" "),t("p",[e._v('Alice must create an empty, experimental new "descriptors wallet" in Core and\nto import the multisig Output Descriptor.')]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('bitcoin-cli -testnet createwallet "multisig2of2withBDK" false true "" false true false\n')])])]),t("p",[e._v("The flag are to:")]),e._v(" "),t("ul",[t("li",[e._v("use the private keys")]),e._v(" "),t("li",[e._v("make it empty")]),e._v(" "),t("li",[e._v("no password provided to the wallet")]),e._v(" "),t("li",[e._v("reusing of addresses not allowed")]),e._v(" "),t("li",[e._v('"new experimental descriptors wallet"')]),e._v(" "),t("li",[e._v("don't load it on start up")])]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK importdescriptors "[{\\"desc\\":\\"$core_rec_desc_chksum\\",\\"timestamp\\":\\"now\\",\\"active\\":true,\\"internal\\":false},{\\"desc\\":\\"$core_chg_desc_chksum\\",\\"timestamp\\":\\"now\\",\\"active\\":true,\\"internal\\":true}]"\n')])])]),t("p",[e._v("Now Alice asks for her first receiving multisignature address.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export first_address=$(bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK getnewaddress)\necho $first_address\n")])])]),t("h4",{attrs:{id:"bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk"}},[e._v("#")]),e._v(" BDK")]),e._v(" "),t("p",[e._v("In BDK Bob can specify directly the descriptors on the command line to produce\nthe multisig address, because BDK is descriptors aware natively.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint get_new_address`\n')])])]),t("p",[e._v('Et voilà: if we have done everything correctly, the newly created address in\nCore is the same of the newly created address in BDK. this is part of the\n"miracle" of descriptors\' interoperability.')]),e._v(" "),t("h4",{attrs:{id:"we-ask-for-testnet-coins-giving-the-first-created-address"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#we-ask-for-testnet-coins-giving-the-first-created-address"}},[e._v("#")]),e._v(" We ask for testnet coins giving the first created address.")]),e._v(" "),t("p",[e._v('To find testnet coins for free, you can just google "testnet faucet" and you\nshould find some satoshis to play with. Just give to the site your first\ngenerated address and, in twenty minutes, you will find the satoshis in\nyour balance both in Core and in BDK.')]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('# to check it in Core:\n\nbitcoin-cli -testnet -rpcwallet=multisig2of2withBDK getbalance\n\n# In BDK:\n\n# Sync with the blockchain\nrepl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint sync\n# Get the balance\nrepl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint get_balance\n')])])]),t("p",[e._v("Some testnet faucets have an address to send back the unused satoshi after\nthe use. Take note of that because we will use it in the next step.")]),e._v(" "),t("h3",{attrs:{id:"4-we-return-part-of-the-satoshis-received-back-to-the-faucet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#4-we-return-part-of-the-satoshis-received-back-to-the-faucet"}},[e._v("#")]),e._v(" 4. we return part of the satoshis received back to the faucet")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('export psbt=$(bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK walletcreatefundedpsbt "[]" "[{\\"tb1qrcesfj9f2d7x40xs6ztnlrcgxhh6vsw8658hjdhdy6qgkf6nfrds9rp79a\\":0.000012}]" | jq -r \'.psbt\')\n\nexport psbt=$(bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK walletprocesspsbt $psbt | jq -r \'.psbt\')\n{\n "psbt": "cHNidP8BAIkCAAAAATj90EC+NAuXj7y6SseZJucoJM6sGnUcVm9koTveZECTAAAAAAD+////AmACAAAAAAAAIgAg98ol9j4AalD71E0mV5QV0uM6/vCT+pi2twxr/zrvLROwBAAAAAAAACIAIB4zBMipU3xqvNDQlz+PCDXvpkHH1Q95Nu0mgIsnU0jbAAAAAAABAIkCAAAAAQS+ObgGG6UwtvaO3KYph2E3/ws7Q83RbmR3rxC0fKYSAQAAAAD+////AtAHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNDAHQAAAAAAACIAIBQpiDTgPIMt0ld8cmuYqlY+EIPjvrmMqZruDhs61hQNAAAAAAEBK9AHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNAiAgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAAQEFR1IhArn3tec7n7318rnWqf0dIIwtLtfxo6Zt0HV70UvZYaWvIQNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfVKuIgYCufe15zufvfXyudap/R0gjC0u1/Gjpm3QdXvRS9lhpa8YNEw2cFQAAIAAAACAAAAAgAAAAAAAAAAAIgYDbdI+wHtIgO6pS6Ja7jai1pDwPeidKoDCytTO1jhjAH0YO/laXFQAAIAAAACAAAAAgAAAAAAAAAAAAAEBR1IhAqccvA3rL13D1K4GeWjcahDsO3P8oaVNBttk4MlCKXIcIQLHKhjmPuCQjyS77ZfaMN2tdgNKcf/+57VXGZhz/UWTl1KuIgICpxy8DesvXcPUrgZ5aNxqEOw7c/yhpU0G22TgyUIpchwYNEw2cFQAAIAAAACAAAAAgAEAAAADAAAAIgICxyoY5j7gkI8ku+2X2jDdrXYDSnH//ue1VxmYc/1Fk5cYO/laXFQAAIAAAACAAAAAgAEAAAADAAAAAAA=",\n "complete": false\n}\n')])])]),t("p",[e._v("Exactly! Note the "),t("code",[e._v('"complete": false')]),e._v(". We have processed the transaction with\nCore but we miss one of the necessary key of the multisig 2of2 setup (The one\ncontained inside BDK).")]),e._v(" "),t("p",[t("code",[e._v("tb1qrcesfj9f2d7x40xs6ztnlrcgxhh6vsw8658hjdhdy6qgkf6nfrds9rp79a")]),e._v(" is the address\nwe got from the faucet site to return the satoshis.")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("PSBT"),t("OutboundLink")],1),e._v(" is sent over to the BDK wallet owner who tries to sign the\ntransaction:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint sign --psbt $psbt\n{\n "is_finalized": true,\n "psbt": "cHNidP8BAIkCAAAAATj90EC+NAuXj7y6SseZJucoJM6sGnUcVm9koTveZECTAAAAAAD+////AmACAAAAAAAAIgAg98ol9j4AalD71E0mV5QV0uM6/vCT+pi2twxr/zrvLROwBAAAAAAAACIAIB4zBMipU3xqvNDQlz+PCDXvpkHH1Q95Nu0mgIsnU0jbAAAAAAABAIkCAAAAAQS+ObgGG6UwtvaO3KYph2E3/ws7Q83RbmR3rxC0fKYSAQAAAAD+////AtAHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNDAHQAAAAAAACIAIBQpiDTgPIMt0ld8cmuYqlY+EIPjvrmMqZruDhs61hQNAAAAAAEBK9AHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNAiAgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAASICArn3tec7n7318rnWqf0dIIwtLtfxo6Zt0HV70UvZYaWvRzBEAiBkVDLgVEwvENnLx+04o7gGpGjFDBwAXTJmf8Yvo35oygIgbuBkHsvPC9jmZcMZ9P+Pwp01yxSaWo+5feyPmd3ai1kBAQVHUiECufe15zufvfXyudap/R0gjC0u1/Gjpm3QdXvRS9lhpa8hA23SPsB7SIDuqUuiWu42otaQ8D3onSqAwsrUztY4YwB9Uq4iBgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfRg7+VpcVAAAgAAAAIAAAACAAAAAAAAAAAAiBgK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlrxg0TDZwVAAAgAAAAIAAAACAAAAAAAAAAAABBwABCNoEAEcwRAIgZFQy4FRMLxDZy8ftOKO4BqRoxQwcAF0yZn/GL6N+aMoCIG7gZB7LzwvY5mXDGfT/j8KdNcsUmlqPuX3sj5nd2otZAUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAAUdSIQK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlryEDbdI+wHtIgO6pS6Ja7jai1pDwPeidKoDCytTO1jhjAH1SrgABAUdSIQKnHLwN6y9dw9SuBnlo3GoQ7Dtz/KGlTQbbZODJQilyHCECxyoY5j7gkI8ku+2X2jDdrXYDSnH//ue1VxmYc/1Fk5dSriICAqccvA3rL13D1K4GeWjcahDsO3P8oaVNBttk4MlCKXIcGDRMNnBUAACAAAAAgAAAAIABAAAAAwAAACICAscqGOY+4JCPJLvtl9ow3a12A0px//7ntVcZmHP9RZOXGDv5WlxUAACAAAAAgAAAAIABAAAAAwAAAAAA"\n}\n')])])]),t("p",[e._v('The signature has succeded (note the "is_finalized": true,) and now we can\nbroadcast the transction.')]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint broadcast --psbt "cHNidP8BAIkCAAAAATj90EC+NAuXj7y6SseZJucoJM6sGnUcVm9koTveZECTAAAAAAD+////AmACAAAAAAAAIgAg98ol9j4AalD71E0mV5QV0uM6/vCT+pi2twxr/zrvLROwBAAAAAAAACIAIB4zBMipU3xqvNDQlz+PCDXvpkHH1Q95Nu0mgIsnU0jbAAAAAAABAIkCAAAAAQS+ObgGG6UwtvaO3KYph2E3/ws7Q83RbmR3rxC0fKYSAQAAAAD+////AtAHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNDAHQAAAAAAACIAIBQpiDTgPIMt0ld8cmuYqlY+EIPjvrmMqZruDhs61hQNAAAAAAEBK9AHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNAiAgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAASICArn3tec7n7318rnWqf0dIIwtLtfxo6Zt0HV70UvZYaWvRzBEAiBkVDLgVEwvENnLx+04o7gGpGjFDBwAXTJmf8Yvo35oygIgbuBkHsvPC9jmZcMZ9P+Pwp01yxSaWo+5feyPmd3ai1kBAQVHUiECufe15zufvfXyudap/R0gjC0u1/Gjpm3QdXvRS9lhpa8hA23SPsB7SIDuqUuiWu42otaQ8D3onSqAwsrUztY4YwB9Uq4iBgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfRg7+VpcVAAAgAAAAIAAAACAAAAAAAAAAAAiBgK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlrxg0TDZwVAAAgAAAAIAAAACAAAAAAAAAAAABBwABCNoEAEcwRAIgZFQy4FRMLxDZy8ftOKO4BqRoxQwcAF0yZn/GL6N+aMoCIG7gZB7LzwvY5mXDGfT/j8KdNcsUmlqPuX3sj5nd2otZAUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAAUdSIQK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlryEDbdI+wHtIgO6pS6Ja7jai1pDwPeidKoDCytTO1jhjAH1SrgABAUdSIQKnHLwN6y9dw9SuBnlo3GoQ7Dtz/KGlTQbbZODJQilyHCECxyoY5j7gkI8ku+2X2jDdrXYDSnH//ue1VxmYc/1Fk5dSriICAqccvA3rL13D1K4GeWjcahDsO3P8oaVNBttk4MlCKXIcGDRMNnBUAACAAAAAgAAAAIABAAAAAwAAACICAscqGOY+4JCPJLvtl9ow3a12A0px//7ntVcZmHP9RZOXGDv5WlxUAACAAAAAgAAAAIABAAAAAwAAAAAA"\n{\n "txid": "a0b082e3b0579822d4a0b0fa95a4c4662f6b128ffd43fdcfe53c37473ce85dee"\n}\n')])])]),t("h2",{attrs:{id:"conclusion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),t("p",[e._v("We have built an HDM and we have used it with two indipendent wallets, which\nare compatible with "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("BIP 174"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(". Hopefully we\nwill see many other compatible wallets beyound "),t("a",{attrs:{href:"https://bitcoincore.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Core"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://bitcoindevkit.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("BDK"),t("OutboundLink")],1),e._v(",\nwith which we will be able to easily set up multi signature schemes.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{393:function(e,t,r){"use strict";r.r(t);var a=r(7),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("I have tried to setup a 2 of 2 multi signature infrastructure with two\ndifferent wallets, which know nothing about each other, but are compliant with\ntwo very important protocols: "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("Partially Signed\nBitcoin Transactions"),t("OutboundLink")],1),e._v(" described in BIP 174.")]),e._v(" "),t("p",[e._v("Before these two protocols came into existence, making a multi signature setup\nand spending from it was possible only if the involved parties were using the\nsame wallet (eg. Electrum Desktop Wallet). This limitation was due to the fact\nthat the two parties had to agree:")]),e._v(" "),t("ul",[t("li",[e._v("on the particular type of script and address to use")]),e._v(" "),t("li",[e._v("on the way the transaction would be shared composed and signed with all the\ninvolved parties.")])]),e._v(" "),t("p",[t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(" are a way to express which kind scriptPubKey and\naddresses to produce with a key or a series of keys.")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("PSBT"),t("OutboundLink")],1),e._v(" is instead the standard protocol used to create a transaction and to enrich\nit with the necessary signatures and other components, to make it valid and complete.")]),e._v(" "),t("p",[e._v("Together they provide a common ground to create and use a multi signature\ninfrastructure in a heterogeneous environment, and this is what I have put\nto test.")]),e._v(" "),t("h2",{attrs:{id:"the-use-case"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-use-case"}},[e._v("#")]),e._v(" The use case")]),e._v(" "),t("p",[e._v("Imagine Alice and Bob owning a company and being willing to put the corporate cash\nin a 2of2 multi signature setup, so that each one of them have to agree and sign each\ntransaction.")]),e._v(" "),t("h2",{attrs:{id:"the-role-of-descriptors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-role-of-descriptors"}},[e._v("#")]),e._v(" The role of Descriptors")]),e._v(" "),t("p",[e._v("If Alice and Bob cannot agree on the software to use, to monitor the same financial\nsituation, the two software must control and produce exactly the same series\nof multisignature addresses.")]),e._v(" "),t("p",[e._v("To make two different software produce the same addresses in a deterministic way\nwe must ensure that they:")]),e._v(" "),t("ul",[t("li",[e._v("produce the same pair of public keys")]),e._v(" "),t("li",[e._v("combine them in the same order")]),e._v(" "),t("li",[e._v("put them inside the same scriptPubKey to produce the same address")])]),e._v(" "),t("p",[e._v("Here is where the "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(" come into play. They describe:")]),e._v(" "),t("ul",[t("li",[e._v("the sequence of public keys each extended key (xpub) will produce")]),e._v(" "),t("li",[e._v("the sequence in which the new public keys of various parties will enter into\nthe script")]),e._v(" "),t("li",[e._v("the type of script the wallet will prepare with that group keys and so the type\nof address the group of keys will produce.")])]),e._v(" "),t("p",[t("strong",[e._v("By sharing the same Descriptor, every compliant wallet will derive\ndeterministically the same series of multisig addresses")]),e._v(".")]),e._v(" "),t("p",[e._v("Imagine Alice using Bitcoin Core (from now on "),t("a",{attrs:{href:"https://bitcoincore.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v('"Core"'),t("OutboundLink")],1),e._v(') as a\nWallet and Bob using a "Last generation" wallet, Bitcoin Development Kit\n(from now on '),t("a",{attrs:{href:"https://bitcoindevkit.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v('"BDK"'),t("OutboundLink")],1),e._v("), which uses descriptors and miniscript natively.")]),e._v(" "),t("p",[e._v("Each of these two software wallets should be able to:")]),e._v(" "),t("ul",[t("li",[e._v("Create a new address which is seen as belonging to the multi signature\nwallet in both software")]),e._v(" "),t("li",[e._v("Express the consent of each party by partially signing the transaction in a way\nthe other wallet can understand and complete it with its own signature.")])]),e._v(" "),t("p",[e._v("The infrastructure of multiple Extended keys combined toghether to produce\nmultiple multisignature addresses is often referred as\n"),t("em",[t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[e._v("Hierarchical Deterministic"),t("OutboundLink")],1),e._v(" multi signature wallet or HDM")]),e._v(".")]),e._v(" "),t("p",[e._v("What follows are the steps to create the HDM usable both in Core and\nin BDK.")]),e._v(" "),t("p",[t("em",[e._v("Note: In Core, "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/pull/16528",target:"_blank",rel:"noopener noreferrer"}},[e._v("Descriptor wallets"),t("OutboundLink")],1),e._v(" are still experimental and in general,\nboth wallets should be tested for descriptor capabilities only in testnet.")])]),e._v(" "),t("h2",{attrs:{id:"our-playground"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#our-playground"}},[e._v("#")]),e._v(" Our playground")]),e._v(" "),t("p",[e._v("We will build a 2of2 key set up that will be used cooperatively by Bitcoin Core\nand Bitcoin Development Kit.\nThe steps Alice and Bob will do are:")]),e._v(" "),t("ol",[t("li",[e._v("creation of the seed and the derived Extended Master Public and send it to\nthe other party")]),e._v(" "),t("li",[e._v("Create the multi signature descriptor for each wallet")]),e._v(" "),t("li",[e._v("Use each other's software to receive testnet coins from a faucet")]),e._v(" "),t("li",[e._v("return part of the coins to the faucet signing the transaction with both\nwallets.")])]),e._v(" "),t("p",[e._v("We need:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://bitcoindevkit.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Dev Kit"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://bitcoincore.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Core"),t("OutboundLink")],1),e._v(" (v0.21.0 or later)")])]),e._v(" "),t("h3",{attrs:{id:"1-creating-the-seeds-and-the-derived-extended-public-keys"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#1-creating-the-seeds-and-the-derived-extended-public-keys"}},[e._v("#")]),e._v(" 1. Creating the seeds and the derived Extended Public keys")]),e._v(" "),t("h4",{attrs:{id:"seeds-and-extended-master-public"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#seeds-and-extended-master-public"}},[e._v("#")]),e._v(" Seeds and Extended Master Public")]),e._v(" "),t("p",[e._v("We build an Extended Private Master Key for both wallet and derive a BIP84\nExtended Master Public for Bitcoin Core and then for BDK.")]),e._v(" "),t("p",[e._v("For Bitcoin Core (Alice):")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("# new Extended wallet data\nexport core_key=$(bdk-cli key generate)\n\n# New Extended Master Private\n\nexport core_xprv=$(echo $core_key | jq -r '.xprv')\n\n# Now I derive the xpubs (one for receiving and one for the change)\n# together with informations about the derivation path to be communicated\n# to BDK wallet's owner (Bob).\n\nexport core_xpub_84_for_rec_desc=$(bdk-cli key derive --path m/84h/0h/0h/0 --xprv $core_xprv | jq -r '.xpub')\nexport core_xpub_84_for_chg_desc=$(bdk-cli key derive --path m/84h/0h/0h/1 --xprv $core_xprv | jq -r '.xpub')\n")])])]),t("p",[e._v("For BDK (Bob) we do the same:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("# new Extended wallet data\n\nexport BDK_key=$(bdk-cli key generate)\n\n# New Extended Master Private\n\nexport BDK_xprv=$(echo $BDK_key | jq -r '.xprv')\n\n# Now I build the derived xpubs to be communicated (to Alice).\n\nexport BDK_xpub_84_for_rec_desc=$(bdk-cli key derive --path m/84h/0h/0h/0 --xprv $BDK_xprv | jq -r '.xpub')\nexport BDK_xpub_84_for_chg_desc=$(bdk-cli key derive --path m/84h/0h/0h/1 --xprv $BDK_xprv | jq -r '.xpub')\n")])])]),t("h3",{attrs:{id:"2-creation-of-the-multi-signature-descriptor-for-each-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#2-creation-of-the-multi-signature-descriptor-for-each-wallet"}},[e._v("#")]),e._v(" 2. Creation of the multi signature descriptor for each wallet")]),e._v(" "),t("p",[e._v("To build a multisig wallet, each wallet owner must compose the descriptor\nadding:")]),e._v(" "),t("ul",[t("li",[e._v("his derived extended "),t("strong",[e._v("private")]),e._v(" key AND")]),e._v(" "),t("li",[e._v("all the extended "),t("strong",[e._v("public")]),e._v(" keys of the other wallets involved in the\nmulti signature setup")])]),e._v(" "),t("p",[t("em",[e._v("The different nature of the two keys (one is private and one is public) is\ndue to the fact that each wallet, to be able to partially sign the transaction,\n"),t("strong",[e._v("must manage the private key of the wallet's owner")])]),e._v(" AND have the other\nparty's public key. Otherwise, if we put both public keys, we would obtain\na watch-only wallet unable to sign the transactions. If we\nhad both extended private keys inside the descriptor, we would allow each party\nto finalize the transactions autonomously.")]),e._v(" "),t("h4",{attrs:{id:"in-bitcoin-core"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#in-bitcoin-core"}},[e._v("#")]),e._v(" In Bitcoin Core:")]),e._v(" "),t("p",[e._v("In our case, the multi signature descriptor for Bitcoin Core will be composed\nwith:")]),e._v(" "),t("ul",[t("li",[e._v("The BIP84 derived Extended "),t("strong",[e._v("Public")]),e._v(" Key from BDK")]),e._v(" "),t("li",[e._v("The BIP84 derived Extended "),t("strong",[e._v("Private")]),e._v(" Key from Core.")])]),e._v(" "),t("p",[e._v("BDK wallet's owner will send to Core's owner the derived xpub for this purpose.\nThis is how the Core's multisig descriptor will be created and put into an\nenvironment variable:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export core_rec_desc=\"wsh(multi(2,$BDK_xpub_84_for_rec_desc,$core_xprv/84'/0'/0'/0/*))\"\n")])])]),t("p",[e._v("Where of course "),t("code",[e._v("$BDK_xpub_84_for_rec_desc")]),e._v("is the derived master public created\nin BDK and received by Core's owner.")]),e._v(" "),t("p",[e._v("The meaning of what is before and after is illustrated in the doc that explain\nthe use of "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors in Bitcoin Core"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("We add the necessary checksum using the specific "),t("code",[e._v("bitcoin-cli")]),e._v(" call.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export core_rec_desc_chksum=$core_rec_desc#$(bitcoin-cli -testnet getdescriptorinfo $core_rec_desc | jq -r '.checksum')\n")])])]),t("p",[e._v("We repeat the same to build the descriptor to receive the change.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export core_chg_desc=\"wsh(multi(2,$BDK_xpub_84_for_chg_desc,$core_xprv/84'/0'/0'/1/*))\"\nexport core_chg_desc_chksum=$core_chg_desc#$(bitcoin-cli -testnet getdescriptorinfo $core_chg_desc|jq -r '.checksum')\n")])])]),t("h4",{attrs:{id:"in-bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#in-bdk"}},[e._v("#")]),e._v(" In BDK:")]),e._v(" "),t("p",[e._v("For BDK we set the derivation for receiving addresses and change addresses\nin the command line (maybe setting an alias)")]),e._v(" "),t("p",[e._v("Building the descriptor:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export BDK_rec_desc=\"wsh(multi(2,$BDK_xprv/84'/0'/0'/0/*,$core_xpub_84_for_rec_desc))\"`\n")])])]),t("p",[e._v("Please note that the order of the extended key in the descriptor MUST be the\nsame in the 2 wallets.")]),e._v(" "),t("p",[t("em",[e._v("We have chosen to put BDK first and in each software wallet, the public key\nderived from BDK will always come first. In alternative, we could have chosen to\nproduce the descriptor, "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/pull/17056?ref=tokendaily",target:"_blank",rel:"noopener noreferrer"}},[e._v("chosing a "),t("code",[e._v("soretedmulti")]),e._v(" multisignature setup"),t("OutboundLink")],1)]),e._v(".")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export BDK_rec_desc_chksum=$BDK_rec_desc#$(bitcoin-cli -testnet getdescriptorinfo $BDK_rec_desc | jq -r '.checksum')\nexport BDK_chg_desc=\"wsh(multi(2,$BDK_xprv/84'/0'/0'/1/*,$core_xpub_84_for_chg_desc))\"\nexport BDK_chg_desc_chksum=$BDK_chg_desc#$(bitcoin-cli -testnet getdescriptorinfo $BDK_chg_desc | jq -r '.checksum')\n")])])]),t("p",[e._v("To take a look at the variables we have produced so far:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("env | grep 'core_'\nenv | grep 'BDK_'\n")])])]),t("p",[e._v("Now we will use the multisig descriptor wallet to receive testnet coins with\nAlice and Bob's software")]),e._v(" "),t("h3",{attrs:{id:"3-use-each-others-software-to-receive-testnet-coins-from-a-faucet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#3-use-each-others-software-to-receive-testnet-coins-from-a-faucet"}},[e._v("#")]),e._v(" 3. Use each other's software to receive testnet coins from a faucet")]),e._v(" "),t("h4",{attrs:{id:"in-bitcoin-core-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#in-bitcoin-core-2"}},[e._v("#")]),e._v(" In Bitcoin Core")]),e._v(" "),t("p",[e._v('Alice must create an empty, experimental new "descriptors wallet" in Core and\nto import the multisig Output Descriptor.')]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('bitcoin-cli -testnet createwallet "multisig2of2withBDK" false true "" false true false\n')])])]),t("p",[e._v("The flag are to:")]),e._v(" "),t("ul",[t("li",[e._v("use the private keys")]),e._v(" "),t("li",[e._v("make it empty")]),e._v(" "),t("li",[e._v("no password provided to the wallet")]),e._v(" "),t("li",[e._v("reusing of addresses not allowed")]),e._v(" "),t("li",[e._v('"new experimental descriptors wallet"')]),e._v(" "),t("li",[e._v("don't load it on start up")])]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK importdescriptors "[{\\"desc\\":\\"$core_rec_desc_chksum\\",\\"timestamp\\":\\"now\\",\\"active\\":true,\\"internal\\":false},{\\"desc\\":\\"$core_chg_desc_chksum\\",\\"timestamp\\":\\"now\\",\\"active\\":true,\\"internal\\":true}]"\n')])])]),t("p",[e._v("Now Alice asks for her first receiving multisignature address.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export first_address=$(bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK getnewaddress)\necho $first_address\n")])])]),t("h4",{attrs:{id:"bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk"}},[e._v("#")]),e._v(" BDK")]),e._v(" "),t("p",[e._v("In BDK Bob can specify directly the descriptors on the command line to produce\nthe multisig address, because BDK is descriptors aware natively.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint get_new_address`\n')])])]),t("p",[e._v('Et voilà: if we have done everything correctly, the newly created address in\nCore is the same of the newly created address in BDK. this is part of the\n"miracle" of descriptors\' interoperability.')]),e._v(" "),t("h4",{attrs:{id:"we-ask-for-testnet-coins-giving-the-first-created-address"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#we-ask-for-testnet-coins-giving-the-first-created-address"}},[e._v("#")]),e._v(" We ask for testnet coins giving the first created address.")]),e._v(" "),t("p",[e._v('To find testnet coins for free, you can just google "testnet faucet" and you\nshould find some satoshis to play with. Just give to the site your first\ngenerated address and, in twenty minutes, you will find the satoshis in\nyour balance both in Core and in BDK.')]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('# to check it in Core:\n\nbitcoin-cli -testnet -rpcwallet=multisig2of2withBDK getbalance\n\n# In BDK:\n\n# Sync with the blockchain\nrepl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint sync\n# Get the balance\nrepl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint get_balance\n')])])]),t("p",[e._v("Some testnet faucets have an address to send back the unused satoshi after\nthe use. Take note of that because we will use it in the next step.")]),e._v(" "),t("h3",{attrs:{id:"4-we-return-part-of-the-satoshis-received-back-to-the-faucet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#4-we-return-part-of-the-satoshis-received-back-to-the-faucet"}},[e._v("#")]),e._v(" 4. we return part of the satoshis received back to the faucet")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('export psbt=$(bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK walletcreatefundedpsbt "[]" "[{\\"tb1qrcesfj9f2d7x40xs6ztnlrcgxhh6vsw8658hjdhdy6qgkf6nfrds9rp79a\\":0.000012}]" | jq -r \'.psbt\')\n\nexport psbt=$(bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK walletprocesspsbt $psbt | jq -r \'.psbt\')\n{\n "psbt": "cHNidP8BAIkCAAAAATj90EC+NAuXj7y6SseZJucoJM6sGnUcVm9koTveZECTAAAAAAD+////AmACAAAAAAAAIgAg98ol9j4AalD71E0mV5QV0uM6/vCT+pi2twxr/zrvLROwBAAAAAAAACIAIB4zBMipU3xqvNDQlz+PCDXvpkHH1Q95Nu0mgIsnU0jbAAAAAAABAIkCAAAAAQS+ObgGG6UwtvaO3KYph2E3/ws7Q83RbmR3rxC0fKYSAQAAAAD+////AtAHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNDAHQAAAAAAACIAIBQpiDTgPIMt0ld8cmuYqlY+EIPjvrmMqZruDhs61hQNAAAAAAEBK9AHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNAiAgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAAQEFR1IhArn3tec7n7318rnWqf0dIIwtLtfxo6Zt0HV70UvZYaWvIQNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfVKuIgYCufe15zufvfXyudap/R0gjC0u1/Gjpm3QdXvRS9lhpa8YNEw2cFQAAIAAAACAAAAAgAAAAAAAAAAAIgYDbdI+wHtIgO6pS6Ja7jai1pDwPeidKoDCytTO1jhjAH0YO/laXFQAAIAAAACAAAAAgAAAAAAAAAAAAAEBR1IhAqccvA3rL13D1K4GeWjcahDsO3P8oaVNBttk4MlCKXIcIQLHKhjmPuCQjyS77ZfaMN2tdgNKcf/+57VXGZhz/UWTl1KuIgICpxy8DesvXcPUrgZ5aNxqEOw7c/yhpU0G22TgyUIpchwYNEw2cFQAAIAAAACAAAAAgAEAAAADAAAAIgICxyoY5j7gkI8ku+2X2jDdrXYDSnH//ue1VxmYc/1Fk5cYO/laXFQAAIAAAACAAAAAgAEAAAADAAAAAAA=",\n "complete": false\n}\n')])])]),t("p",[e._v("Exactly! Note the "),t("code",[e._v('"complete": false')]),e._v(". We have processed the transaction with\nCore but we miss one of the necessary key of the multisig 2of2 setup (The one\ncontained inside BDK).")]),e._v(" "),t("p",[t("code",[e._v("tb1qrcesfj9f2d7x40xs6ztnlrcgxhh6vsw8658hjdhdy6qgkf6nfrds9rp79a")]),e._v(" is the address\nwe got from the faucet site to return the satoshis.")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("PSBT"),t("OutboundLink")],1),e._v(" is sent over to the BDK wallet owner who tries to sign the\ntransaction:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint sign --psbt $psbt\n{\n "is_finalized": true,\n "psbt": "cHNidP8BAIkCAAAAATj90EC+NAuXj7y6SseZJucoJM6sGnUcVm9koTveZECTAAAAAAD+////AmACAAAAAAAAIgAg98ol9j4AalD71E0mV5QV0uM6/vCT+pi2twxr/zrvLROwBAAAAAAAACIAIB4zBMipU3xqvNDQlz+PCDXvpkHH1Q95Nu0mgIsnU0jbAAAAAAABAIkCAAAAAQS+ObgGG6UwtvaO3KYph2E3/ws7Q83RbmR3rxC0fKYSAQAAAAD+////AtAHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNDAHQAAAAAAACIAIBQpiDTgPIMt0ld8cmuYqlY+EIPjvrmMqZruDhs61hQNAAAAAAEBK9AHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNAiAgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAASICArn3tec7n7318rnWqf0dIIwtLtfxo6Zt0HV70UvZYaWvRzBEAiBkVDLgVEwvENnLx+04o7gGpGjFDBwAXTJmf8Yvo35oygIgbuBkHsvPC9jmZcMZ9P+Pwp01yxSaWo+5feyPmd3ai1kBAQVHUiECufe15zufvfXyudap/R0gjC0u1/Gjpm3QdXvRS9lhpa8hA23SPsB7SIDuqUuiWu42otaQ8D3onSqAwsrUztY4YwB9Uq4iBgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfRg7+VpcVAAAgAAAAIAAAACAAAAAAAAAAAAiBgK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlrxg0TDZwVAAAgAAAAIAAAACAAAAAAAAAAAABBwABCNoEAEcwRAIgZFQy4FRMLxDZy8ftOKO4BqRoxQwcAF0yZn/GL6N+aMoCIG7gZB7LzwvY5mXDGfT/j8KdNcsUmlqPuX3sj5nd2otZAUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAAUdSIQK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlryEDbdI+wHtIgO6pS6Ja7jai1pDwPeidKoDCytTO1jhjAH1SrgABAUdSIQKnHLwN6y9dw9SuBnlo3GoQ7Dtz/KGlTQbbZODJQilyHCECxyoY5j7gkI8ku+2X2jDdrXYDSnH//ue1VxmYc/1Fk5dSriICAqccvA3rL13D1K4GeWjcahDsO3P8oaVNBttk4MlCKXIcGDRMNnBUAACAAAAAgAAAAIABAAAAAwAAACICAscqGOY+4JCPJLvtl9ow3a12A0px//7ntVcZmHP9RZOXGDv5WlxUAACAAAAAgAAAAIABAAAAAwAAAAAA"\n}\n')])])]),t("p",[e._v('The signature has succeded (note the "is_finalized": true,) and now we can\nbroadcast the transction.')]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint broadcast --psbt "cHNidP8BAIkCAAAAATj90EC+NAuXj7y6SseZJucoJM6sGnUcVm9koTveZECTAAAAAAD+////AmACAAAAAAAAIgAg98ol9j4AalD71E0mV5QV0uM6/vCT+pi2twxr/zrvLROwBAAAAAAAACIAIB4zBMipU3xqvNDQlz+PCDXvpkHH1Q95Nu0mgIsnU0jbAAAAAAABAIkCAAAAAQS+ObgGG6UwtvaO3KYph2E3/ws7Q83RbmR3rxC0fKYSAQAAAAD+////AtAHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNDAHQAAAAAAACIAIBQpiDTgPIMt0ld8cmuYqlY+EIPjvrmMqZruDhs61hQNAAAAAAEBK9AHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNAiAgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAASICArn3tec7n7318rnWqf0dIIwtLtfxo6Zt0HV70UvZYaWvRzBEAiBkVDLgVEwvENnLx+04o7gGpGjFDBwAXTJmf8Yvo35oygIgbuBkHsvPC9jmZcMZ9P+Pwp01yxSaWo+5feyPmd3ai1kBAQVHUiECufe15zufvfXyudap/R0gjC0u1/Gjpm3QdXvRS9lhpa8hA23SPsB7SIDuqUuiWu42otaQ8D3onSqAwsrUztY4YwB9Uq4iBgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfRg7+VpcVAAAgAAAAIAAAACAAAAAAAAAAAAiBgK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlrxg0TDZwVAAAgAAAAIAAAACAAAAAAAAAAAABBwABCNoEAEcwRAIgZFQy4FRMLxDZy8ftOKO4BqRoxQwcAF0yZn/GL6N+aMoCIG7gZB7LzwvY5mXDGfT/j8KdNcsUmlqPuX3sj5nd2otZAUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAAUdSIQK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlryEDbdI+wHtIgO6pS6Ja7jai1pDwPeidKoDCytTO1jhjAH1SrgABAUdSIQKnHLwN6y9dw9SuBnlo3GoQ7Dtz/KGlTQbbZODJQilyHCECxyoY5j7gkI8ku+2X2jDdrXYDSnH//ue1VxmYc/1Fk5dSriICAqccvA3rL13D1K4GeWjcahDsO3P8oaVNBttk4MlCKXIcGDRMNnBUAACAAAAAgAAAAIABAAAAAwAAACICAscqGOY+4JCPJLvtl9ow3a12A0px//7ntVcZmHP9RZOXGDv5WlxUAACAAAAAgAAAAIABAAAAAwAAAAAA"\n{\n "txid": "a0b082e3b0579822d4a0b0fa95a4c4662f6b128ffd43fdcfe53c37473ce85dee"\n}\n')])])]),t("h2",{attrs:{id:"conclusion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),t("p",[e._v("We have built an HDM and we have used it with two indipendent wallets, which\nare compatible with "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("BIP 174"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(". Hopefully we\nwill see many other compatible wallets beyound "),t("a",{attrs:{href:"https://bitcoincore.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Core"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://bitcoindevkit.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("BDK"),t("OutboundLink")],1),e._v(",\nwith which we will be able to easily set up multi signature schemes.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/50.73103c2e.js b/assets/js/50.7c06d746.js similarity index 99% rename from assets/js/50.73103c2e.js rename to assets/js/50.7c06d746.js index c55b72f9ea..0dab5597c0 100644 --- a/assets/js/50.73103c2e.js +++ b/assets/js/50.7c06d746.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{400:function(e,t,s){"use strict";s.r(t);var n=s(7),a=Object(n.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("This is the first of a two-parts blog series in which I will try to explain all the changes that I made to BDK (and some of its dependencies) to make our "),t("a",{attrs:{href:"https://twitter.com/afilini/status/1459763243556163584",target:"_blank",rel:"noopener noreferrer"}},[e._v("first Taproot transaction in mainnet"),t("OutboundLink")],1),e._v(", which also\nturned out to be "),t("a",{attrs:{href:"https://twitter.com/afilini/status/1459774394054725634",target:"_blank",rel:"noopener noreferrer"}},[e._v("the first ever use of the new "),t("code",[e._v("OP_CHECKSIGADD")]),e._v(" opcode"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Hopefully this will give an insight into what kind of changes need to be made to a wallet in order to support spending "),t("code",[e._v("P2TR")]),e._v(" outputs, both with key-spend and script-spend. BDK actually delegates\nmost of the hard work to "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-miniscript"),t("OutboundLink")],1),e._v(", and luckily most of the Taproot code was already implemented by the time I started working on it. I only had to patch a few little bugs here and there, and it ended up\nworking flawlessly in the end.")]),e._v(" "),t("p",[e._v("In this first part I will focus on the changes made to our dependencies, "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-bitcoin",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-bitcoin"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-miniscript"),t("OutboundLink")],1),e._v(". In the second part I will talk about BDK itself.")]),e._v(" "),t("h2",{attrs:{id:"backstory"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#backstory"}},[e._v("#")]),e._v(" Backstory")]),e._v(" "),t("p",[e._v("On the evening of Thursday, November 11th I was attending our weekly "),t("a",{attrs:{href:"https://www.satoshispritz.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Satoshi Spritz"),t("OutboundLink")],1),e._v(" meetup in Milan. The activation of Taproot was right around the corner, and naturally that was the main discussion\ntopic that night. The activation was forecasted for the early afternoon of Sunday, November 14th, a little less than 72h later.")]),e._v(" "),t("p",[e._v("I began to wonder how hard it would be to patch BDK and add support for Taproot. I knew most of the work had already been done in our main dependencies, "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-bitcoin",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-bitcoin"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-miniscript"),t("OutboundLink")],1),e._v(", and so I decided\nto challenge myself: could I make it in time for the activation?")]),e._v(" "),t("p",[e._v('The following day I started digging into the topic. It didn\'t help that up until that time I only had a rather "high level" idea of how Taproot worked, but luckily all the BIPs were very well written and\nstraightforward to understand.')]),e._v(" "),t("p",[e._v("By Friday night (or rather, early Saturday morning) "),t("a",{attrs:{href:"https://mempool.space/signet/tx/ba0ebb350717701ca4ea109aadfbaf3058f6cd73e5ece3927ddee653de06cf5a",target:"_blank",rel:"noopener noreferrer"}},[e._v("I had Taproot key-spend working"),t("OutboundLink")],1),e._v(", which made me pretty optimistic even though the activation date was actually moving closer, now being forecasted for\nSunday "),t("em",[e._v("morning")]),e._v(".")]),e._v(" "),t("p",[e._v("After a few hours of sleep I went back to work and by early Saturday afternoon "),t("a",{attrs:{href:"https://mempool.space/signet/tx/41d7d49f9f4edffa9ca88ad6fb887fbf1ae68f9f31def267fdb3a5949f766bf5",target:"_blank",rel:"noopener noreferrer"}},[e._v("I had Taproot script-spend working as well"),t("OutboundLink")],1),e._v(". This left me a few hours to coordinate with some friends and "),t("a",{attrs:{href:"https://mempool.space/address/1Taproote7gvQGKz5g982ecSbPvqJhMUf",target:"_blank",rel:"noopener noreferrer"}},[e._v("generate a vanity address"),t("OutboundLink")],1),e._v("\nto deposit funds into temporarily, as we didn't trust sending them to Taproot addresses before the activation (as they were anyone-can-spend according to the pre-activation rules).")]),e._v(" "),t("p",[e._v("After another pretty short night, I woke up a 5:30 AM on Sunday to monitor the activation. I broadcasted our transactions shortly after 6:00 AM as the activation block was being mined. Unfortunately, the first\nthree blocks that were enforcing Taproot rules "),t("a",{attrs:{href:"https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-November/019598.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("didn't include any Taproot transaction"),t("OutboundLink")],1),e._v(", which indicates that the miners weren't actually running the new Bitcoin Core 22.0 nodes. The fourth block, mined by "),t("code",[e._v("Foundry USA")]),e._v(" "),t("a",{attrs:{href:"https://mempool.space/tx/2eb8dbaa346d4be4e82fe444c2f0be00654d8cfd8c4a9a61b11aeaab8c00b272",target:"_blank",rel:"noopener noreferrer"}},[e._v("included my transaction"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://twitter.com/achow101/status/1459760452775387136?s=20",target:"_blank",rel:"noopener noreferrer"}},[e._v("a few others"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("In the end our transaction was the third Taproot script-spend in the block, but the first to use the new "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki#script-execution",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("OP_CHECKSIGADD")]),t("OutboundLink")],1),e._v(" opcode, as the two preceding it were respectively "),t("a",{attrs:{href:"https://mempool.space/tx/37777defed8717c581b4c0509329550e344bdc14ac38f71fc050096887e535c8",target:"_blank",rel:"noopener noreferrer"}},[e._v("a single-sig"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://mempool.space/tx/905ecdf95a84804b192f4dc221cfed4d77959b81ed66013a7e41a6e61e7ed530",target:"_blank",rel:"noopener noreferrer"}},[e._v("a 2-of-2 multisig"),t("OutboundLink")],1),e._v("\nscript, made with with two "),t("code",[e._v("OP_CHECKSIG(VERIFY)")]),e._v("s.")]),e._v(" "),t("p",[e._v("Now, with the context out of the way, we can begin talking about the code!")]),e._v(" "),t("h2",{attrs:{id:"rust-bitcoin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rust-bitcoin"}},[e._v("#")]),e._v(" rust-bitcoin")]),e._v(" "),t("p",[e._v("The first dependency I had to update was "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-bitcoin",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-bitcoin"),t("OutboundLink")],1),e._v(". Most of the taproot stuff were already merged in "),t("code",[e._v("master")]),e._v(" (altough they hadn't been released yet). One notable missing part was the support for "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0371.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("BIP371")]),t("OutboundLink")],1),e._v(",\nwhich is an extension of "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("BIP174")]),t("OutboundLink")],1),e._v(", aka the "),t("code",[e._v("Partially Signed Bitcoin Transaction")]),e._v(" BIP. This new BIP defines a few new fields that are required to properly handle Taproot transactions.")]),e._v(" "),t("p",[e._v("Luckily most of the work had already been done by "),t("a",{attrs:{href:"https://twitter.com/sanket1729",target:"_blank",rel:"noopener noreferrer"}},[e._v("sanket1729"),t("OutboundLink")],1),e._v(", so I forked his branch and made only few very minor changes, just to expose a structure that I will have to use later which in his code wasn't public.")]),e._v(" "),t("p",[e._v("You can find all the commits mentioned here in "),t("a",{attrs:{href:"https://github.com/afilini/rust-bitcoin/tree/taproot-testing",target:"_blank",rel:"noopener noreferrer"}},[e._v("my rust-bitcoin "),t("code",[e._v("taproot-testing")]),e._v(" branch"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git diff 187234f f830df9\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("diff --git a/src/lib.rs b/src/lib.rs\nindex 87d9c36..d5e5802 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/lib.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/lib.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("@@ -54,7 +54,6 @@")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(unused_mut)]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(dead_code)]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(unused_imports)]\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(missing_docs)]\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(unused_must_use)]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(broken_intra_doc_links)]\n")])]),e._v("\ndiff --git a/src/util/taproot.rs b/src/util/taproot.rs\nindex 674eeee..3d56cbc 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/util/taproot.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/util/taproot.rs")]),e._v("\n@@ -440,7 +440,7 @@ impl TaprootBuilder {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("// Internally used structure to represent the node information in taproot tree\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v('#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]\n')])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("pub(crate) struct NodeInfo {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("pub struct NodeInfo {\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" /// Merkle Hash for this node\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub(crate) hash: sha256::Hash,\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" /// information about leaves inside this node\n")])]),e._v("@@ -448,8 +448,12 @@ pub(crate) struct NodeInfo {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("}\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("impl NodeInfo {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub fn hash(&self) -> &sha256::Hash {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" &self.hash\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // Create a new NodeInfo with omitted/hidden info\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn new_hidden(hash: sha256::Hash) -> Self {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub fn new_hidden(hash: sha256::Hash) -> Self {\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Self {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" hash: hash,\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" leaves: vec![],\n")])]),e._v("@@ -457,7 +461,7 @@ impl NodeInfo {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // Create a new leaf with NodeInfo\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn new_leaf_with_ver(script: Script, ver: LeafVersion) -> Self {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub fn new_leaf_with_ver(script: Script, ver: LeafVersion) -> Self {\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let leaf = LeafInfo::new(script, ver);\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Self {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" hash: leaf.hash(),\n")])]),e._v("@@ -466,7 +470,7 @@ impl NodeInfo {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // Combine two NodeInfo's to create a new parent\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn combine(a: Self, b: Self) -> Result {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub fn combine(a: Self, b: Self) -> Result {\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let mut all_leaves = Vec::with_capacity(a.leaves.len() + b.leaves.len());\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" for mut a_leaf in a.leaves {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" a_leaf.merkle_branch.push(b.hash)?; // add hashing partner\n")])]),e._v("\n")])])]),t("p",[e._v("There isn't much to explain here: I disabled the "),t("code",[e._v("missing_docs")]),e._v(" lint so that the compiler wouldn't complain about the new public methods that aren't documented.\nThen, I added a getter for the "),t("code",[e._v("hash")]),e._v(" field of "),t("code",[e._v("NodeInfo")]),e._v(" and made the struct itself and a bunch of methods public.")]),e._v(" "),t("p",[e._v('We will use this structure later to recover the merkle root of a Taproot script tree, given one leaf and the other "hidden" branches.')]),e._v(" "),t("h2",{attrs:{id:"rust-miniscript"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rust-miniscript"}},[e._v("#")]),e._v(" rust-miniscript")]),e._v(" "),t("p",[e._v("Moving on to "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-miniscript"),t("OutboundLink")],1),e._v(': once again, most of the work required to support Taproot had already been done, but this time I was working with very "early" prototype-like code, so I was prepared to\nmake some changes to the code to get it to work how I wanted.')]),e._v(" "),t("p",[e._v("Instead of showing one big diff I will talk about the commits individually, which I think will help making more clear what I was doing.")]),e._v(" "),t("p",[e._v("Once again, you can find all the commits referenced here in "),t("a",{attrs:{href:"https://github.com/afilini/rust-miniscript/tree/taproot",target:"_blank",rel:"noopener noreferrer"}},[e._v("my rust-miniscript "),t("code",[e._v("taproot")]),e._v(" branch"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show 34cf15b\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit 34cf15b3aac1d8c2693af1b9749b888f3f29e510\nAuthor: Alekos Filini \nDate: Fri Nov 12 12:06:35 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Fix TapTree iter depth\n")])]),e._v("\ndiff --git a/src/descriptor/tr.rs b/src/descriptor/tr.rs\nindex 79d3c05..314c7f4 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/descriptor/tr.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/descriptor/tr.rs")]),e._v("\n@@ -65,7 +65,7 @@ impl TapTree {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" /// Iterate over all miniscripts\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub fn iter(&self) -> TapTreeIter {\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" TapTreeIter { stack: vec![self] }\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" TapTreeIter { stack: vec![(0, self)] }\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // Helper function to translate keys\n")])]),e._v("@@ -262,7 +262,7 @@ pub struct TapTreeIter<'a, Pk: MiniscriptKey>\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("where\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Pk: 'a,\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("{\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" stack: Vec<&'a TapTree>,\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" stack: Vec<(usize, &'a TapTree)>,\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("}\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("impl<'a, Pk> Iterator for TapTreeIter<'a, Pk>\n")])]),e._v("@@ -273,13 +273,13 @@ where\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn next(&mut self) -> Option {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" while !self.stack.is_empty() {\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' let last = self.stack.pop().expect("Size checked above");\n')])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' let (depth, last) = self.stack.pop().expect("Size checked above");\n')])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match &*last {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" TapTree::Tree(l, r) => {\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" self.stack.push(&r);\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" self.stack.push(&l);\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" self.stack.push((depth + 1, &r));\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" self.stack.push((depth + 1, &l));\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" TapTree::Leaf(ref ms) => return Some((self.stack.len(), ms)),\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" TapTree::Leaf(ref ms) => return Some((depth, ms)),\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" None\n")])])])])]),t("p",[t("code",[e._v("TapTreeIterator")]),e._v(" is an iterator that goes through a "),t("code",[e._v("TapTree")]),e._v(" and yields a "),t("code",[e._v("(depth, node)")]),e._v(" pair. This is then fed to "),t("a",{attrs:{href:"https://github.com/afilini/rust-miniscript/blob/taproot/src/descriptor/tr.rs#L183-L189",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("TaprootBuilder")]),t("OutboundLink")],1),e._v(", which returns an error if trying to insert nodes\nin "),t("a",{attrs:{href:"https://github.com/afilini/rust-bitcoin/blob/taproot-testing/src/util/taproot.rs#L403-L405",target:"_blank",rel:"noopener noreferrer"}},[e._v("an order that is not DFS"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("The way the depth was computed before made the builder always fail for non-trivial trees (i.e. more than 1 node).")]),e._v(" "),t("p",[e._v("Here I decided to play the safe card, and just keep track of the depth explicitly: I think there might be a way to compute the depth just knowing the "),t("code",[e._v("self.stack.len()")]),e._v(" (assuming the tree has a specific structure,\nwhich I'm not sure applies here), but anyway I didn't have much time to think about it and I just went for the \"dumb but idiot-proof\" way which ended up working fine.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show f4a3459\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit f4a3459128e37ca0c2701b8b6da064d4952296ff\nAuthor: Alekos Filini \nDate: Sat Nov 13 14:15:52 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Switch rust-bitcoin rev\n")])]),e._v("\ndiff --git a/Cargo.toml b/Cargo.toml\nindex 12825e8..8240024 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/Cargo.toml")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/Cargo.toml")]),e._v('\n@@ -17,7 +17,7 @@ rand = ["bitcoin/rand"]\n\n'),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("[dependencies]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v('# bitcoin = "0.27"\n')])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v('bitcoin = {git = "https://github.com/sanket1729/rust-bitcoin", branch = "taproot_psbt"}\n')])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v('bitcoin = { git = "https://github.com/afilini/rust-bitcoin.git", branch = "taproot-testing" }\n')])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("[dependencies.serde]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v('version = "1.0"\n')])])])])]),t("p",[e._v("Trivial commit, switch to "),t("a",{attrs:{href:"https://github.com/afilini/rust-bitcoin/tree/taproot-testing",target:"_blank",rel:"noopener noreferrer"}},[e._v("my fork of rust-bitcoin"),t("OutboundLink")],1),e._v(" so that I can make changes if necessary.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show 0446b16\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit 0446b1631cec9f7118d46f0f4c94ccd20de29f94\nAuthor: Alekos Filini \nDate: Sat Nov 13 14:25:18 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Parse x-only keys\n")])]),e._v("\ndiff --git a/src/descriptor/key.rs b/src/descriptor/key.rs\nindex 4108d00..b7f90b5 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/descriptor/key.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/descriptor/key.rs")]),e._v("\n@@ -283,9 +283,9 @@ impl FromStr for DescriptorPublicKey {\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn from_str(s: &str) -> Result {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' // A "raw" public key without any origin is the least we accept.\n')])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" if s.len() < 66 {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" if s.len() < 64 {\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" return Err(DescriptorKeyParseError(\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' "Key too short (<66 char), doesn\'t match any format",\n')])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' "Key too short (<64 char), doesn\'t match any format",\n')])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" ));\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("\n@@ -301,6 +301,14 @@ impl FromStr for DescriptorPublicKey {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" derivation_path,\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" wildcard,\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }))\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" } else if key_part.len() == 64 {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // x-only pubkey, prefix it with `02`\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' let key = bitcoin::PublicKey::from_str(&format!("02{}", key_part))\n')]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' .map_err(|_| DescriptorKeyParseError("Error while parsing x-only public key"))?;\n')]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Ok(DescriptorPublicKey::SinglePub(DescriptorSinglePub {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" key,\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" origin,\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }))\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" } else {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" if key_part.len() >= 2\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' && !(&key_part[0..2] == "02" || &key_part[0..2] == "03" || &key_part[0..2] == "04")\n')])]),e._v("diff --git a/src/lib.rs b/src/lib.rs\nindex e168b16..3a2335e 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/lib.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/lib.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("@@ -95,8 +95,6 @@")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(non_snake_case)]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(unused_mut)]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(dead_code)]\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(unused_imports)]\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(missing_docs)]\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("pub extern crate bitcoin;\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v('#[cfg(feature = "serde")]\n')])])])])]),t("p",[e._v("This, I'm not really sure of: Taproot uses x-only public keys, which means that the first byte (which is usually a "),t("code",[e._v("03")]),e._v(" or a "),t("code",[e._v("02")]),e._v(") that indicates the parity of the EC point is completely dropped, and it's implicit\nthat the point is even (= "),t("code",[e._v("02")]),e._v("). Check out "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("BIP340")]),t("OutboundLink")],1),e._v(" for a much better explanation.")]),e._v(" "),t("p",[e._v("So here when I find a string that is only 64 characters long I will assume it's an x-only pubkey, and I will parse it as a normal "),t("code",[e._v("bitcoin::PublicKey")]),e._v(" by prefixing it with "),t("code",[e._v("02")]),e._v(".")]),e._v(" "),t("p",[e._v("I guess one alternative could have been to try and parse it as a "),t("code",[e._v("schnorr::PublicKey")]),e._v(' and then "convert" it to a '),t("code",[e._v("ecdsa::PublicKey")]),e._v(" which should be supported, but once again I just wanted to get it done quickly and\nthis worked fine.")]),e._v(" "),t("p",[e._v("I also disabled the "),t("code",[e._v("unused_imports")]),e._v(" and "),t("code",[e._v("missing_docs")]),e._v(" lint so that the compiler wouldn't whine too much.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show 87316ff\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit 87316fffd06ab3bdf300fd1a958ddaa2789a6696\nAuthor: Alekos Filini \nDate: Sat Nov 13 14:26:01 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Parse `tr()` descriptors\n")])]),e._v("\ndiff --git a/src/descriptor/mod.rs b/src/descriptor/mod.rs\nindex 06d98e1..4190786 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/descriptor/mod.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/descriptor/mod.rs")]),e._v("\n@@ -610,6 +610,7 @@ where\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' ("wpkh", 1) => Descriptor::Wpkh(Wpkh::from_tree(top)?),\n')]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' ("sh", 1) => Descriptor::Sh(Sh::from_tree(top)?),\n')]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' ("wsh", 1) => Descriptor::Wsh(Wsh::from_tree(top)?),\n')])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' ("tr", _) => Descriptor::Tr(Tr::from_tree(top)?),\n')])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" _ => Descriptor::Bare(Bare::from_tree(top)?),\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" })\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("diff --git a/src/expression.rs b/src/expression.rs\nindex 1cef614..11a68d3 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/expression.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/expression.rs")]),e._v("\n@@ -100,7 +100,12 @@ impl<'a> Tree<'a> {\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" sl = &sl[n + 1..];\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" loop {\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let (arg, new_sl) = Tree::from_slice_helper_round(sl, depth + 1)?;\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let (arg, new_sl) = if sl.contains('{') {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Tree::from_slice_helper_curly(sl, depth + 1)?\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" } else {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Tree::from_slice_helper_round(sl, depth + 1)?\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" };\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" ret.args.push(arg);\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" if new_sl.is_empty() {\n")])])])])]),t("p",[e._v("When trying to parse a descriptor (essentially turning a recursive string of "),t("code",[e._v("operator(args)")]),e._v(" into an abstract tree in memory) use a "),t("em",[e._v("curly-bracket-aware")]),e._v(" parser if there is one in the string.")]),e._v(" "),t("p",[e._v("The code to then build a "),t("code",[e._v("Tr")]),e._v(" struct given an "),t("code",[e._v("expression::Tree")]),e._v(" (and the "),t("code",[e._v("from_slice_helper_curly")]),e._v(" function) were already implemented, so it was just a matter of correctly\nbuilding the abstract tree by parsing curly brackets in descriptors.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show 3055cab\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit 3055cabef8bd51eda344ce501b03c533fd367b4f\nAuthor: Alekos Filini \nDate: Sat Nov 13 14:26:30 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Fix control block creation when satisfying `Tr`\n")])]),e._v("\ndiff --git a/src/descriptor/tr.rs b/src/descriptor/tr.rs\nindex 314c7f4..8487d56 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/descriptor/tr.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/descriptor/tr.rs")]),e._v("\n@@ -571,17 +571,14 @@ impl DescriptorTrait for Tr {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" } else {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let ver = LeafVersion::default();\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let leaf_script = (ms.encode(), ver);\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let control_block_set = spend_info\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .as_script_map()\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .get(&leaf_script)\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' .expect("Control block must exist in script map for every known leaf");\n')])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // let control_block_set = spend_info\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // .as_script_map()\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // .get(&leaf_script)\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' // .expect("Control block must exist in script map for every known leaf");\n')]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' let control_block = spend_info.control_block(&leaf_script).expect("Control block must exist in script map for every known leaf");\n')])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" wit.push(leaf_script.0.into_bytes()); // Push the leaf script\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // There can be multiple control blocks for a (script, ver) pair\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // Find the smallest one amongst those\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let control_block = control_block_set\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .iter()\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .min_by(|x, y| x.as_inner().len().cmp(&y.as_inner().len()))\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' .expect("Atleast one control must exist for a known leaf");\n')])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" wit.push(control_block.serialize());\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // Finally, save the minimum\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" min_wit = Some(wit);\n")])]),e._v("\n")])])]),t("p",[e._v("This is where things get more interesting: this section of code builds the witness to satisfy a Taproot descriptor. In case of a script-spend, we need to prove that the script we are using had been committed\ninto the public key of our "),t("code",[e._v("P2TR")]),e._v(' input. We do this by adding a "control block", that contains data about the parity of the key, the leaf version used, and the merkle path from the leaf we are using to spend\nup to the merkle root, which is committed into the public key. Once again, this is explained very well in '),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("BIP341")]),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Before my patch the code was only getting the set of merkle paths that could lead from the root to the leaves that contain a given script. For context, the signature of "),t("code",[e._v("TaprootSpendInfo::as_script_map(&self)")]),e._v(" is:")]),e._v(" "),t("div",{staticClass:"language-rust extra-class"},[t("pre",{pre:!0,attrs:{class:"language-rust"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/// Access the internal script map")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("pub")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("fn")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("as_script_map")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("->")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("BTreeMap")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("Script")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("LeafVersion")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("BTreeSet")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("TaprootMerkleBranch")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">>")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v('Then the code would look for the "shortest" path to that specific script, as it would save size in the final transaction (leaves that are more "deep" in the tree than others naturally have more hidden branches\nin their path to the root, and thus require a longer control block to reveal them all).')]),e._v(" "),t("p",[e._v("The issue here is that the "),t("code",[e._v("control_block")]),e._v(" variable is then serialized directly into the witness. But this is not a control block, it's just a set of merkle paths! A control block only has "),t("em",[e._v("one")]),e._v(" merkle path, and\nincludes the leaf version and the key parity bit.")]),e._v(" "),t("p",[e._v("Conveniently, the "),t("code",[e._v("TaprootSpendInfo")]),e._v(' struct also has this other method (I\'m including the implementation as well, because it shows that internally it does the same "trick" to find the shortest path):')]),e._v(" "),t("div",{staticClass:"language-rust extra-class"},[t("pre",{pre:!0,attrs:{class:"language-rust"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/// Obtain a [`ControlBlock`] for particular script with the given version.")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/// Returns [`None`] if the script is not contained in the [`TaprootSpendInfo`]")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/// If there are multiple ControlBlocks possible, this returns the shortest one.")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("pub")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("fn")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("control_block")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" script_ver"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("Script")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("LeafVersion")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("->")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("Option")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("ControlBlock")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("let")]),e._v(" merkle_branch_set "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("script_map"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("get")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("script_ver"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("?")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// Choose the smallest one amongst the multiple script maps")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("let")]),e._v(" smallest "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" merkle_branch_set\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("iter")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("min_by")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token closure-params"}},[t("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[e._v("|")]),e._v("x"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" y"),t("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[e._v("|")])]),e._v(" x"),t("span",{pre:!0,attrs:{class:"token number"}},[e._v(".0")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("len")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("cmp")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&")]),e._v("y"),t("span",{pre:!0,attrs:{class:"token number"}},[e._v(".0")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("len")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("expect")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Non-empty iterator"')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("Some")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("ControlBlock")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n internal_key"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("internal_key"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n output_key_parity"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("output_key_parity"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n leaf_version"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("LeafVersion")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("default")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n merkle_branch"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(":")]),e._v(" smallest"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("clone")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("So to fix this code we just have to use that method instead, and we can get it done in one single line!")]),e._v(" "),t("p",[e._v('Instead of removing the old code at the time I only commented it out, because I initially thought I would still have to look for the shortest script myself, and I figured the "sorting" code would come in handy\nlater on.')]),e._v(" "),t("p",[e._v("Also, if you are an acute observer, you might have noticed that there's a bug in this last snippet of code. Feel free to think about it a little bit, then check out the "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-bitcoin/pull/703",target:"_blank",rel:"noopener noreferrer"}},[e._v("PR"),t("OutboundLink")],1),e._v(" I made\nif you wanna know the answer!")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("git show 35378ad\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit 35378ad01a6f2b8161a3f36448b24d031f8aeaec\nAuthor: Alekos Filini \nDate: Sat Nov 13 14:27:14 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Consider key-spend max satisfaction weight\n")])]),e._v("\ndiff --git a/src/descriptor/tr.rs b/src/descriptor/tr.rs\nindex 8487d56..fabf860 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/descriptor/tr.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/descriptor/tr.rs")]),e._v("\n@@ -593,7 +593,7 @@ impl DescriptorTrait for Tr {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn max_satisfaction_weight(&self) -> Result {\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let mut max_wieght = None;\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let mut max_wieght = Some(65);\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" for (depth, ms) in self.iter_scripts() {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let script_size = ms.script_size();\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let max_sat_elems = match ms.max_satisfaction_witness_elements() {\n")])])])])]),t("p",[e._v("This is a little bug in the code that tries to compute what the maximum satisfaction weight would be for a descriptor. For instance, we use this in BDK to compute how many extra sats of fees we need to pay\nin order to target a given fee rate, assuming the descriptor is satisfied with the worst (larger and most expensive) path.")]),e._v(" "),t("p",[e._v("For Taproot descriptors, it's just a matter of iterating over the leaves in the tree and pick the most expensive one... or is it? This doesn't take into account that Taproot outputs can also be spent with\nkey-spend, which means just pushing a signature to the witness. This signature is 64 bytes long when using the new "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("SIGHASH_DEFAULT")]),t("OutboundLink")],1),e._v(" sighash, or 65 otherwise. Since we are thinking about the maximum satisfaction\nweight, or the worst case possible, we naturally pick the latter.")]),e._v(" "),t("p",[e._v("Note that theoretically you could build a Taproot address \"without\" an available key-path spend (by using an unspendable Schnorr public key), but the code here in rust-miniscript doesn't take that into\naccount, as there's no way that I'm aware of to specificy in a "),t("code",[e._v("tr()")]),e._v(" descriptor that the key is unspendable. So, while theoretically here we should first check whether the key-spend path is available before\naccounting for its weight, in practice this is always true in miniscript so we just use that as our starting worst case and update it later if necessary while iterating the tree leaves.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show b4878f8\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit b4878f816e9ede11d5ed947c06e03aa988e3e26f\nAuthor: Alekos Filini \nDate: Sat Nov 13 14:27:53 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Look for taproot stuff in psbts\n")])]),e._v("\ndiff --git a/src/psbt/mod.rs b/src/psbt/mod.rs\nindex 9a8b17d..42c6ce8 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/psbt/mod.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/psbt/mod.rs")]),e._v("\n@@ -25,13 +25,14 @@ use bitcoin;\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use bitcoin::hashes::{hash160, ripemd160, sha256, sha256d};\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use bitcoin::secp256k1::{self, Secp256k1};\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use bitcoin::util::psbt::PartiallySignedTransaction as Psbt;\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use bitcoin::util::taproot::TapLeafHash;\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use bitcoin::Script;\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use interpreter;\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use miniscript::limits::SEQUENCE_LOCKTIME_DISABLE_FLAG;\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use miniscript::satisfy::{After, Older};\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use Satisfier;\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use {BitcoinECSig, Preimage32};\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use {BitcoinECSig, BitcoinSchnorrSig, Preimage32};\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use {MiniscriptKey, ToPublicKey};\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("mod finalizer;\n")])]),e._v("@@ -231,6 +232,24 @@ impl<'psbt> PsbtInputSatisfier<'psbt> {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("}\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("impl<'psbt, Pk: MiniscriptKey + ToPublicKey> Satisfier for PsbtInputSatisfier<'psbt> {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn lookup_tap_key_spend_sig(&self) -> Option {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" if let Some((sig, hash_ty)) = self.psbt.inputs[self.index].tap_key_sig {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Some(BitcoinSchnorrSig { sig, hash_ty })\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" } else {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" None\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn lookup_tap_leaf_script_sig(&self, pk: &Pk, lh: &TapLeafHash) -> Option {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let pk = pk.to_x_only_pubkey();\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" if let Some((sig, hash_ty)) = self.psbt.inputs[self.index].tap_script_sigs.get(&(pk, *lh)) {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Some(BitcoinSchnorrSig { sig: *sig, hash_ty: *hash_ty })\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" } else {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" None\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn lookup_ec_sig(&self, pk: &Pk) -> Option {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" if let Some(rawsig) = self.psbt.inputs[self.index]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .partial_sigs\n")])])])])]),t("p",[e._v("This commit implements the Taproot-specific "),t("code",[e._v("Satisfier")]),e._v(" methods on "),t("code",[e._v("PsbtInputSatisfier")]),e._v(". The code to produce a valid witness (i.e. "),t("em",[e._v("satisfy")]),e._v(") a descriptor by looking for Taproot key-spend or script-spend signatures\nis already implemented, so it's just a matter of actually returning those, if they are present in a PSBT.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show 80da0ba\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit 80da0ba9b742b2dee23e7302e2f95a6e96b1d6ed\nAuthor: Alekos Filini \nDate: Sat Nov 13 16:54:27 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Iter keys in `MultiA`\n")])]),e._v("\ndiff --git a/src/miniscript/iter.rs b/src/miniscript/iter.rs\nindex 36c4b69..a54a371 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/miniscript/iter.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/miniscript/iter.rs")]),e._v("\n@@ -121,7 +121,7 @@ impl Miniscript {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub fn get_leaf_pk(&self) -> Vec {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match self.node {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::PkK(ref key) => vec![key.clone()],\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::Multi(_, ref keys) => keys.clone(),\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::Multi(_, ref keys) | Terminal::MultiA(_, ref keys) => keys.clone(),\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" _ => vec![],\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("@@ -139,7 +139,7 @@ impl Miniscript {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match self.node {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::PkH(ref hash) => vec![hash.clone()],\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::PkK(ref key) => vec![key.to_pubkeyhash()],\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::Multi(_, ref keys) => keys.iter().map(Pk::to_pubkeyhash).collect(),\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::Multi(_, ref keys) | Terminal::MultiA(_, ref keys) => keys.iter().map(Pk::to_pubkeyhash).collect(),\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" _ => vec![],\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("@@ -155,7 +155,7 @@ impl Miniscript {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match self.node {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::PkH(ref hash) => vec![PkPkh::HashedPubkey(hash.clone())],\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::PkK(ref key) => vec![PkPkh::PlainPubkey(key.clone())],\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::Multi(_, ref keys) => keys\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::Multi(_, ref keys) | Terminal::MultiA(_, ref keys) => keys\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .into_iter()\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .map(|key| PkPkh::PlainPubkey(key.clone()))\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .collect(),\n")])]),e._v("@@ -170,7 +170,7 @@ impl Miniscript {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub fn get_nth_pk(&self, n: usize) -> Option {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match (&self.node, n) {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::PkK(ref key), 0) => Some(key.clone()),\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::Multi(_, ref keys), _) => keys.get(n).cloned(),\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::Multi(_, ref keys), _) | (&Terminal::MultiA(_, ref keys), _) => keys.get(n).cloned(),\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" _ => None,\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("@@ -186,7 +186,7 @@ impl Miniscript {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match (&self.node, n) {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::PkH(ref hash), 0) => Some(hash.clone()),\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::PkK(ref key), 0) => Some(key.to_pubkeyhash()),\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::Multi(_, ref keys), _) => keys.get(n).map(Pk::to_pubkeyhash),\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::Multi(_, ref keys), _) | (&Terminal::MultiA(_, ref keys), _) => keys.get(n).map(Pk::to_pubkeyhash),\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" _ => None,\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("@@ -199,7 +199,7 @@ impl Miniscript {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match (&self.node, n) {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::PkH(ref hash), 0) => Some(PkPkh::HashedPubkey(hash.clone())),\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::PkK(ref key), 0) => Some(PkPkh::PlainPubkey(key.clone())),\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::Multi(_, ref keys), _) => {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::Multi(_, ref keys), _) | (&Terminal::MultiA(_, ref keys), _) => {\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" keys.get(n).map(|key| PkPkh::PlainPubkey(key.clone()))\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" _ => None,\n")])])])])]),t("p",[e._v("Taproot descriptors add a new miniscript operator called "),t("code",[e._v("multi_a()")]),e._v(" which behaves like "),t("code",[e._v("multi()")]),e._v(" in non-Taproot descriptors, but uses the new "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki#script-execution",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("OP_CHECKSIGADD")]),t("OutboundLink")],1),e._v(" opcode when serialized in a script.")]),e._v(" "),t("p",[e._v("When this was added, somebody forgot to update the various methods that iterate over the public keys of a descriptor to correctly return the keys contained in "),t("code",[e._v("multi_a()")]),e._v(" - essentially, it was falling back in\nthe default case used by the operators that don't contain any key, but this one does!")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show 8b108c5\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit 8b108c5c0bf50b66b7220746525742b71f6cd4b4\nAuthor: Alekos Filini \nDate: Sat Nov 13 17:26:53 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Fix witness generation for `MultiA`\n")])]),e._v("\ndiff --git a/src/miniscript/satisfy.rs b/src/miniscript/satisfy.rs\nindex 655436e..ab43707 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/miniscript/satisfy.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/miniscript/satisfy.rs")]),e._v("\n@@ -1264,7 +1264,7 @@ impl Satisfaction {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // Collect all available signatures\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let mut sig_count = 0;\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let mut sigs = vec![vec![vec![]]; keys.len()];\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" for (i, pk) in keys.iter().enumerate() {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" for (i, pk) in keys.iter().rev().enumerate() {\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match Witness::signature::<_, _, Ctx>(stfr, pk, leaf_hash) {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Witness::Stack(sig) => {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" sigs[i] = sig;\n")])])])])]),t("p",[e._v("And finally, the last little fix: the "),t("code",[e._v("multi_a()")]),e._v(" operator is satisfied by pushing to the witness either a signature (if you have one available for that specific public key) or an empty vector. The problem is,\nthey have to be in the right order to match the order of public keys in your Taproot script.")]),e._v(" "),t("p",[e._v("rust-miniscript was pushing them in reverse order, so script validation was always failing for multisigs that had more than 1 key. Adding a "),t("code",[e._v(".rev()")]),e._v(" to the iterator fixed the issue.")]),e._v(" "),t("h2",{attrs:{id:"conclusion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),t("p",[e._v("And that was it! We now have a fully working "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-bitcoin",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-bitcoin"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-miniscript"),t("OutboundLink")],1),e._v(" ready for Taproot.")]),e._v(" "),t("p",[e._v("In "),t("a",{attrs:{href:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2"}},[e._v("Part 2")]),e._v(" I will go over the code changes in BDK, but I think it's now time for you and I to take a break 😃")])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{401:function(e,t,s){"use strict";s.r(t);var n=s(7),a=Object(n.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("This is the first of a two-parts blog series in which I will try to explain all the changes that I made to BDK (and some of its dependencies) to make our "),t("a",{attrs:{href:"https://twitter.com/afilini/status/1459763243556163584",target:"_blank",rel:"noopener noreferrer"}},[e._v("first Taproot transaction in mainnet"),t("OutboundLink")],1),e._v(", which also\nturned out to be "),t("a",{attrs:{href:"https://twitter.com/afilini/status/1459774394054725634",target:"_blank",rel:"noopener noreferrer"}},[e._v("the first ever use of the new "),t("code",[e._v("OP_CHECKSIGADD")]),e._v(" opcode"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Hopefully this will give an insight into what kind of changes need to be made to a wallet in order to support spending "),t("code",[e._v("P2TR")]),e._v(" outputs, both with key-spend and script-spend. BDK actually delegates\nmost of the hard work to "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-miniscript"),t("OutboundLink")],1),e._v(", and luckily most of the Taproot code was already implemented by the time I started working on it. I only had to patch a few little bugs here and there, and it ended up\nworking flawlessly in the end.")]),e._v(" "),t("p",[e._v("In this first part I will focus on the changes made to our dependencies, "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-bitcoin",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-bitcoin"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-miniscript"),t("OutboundLink")],1),e._v(". In the second part I will talk about BDK itself.")]),e._v(" "),t("h2",{attrs:{id:"backstory"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#backstory"}},[e._v("#")]),e._v(" Backstory")]),e._v(" "),t("p",[e._v("On the evening of Thursday, November 11th I was attending our weekly "),t("a",{attrs:{href:"https://www.satoshispritz.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Satoshi Spritz"),t("OutboundLink")],1),e._v(" meetup in Milan. The activation of Taproot was right around the corner, and naturally that was the main discussion\ntopic that night. The activation was forecasted for the early afternoon of Sunday, November 14th, a little less than 72h later.")]),e._v(" "),t("p",[e._v("I began to wonder how hard it would be to patch BDK and add support for Taproot. I knew most of the work had already been done in our main dependencies, "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-bitcoin",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-bitcoin"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-miniscript"),t("OutboundLink")],1),e._v(", and so I decided\nto challenge myself: could I make it in time for the activation?")]),e._v(" "),t("p",[e._v('The following day I started digging into the topic. It didn\'t help that up until that time I only had a rather "high level" idea of how Taproot worked, but luckily all the BIPs were very well written and\nstraightforward to understand.')]),e._v(" "),t("p",[e._v("By Friday night (or rather, early Saturday morning) "),t("a",{attrs:{href:"https://mempool.space/signet/tx/ba0ebb350717701ca4ea109aadfbaf3058f6cd73e5ece3927ddee653de06cf5a",target:"_blank",rel:"noopener noreferrer"}},[e._v("I had Taproot key-spend working"),t("OutboundLink")],1),e._v(", which made me pretty optimistic even though the activation date was actually moving closer, now being forecasted for\nSunday "),t("em",[e._v("morning")]),e._v(".")]),e._v(" "),t("p",[e._v("After a few hours of sleep I went back to work and by early Saturday afternoon "),t("a",{attrs:{href:"https://mempool.space/signet/tx/41d7d49f9f4edffa9ca88ad6fb887fbf1ae68f9f31def267fdb3a5949f766bf5",target:"_blank",rel:"noopener noreferrer"}},[e._v("I had Taproot script-spend working as well"),t("OutboundLink")],1),e._v(". This left me a few hours to coordinate with some friends and "),t("a",{attrs:{href:"https://mempool.space/address/1Taproote7gvQGKz5g982ecSbPvqJhMUf",target:"_blank",rel:"noopener noreferrer"}},[e._v("generate a vanity address"),t("OutboundLink")],1),e._v("\nto deposit funds into temporarily, as we didn't trust sending them to Taproot addresses before the activation (as they were anyone-can-spend according to the pre-activation rules).")]),e._v(" "),t("p",[e._v("After another pretty short night, I woke up a 5:30 AM on Sunday to monitor the activation. I broadcasted our transactions shortly after 6:00 AM as the activation block was being mined. Unfortunately, the first\nthree blocks that were enforcing Taproot rules "),t("a",{attrs:{href:"https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-November/019598.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("didn't include any Taproot transaction"),t("OutboundLink")],1),e._v(", which indicates that the miners weren't actually running the new Bitcoin Core 22.0 nodes. The fourth block, mined by "),t("code",[e._v("Foundry USA")]),e._v(" "),t("a",{attrs:{href:"https://mempool.space/tx/2eb8dbaa346d4be4e82fe444c2f0be00654d8cfd8c4a9a61b11aeaab8c00b272",target:"_blank",rel:"noopener noreferrer"}},[e._v("included my transaction"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://twitter.com/achow101/status/1459760452775387136?s=20",target:"_blank",rel:"noopener noreferrer"}},[e._v("a few others"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("In the end our transaction was the third Taproot script-spend in the block, but the first to use the new "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki#script-execution",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("OP_CHECKSIGADD")]),t("OutboundLink")],1),e._v(" opcode, as the two preceding it were respectively "),t("a",{attrs:{href:"https://mempool.space/tx/37777defed8717c581b4c0509329550e344bdc14ac38f71fc050096887e535c8",target:"_blank",rel:"noopener noreferrer"}},[e._v("a single-sig"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://mempool.space/tx/905ecdf95a84804b192f4dc221cfed4d77959b81ed66013a7e41a6e61e7ed530",target:"_blank",rel:"noopener noreferrer"}},[e._v("a 2-of-2 multisig"),t("OutboundLink")],1),e._v("\nscript, made with with two "),t("code",[e._v("OP_CHECKSIG(VERIFY)")]),e._v("s.")]),e._v(" "),t("p",[e._v("Now, with the context out of the way, we can begin talking about the code!")]),e._v(" "),t("h2",{attrs:{id:"rust-bitcoin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rust-bitcoin"}},[e._v("#")]),e._v(" rust-bitcoin")]),e._v(" "),t("p",[e._v("The first dependency I had to update was "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-bitcoin",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-bitcoin"),t("OutboundLink")],1),e._v(". Most of the taproot stuff were already merged in "),t("code",[e._v("master")]),e._v(" (altough they hadn't been released yet). One notable missing part was the support for "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0371.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("BIP371")]),t("OutboundLink")],1),e._v(",\nwhich is an extension of "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("BIP174")]),t("OutboundLink")],1),e._v(", aka the "),t("code",[e._v("Partially Signed Bitcoin Transaction")]),e._v(" BIP. This new BIP defines a few new fields that are required to properly handle Taproot transactions.")]),e._v(" "),t("p",[e._v("Luckily most of the work had already been done by "),t("a",{attrs:{href:"https://twitter.com/sanket1729",target:"_blank",rel:"noopener noreferrer"}},[e._v("sanket1729"),t("OutboundLink")],1),e._v(", so I forked his branch and made only few very minor changes, just to expose a structure that I will have to use later which in his code wasn't public.")]),e._v(" "),t("p",[e._v("You can find all the commits mentioned here in "),t("a",{attrs:{href:"https://github.com/afilini/rust-bitcoin/tree/taproot-testing",target:"_blank",rel:"noopener noreferrer"}},[e._v("my rust-bitcoin "),t("code",[e._v("taproot-testing")]),e._v(" branch"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git diff 187234f f830df9\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("diff --git a/src/lib.rs b/src/lib.rs\nindex 87d9c36..d5e5802 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/lib.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/lib.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("@@ -54,7 +54,6 @@")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(unused_mut)]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(dead_code)]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(unused_imports)]\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(missing_docs)]\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(unused_must_use)]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(broken_intra_doc_links)]\n")])]),e._v("\ndiff --git a/src/util/taproot.rs b/src/util/taproot.rs\nindex 674eeee..3d56cbc 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/util/taproot.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/util/taproot.rs")]),e._v("\n@@ -440,7 +440,7 @@ impl TaprootBuilder {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("// Internally used structure to represent the node information in taproot tree\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v('#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]\n')])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("pub(crate) struct NodeInfo {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("pub struct NodeInfo {\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" /// Merkle Hash for this node\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub(crate) hash: sha256::Hash,\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" /// information about leaves inside this node\n")])]),e._v("@@ -448,8 +448,12 @@ pub(crate) struct NodeInfo {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("}\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("impl NodeInfo {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub fn hash(&self) -> &sha256::Hash {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" &self.hash\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // Create a new NodeInfo with omitted/hidden info\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn new_hidden(hash: sha256::Hash) -> Self {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub fn new_hidden(hash: sha256::Hash) -> Self {\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Self {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" hash: hash,\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" leaves: vec![],\n")])]),e._v("@@ -457,7 +461,7 @@ impl NodeInfo {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // Create a new leaf with NodeInfo\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn new_leaf_with_ver(script: Script, ver: LeafVersion) -> Self {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub fn new_leaf_with_ver(script: Script, ver: LeafVersion) -> Self {\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let leaf = LeafInfo::new(script, ver);\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Self {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" hash: leaf.hash(),\n")])]),e._v("@@ -466,7 +470,7 @@ impl NodeInfo {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // Combine two NodeInfo's to create a new parent\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn combine(a: Self, b: Self) -> Result {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub fn combine(a: Self, b: Self) -> Result {\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let mut all_leaves = Vec::with_capacity(a.leaves.len() + b.leaves.len());\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" for mut a_leaf in a.leaves {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" a_leaf.merkle_branch.push(b.hash)?; // add hashing partner\n")])]),e._v("\n")])])]),t("p",[e._v("There isn't much to explain here: I disabled the "),t("code",[e._v("missing_docs")]),e._v(" lint so that the compiler wouldn't complain about the new public methods that aren't documented.\nThen, I added a getter for the "),t("code",[e._v("hash")]),e._v(" field of "),t("code",[e._v("NodeInfo")]),e._v(" and made the struct itself and a bunch of methods public.")]),e._v(" "),t("p",[e._v('We will use this structure later to recover the merkle root of a Taproot script tree, given one leaf and the other "hidden" branches.')]),e._v(" "),t("h2",{attrs:{id:"rust-miniscript"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rust-miniscript"}},[e._v("#")]),e._v(" rust-miniscript")]),e._v(" "),t("p",[e._v("Moving on to "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-miniscript"),t("OutboundLink")],1),e._v(': once again, most of the work required to support Taproot had already been done, but this time I was working with very "early" prototype-like code, so I was prepared to\nmake some changes to the code to get it to work how I wanted.')]),e._v(" "),t("p",[e._v("Instead of showing one big diff I will talk about the commits individually, which I think will help making more clear what I was doing.")]),e._v(" "),t("p",[e._v("Once again, you can find all the commits referenced here in "),t("a",{attrs:{href:"https://github.com/afilini/rust-miniscript/tree/taproot",target:"_blank",rel:"noopener noreferrer"}},[e._v("my rust-miniscript "),t("code",[e._v("taproot")]),e._v(" branch"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show 34cf15b\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit 34cf15b3aac1d8c2693af1b9749b888f3f29e510\nAuthor: Alekos Filini \nDate: Fri Nov 12 12:06:35 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Fix TapTree iter depth\n")])]),e._v("\ndiff --git a/src/descriptor/tr.rs b/src/descriptor/tr.rs\nindex 79d3c05..314c7f4 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/descriptor/tr.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/descriptor/tr.rs")]),e._v("\n@@ -65,7 +65,7 @@ impl TapTree {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" /// Iterate over all miniscripts\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub fn iter(&self) -> TapTreeIter {\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" TapTreeIter { stack: vec![self] }\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" TapTreeIter { stack: vec![(0, self)] }\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // Helper function to translate keys\n")])]),e._v("@@ -262,7 +262,7 @@ pub struct TapTreeIter<'a, Pk: MiniscriptKey>\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("where\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Pk: 'a,\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("{\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" stack: Vec<&'a TapTree>,\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" stack: Vec<(usize, &'a TapTree)>,\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("}\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("impl<'a, Pk> Iterator for TapTreeIter<'a, Pk>\n")])]),e._v("@@ -273,13 +273,13 @@ where\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn next(&mut self) -> Option {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" while !self.stack.is_empty() {\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' let last = self.stack.pop().expect("Size checked above");\n')])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' let (depth, last) = self.stack.pop().expect("Size checked above");\n')])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match &*last {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" TapTree::Tree(l, r) => {\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" self.stack.push(&r);\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" self.stack.push(&l);\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" self.stack.push((depth + 1, &r));\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" self.stack.push((depth + 1, &l));\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" TapTree::Leaf(ref ms) => return Some((self.stack.len(), ms)),\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" TapTree::Leaf(ref ms) => return Some((depth, ms)),\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" None\n")])])])])]),t("p",[t("code",[e._v("TapTreeIterator")]),e._v(" is an iterator that goes through a "),t("code",[e._v("TapTree")]),e._v(" and yields a "),t("code",[e._v("(depth, node)")]),e._v(" pair. This is then fed to "),t("a",{attrs:{href:"https://github.com/afilini/rust-miniscript/blob/taproot/src/descriptor/tr.rs#L183-L189",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("TaprootBuilder")]),t("OutboundLink")],1),e._v(", which returns an error if trying to insert nodes\nin "),t("a",{attrs:{href:"https://github.com/afilini/rust-bitcoin/blob/taproot-testing/src/util/taproot.rs#L403-L405",target:"_blank",rel:"noopener noreferrer"}},[e._v("an order that is not DFS"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("The way the depth was computed before made the builder always fail for non-trivial trees (i.e. more than 1 node).")]),e._v(" "),t("p",[e._v("Here I decided to play the safe card, and just keep track of the depth explicitly: I think there might be a way to compute the depth just knowing the "),t("code",[e._v("self.stack.len()")]),e._v(" (assuming the tree has a specific structure,\nwhich I'm not sure applies here), but anyway I didn't have much time to think about it and I just went for the \"dumb but idiot-proof\" way which ended up working fine.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show f4a3459\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit f4a3459128e37ca0c2701b8b6da064d4952296ff\nAuthor: Alekos Filini \nDate: Sat Nov 13 14:15:52 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Switch rust-bitcoin rev\n")])]),e._v("\ndiff --git a/Cargo.toml b/Cargo.toml\nindex 12825e8..8240024 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/Cargo.toml")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/Cargo.toml")]),e._v('\n@@ -17,7 +17,7 @@ rand = ["bitcoin/rand"]\n\n'),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("[dependencies]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v('# bitcoin = "0.27"\n')])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v('bitcoin = {git = "https://github.com/sanket1729/rust-bitcoin", branch = "taproot_psbt"}\n')])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v('bitcoin = { git = "https://github.com/afilini/rust-bitcoin.git", branch = "taproot-testing" }\n')])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("[dependencies.serde]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v('version = "1.0"\n')])])])])]),t("p",[e._v("Trivial commit, switch to "),t("a",{attrs:{href:"https://github.com/afilini/rust-bitcoin/tree/taproot-testing",target:"_blank",rel:"noopener noreferrer"}},[e._v("my fork of rust-bitcoin"),t("OutboundLink")],1),e._v(" so that I can make changes if necessary.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show 0446b16\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit 0446b1631cec9f7118d46f0f4c94ccd20de29f94\nAuthor: Alekos Filini \nDate: Sat Nov 13 14:25:18 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Parse x-only keys\n")])]),e._v("\ndiff --git a/src/descriptor/key.rs b/src/descriptor/key.rs\nindex 4108d00..b7f90b5 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/descriptor/key.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/descriptor/key.rs")]),e._v("\n@@ -283,9 +283,9 @@ impl FromStr for DescriptorPublicKey {\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn from_str(s: &str) -> Result {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' // A "raw" public key without any origin is the least we accept.\n')])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" if s.len() < 66 {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" if s.len() < 64 {\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" return Err(DescriptorKeyParseError(\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' "Key too short (<66 char), doesn\'t match any format",\n')])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' "Key too short (<64 char), doesn\'t match any format",\n')])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" ));\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("\n@@ -301,6 +301,14 @@ impl FromStr for DescriptorPublicKey {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" derivation_path,\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" wildcard,\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }))\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" } else if key_part.len() == 64 {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // x-only pubkey, prefix it with `02`\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' let key = bitcoin::PublicKey::from_str(&format!("02{}", key_part))\n')]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' .map_err(|_| DescriptorKeyParseError("Error while parsing x-only public key"))?;\n')]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Ok(DescriptorPublicKey::SinglePub(DescriptorSinglePub {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" key,\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" origin,\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }))\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" } else {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" if key_part.len() >= 2\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' && !(&key_part[0..2] == "02" || &key_part[0..2] == "03" || &key_part[0..2] == "04")\n')])]),e._v("diff --git a/src/lib.rs b/src/lib.rs\nindex e168b16..3a2335e 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/lib.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/lib.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("@@ -95,8 +95,6 @@")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(non_snake_case)]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(unused_mut)]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(dead_code)]\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(unused_imports)]\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("#![deny(missing_docs)]\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("pub extern crate bitcoin;\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v('#[cfg(feature = "serde")]\n')])])])])]),t("p",[e._v("This, I'm not really sure of: Taproot uses x-only public keys, which means that the first byte (which is usually a "),t("code",[e._v("03")]),e._v(" or a "),t("code",[e._v("02")]),e._v(") that indicates the parity of the EC point is completely dropped, and it's implicit\nthat the point is even (= "),t("code",[e._v("02")]),e._v("). Check out "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("BIP340")]),t("OutboundLink")],1),e._v(" for a much better explanation.")]),e._v(" "),t("p",[e._v("So here when I find a string that is only 64 characters long I will assume it's an x-only pubkey, and I will parse it as a normal "),t("code",[e._v("bitcoin::PublicKey")]),e._v(" by prefixing it with "),t("code",[e._v("02")]),e._v(".")]),e._v(" "),t("p",[e._v("I guess one alternative could have been to try and parse it as a "),t("code",[e._v("schnorr::PublicKey")]),e._v(' and then "convert" it to a '),t("code",[e._v("ecdsa::PublicKey")]),e._v(" which should be supported, but once again I just wanted to get it done quickly and\nthis worked fine.")]),e._v(" "),t("p",[e._v("I also disabled the "),t("code",[e._v("unused_imports")]),e._v(" and "),t("code",[e._v("missing_docs")]),e._v(" lint so that the compiler wouldn't whine too much.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show 87316ff\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit 87316fffd06ab3bdf300fd1a958ddaa2789a6696\nAuthor: Alekos Filini \nDate: Sat Nov 13 14:26:01 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Parse `tr()` descriptors\n")])]),e._v("\ndiff --git a/src/descriptor/mod.rs b/src/descriptor/mod.rs\nindex 06d98e1..4190786 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/descriptor/mod.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/descriptor/mod.rs")]),e._v("\n@@ -610,6 +610,7 @@ where\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' ("wpkh", 1) => Descriptor::Wpkh(Wpkh::from_tree(top)?),\n')]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' ("sh", 1) => Descriptor::Sh(Sh::from_tree(top)?),\n')]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' ("wsh", 1) => Descriptor::Wsh(Wsh::from_tree(top)?),\n')])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' ("tr", _) => Descriptor::Tr(Tr::from_tree(top)?),\n')])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" _ => Descriptor::Bare(Bare::from_tree(top)?),\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" })\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("diff --git a/src/expression.rs b/src/expression.rs\nindex 1cef614..11a68d3 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/expression.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/expression.rs")]),e._v("\n@@ -100,7 +100,12 @@ impl<'a> Tree<'a> {\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" sl = &sl[n + 1..];\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" loop {\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let (arg, new_sl) = Tree::from_slice_helper_round(sl, depth + 1)?;\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let (arg, new_sl) = if sl.contains('{') {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Tree::from_slice_helper_curly(sl, depth + 1)?\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" } else {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Tree::from_slice_helper_round(sl, depth + 1)?\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" };\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" ret.args.push(arg);\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" if new_sl.is_empty() {\n")])])])])]),t("p",[e._v("When trying to parse a descriptor (essentially turning a recursive string of "),t("code",[e._v("operator(args)")]),e._v(" into an abstract tree in memory) use a "),t("em",[e._v("curly-bracket-aware")]),e._v(" parser if there is one in the string.")]),e._v(" "),t("p",[e._v("The code to then build a "),t("code",[e._v("Tr")]),e._v(" struct given an "),t("code",[e._v("expression::Tree")]),e._v(" (and the "),t("code",[e._v("from_slice_helper_curly")]),e._v(" function) were already implemented, so it was just a matter of correctly\nbuilding the abstract tree by parsing curly brackets in descriptors.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show 3055cab\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit 3055cabef8bd51eda344ce501b03c533fd367b4f\nAuthor: Alekos Filini \nDate: Sat Nov 13 14:26:30 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Fix control block creation when satisfying `Tr`\n")])]),e._v("\ndiff --git a/src/descriptor/tr.rs b/src/descriptor/tr.rs\nindex 314c7f4..8487d56 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/descriptor/tr.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/descriptor/tr.rs")]),e._v("\n@@ -571,17 +571,14 @@ impl DescriptorTrait for Tr {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" } else {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let ver = LeafVersion::default();\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let leaf_script = (ms.encode(), ver);\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let control_block_set = spend_info\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .as_script_map()\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .get(&leaf_script)\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' .expect("Control block must exist in script map for every known leaf");\n')])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // let control_block_set = spend_info\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // .as_script_map()\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // .get(&leaf_script)\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' // .expect("Control block must exist in script map for every known leaf");\n')]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' let control_block = spend_info.control_block(&leaf_script).expect("Control block must exist in script map for every known leaf");\n')])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" wit.push(leaf_script.0.into_bytes()); // Push the leaf script\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // There can be multiple control blocks for a (script, ver) pair\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // Find the smallest one amongst those\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let control_block = control_block_set\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .iter()\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .min_by(|x, y| x.as_inner().len().cmp(&y.as_inner().len()))\n")]),t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(' .expect("Atleast one control must exist for a known leaf");\n')])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" wit.push(control_block.serialize());\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // Finally, save the minimum\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" min_wit = Some(wit);\n")])]),e._v("\n")])])]),t("p",[e._v("This is where things get more interesting: this section of code builds the witness to satisfy a Taproot descriptor. In case of a script-spend, we need to prove that the script we are using had been committed\ninto the public key of our "),t("code",[e._v("P2TR")]),e._v(' input. We do this by adding a "control block", that contains data about the parity of the key, the leaf version used, and the merkle path from the leaf we are using to spend\nup to the merkle root, which is committed into the public key. Once again, this is explained very well in '),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("BIP341")]),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Before my patch the code was only getting the set of merkle paths that could lead from the root to the leaves that contain a given script. For context, the signature of "),t("code",[e._v("TaprootSpendInfo::as_script_map(&self)")]),e._v(" is:")]),e._v(" "),t("div",{staticClass:"language-rust extra-class"},[t("pre",{pre:!0,attrs:{class:"language-rust"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/// Access the internal script map")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("pub")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("fn")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("as_script_map")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("->")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("BTreeMap")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("Script")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("LeafVersion")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("BTreeSet")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("TaprootMerkleBranch")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">>")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v('Then the code would look for the "shortest" path to that specific script, as it would save size in the final transaction (leaves that are more "deep" in the tree than others naturally have more hidden branches\nin their path to the root, and thus require a longer control block to reveal them all).')]),e._v(" "),t("p",[e._v("The issue here is that the "),t("code",[e._v("control_block")]),e._v(" variable is then serialized directly into the witness. But this is not a control block, it's just a set of merkle paths! A control block only has "),t("em",[e._v("one")]),e._v(" merkle path, and\nincludes the leaf version and the key parity bit.")]),e._v(" "),t("p",[e._v("Conveniently, the "),t("code",[e._v("TaprootSpendInfo")]),e._v(' struct also has this other method (I\'m including the implementation as well, because it shows that internally it does the same "trick" to find the shortest path):')]),e._v(" "),t("div",{staticClass:"language-rust extra-class"},[t("pre",{pre:!0,attrs:{class:"language-rust"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/// Obtain a [`ControlBlock`] for particular script with the given version.")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/// Returns [`None`] if the script is not contained in the [`TaprootSpendInfo`]")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/// If there are multiple ControlBlocks possible, this returns the shortest one.")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("pub")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("fn")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("control_block")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" script_ver"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("Script")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("LeafVersion")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("->")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("Option")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("ControlBlock")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("let")]),e._v(" merkle_branch_set "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("script_map"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("get")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("script_ver"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("?")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// Choose the smallest one amongst the multiple script maps")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("let")]),e._v(" smallest "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" merkle_branch_set\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("iter")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("min_by")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token closure-params"}},[t("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[e._v("|")]),e._v("x"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" y"),t("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[e._v("|")])]),e._v(" x"),t("span",{pre:!0,attrs:{class:"token number"}},[e._v(".0")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("len")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("cmp")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&")]),e._v("y"),t("span",{pre:!0,attrs:{class:"token number"}},[e._v(".0")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("len")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("expect")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Non-empty iterator"')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("Some")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("ControlBlock")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n internal_key"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("internal_key"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n output_key_parity"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("output_key_parity"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n leaf_version"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("LeafVersion")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("default")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n merkle_branch"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(":")]),e._v(" smallest"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("clone")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("So to fix this code we just have to use that method instead, and we can get it done in one single line!")]),e._v(" "),t("p",[e._v('Instead of removing the old code at the time I only commented it out, because I initially thought I would still have to look for the shortest script myself, and I figured the "sorting" code would come in handy\nlater on.')]),e._v(" "),t("p",[e._v("Also, if you are an acute observer, you might have noticed that there's a bug in this last snippet of code. Feel free to think about it a little bit, then check out the "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-bitcoin/pull/703",target:"_blank",rel:"noopener noreferrer"}},[e._v("PR"),t("OutboundLink")],1),e._v(" I made\nif you wanna know the answer!")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("git show 35378ad\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit 35378ad01a6f2b8161a3f36448b24d031f8aeaec\nAuthor: Alekos Filini \nDate: Sat Nov 13 14:27:14 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Consider key-spend max satisfaction weight\n")])]),e._v("\ndiff --git a/src/descriptor/tr.rs b/src/descriptor/tr.rs\nindex 8487d56..fabf860 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/descriptor/tr.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/descriptor/tr.rs")]),e._v("\n@@ -593,7 +593,7 @@ impl DescriptorTrait for Tr {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn max_satisfaction_weight(&self) -> Result {\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let mut max_wieght = None;\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let mut max_wieght = Some(65);\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" for (depth, ms) in self.iter_scripts() {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let script_size = ms.script_size();\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let max_sat_elems = match ms.max_satisfaction_witness_elements() {\n")])])])])]),t("p",[e._v("This is a little bug in the code that tries to compute what the maximum satisfaction weight would be for a descriptor. For instance, we use this in BDK to compute how many extra sats of fees we need to pay\nin order to target a given fee rate, assuming the descriptor is satisfied with the worst (larger and most expensive) path.")]),e._v(" "),t("p",[e._v("For Taproot descriptors, it's just a matter of iterating over the leaves in the tree and pick the most expensive one... or is it? This doesn't take into account that Taproot outputs can also be spent with\nkey-spend, which means just pushing a signature to the witness. This signature is 64 bytes long when using the new "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("SIGHASH_DEFAULT")]),t("OutboundLink")],1),e._v(" sighash, or 65 otherwise. Since we are thinking about the maximum satisfaction\nweight, or the worst case possible, we naturally pick the latter.")]),e._v(" "),t("p",[e._v("Note that theoretically you could build a Taproot address \"without\" an available key-path spend (by using an unspendable Schnorr public key), but the code here in rust-miniscript doesn't take that into\naccount, as there's no way that I'm aware of to specificy in a "),t("code",[e._v("tr()")]),e._v(" descriptor that the key is unspendable. So, while theoretically here we should first check whether the key-spend path is available before\naccounting for its weight, in practice this is always true in miniscript so we just use that as our starting worst case and update it later if necessary while iterating the tree leaves.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show b4878f8\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit b4878f816e9ede11d5ed947c06e03aa988e3e26f\nAuthor: Alekos Filini \nDate: Sat Nov 13 14:27:53 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Look for taproot stuff in psbts\n")])]),e._v("\ndiff --git a/src/psbt/mod.rs b/src/psbt/mod.rs\nindex 9a8b17d..42c6ce8 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/psbt/mod.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/psbt/mod.rs")]),e._v("\n@@ -25,13 +25,14 @@ use bitcoin;\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use bitcoin::hashes::{hash160, ripemd160, sha256, sha256d};\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use bitcoin::secp256k1::{self, Secp256k1};\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use bitcoin::util::psbt::PartiallySignedTransaction as Psbt;\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use bitcoin::util::taproot::TapLeafHash;\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use bitcoin::Script;\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use interpreter;\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use miniscript::limits::SEQUENCE_LOCKTIME_DISABLE_FLAG;\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use miniscript::satisfy::{After, Older};\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use Satisfier;\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use {BitcoinECSig, Preimage32};\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use {BitcoinECSig, BitcoinSchnorrSig, Preimage32};\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("use {MiniscriptKey, ToPublicKey};\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("mod finalizer;\n")])]),e._v("@@ -231,6 +232,24 @@ impl<'psbt> PsbtInputSatisfier<'psbt> {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("}\n")])]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("impl<'psbt, Pk: MiniscriptKey + ToPublicKey> Satisfier for PsbtInputSatisfier<'psbt> {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn lookup_tap_key_spend_sig(&self) -> Option {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" if let Some((sig, hash_ty)) = self.psbt.inputs[self.index].tap_key_sig {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Some(BitcoinSchnorrSig { sig, hash_ty })\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" } else {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" None\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn lookup_tap_leaf_script_sig(&self, pk: &Pk, lh: &TapLeafHash) -> Option {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let pk = pk.to_x_only_pubkey();\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" if let Some((sig, hash_ty)) = self.psbt.inputs[self.index].tap_script_sigs.get(&(pk, *lh)) {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Some(BitcoinSchnorrSig { sig: *sig, hash_ty: *hash_ty })\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" } else {\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" None\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v("\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" fn lookup_ec_sig(&self, pk: &Pk) -> Option {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" if let Some(rawsig) = self.psbt.inputs[self.index]\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .partial_sigs\n")])])])])]),t("p",[e._v("This commit implements the Taproot-specific "),t("code",[e._v("Satisfier")]),e._v(" methods on "),t("code",[e._v("PsbtInputSatisfier")]),e._v(". The code to produce a valid witness (i.e. "),t("em",[e._v("satisfy")]),e._v(") a descriptor by looking for Taproot key-spend or script-spend signatures\nis already implemented, so it's just a matter of actually returning those, if they are present in a PSBT.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show 80da0ba\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit 80da0ba9b742b2dee23e7302e2f95a6e96b1d6ed\nAuthor: Alekos Filini \nDate: Sat Nov 13 16:54:27 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Iter keys in `MultiA`\n")])]),e._v("\ndiff --git a/src/miniscript/iter.rs b/src/miniscript/iter.rs\nindex 36c4b69..a54a371 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/miniscript/iter.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/miniscript/iter.rs")]),e._v("\n@@ -121,7 +121,7 @@ impl Miniscript {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub fn get_leaf_pk(&self) -> Vec {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match self.node {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::PkK(ref key) => vec![key.clone()],\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::Multi(_, ref keys) => keys.clone(),\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::Multi(_, ref keys) | Terminal::MultiA(_, ref keys) => keys.clone(),\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" _ => vec![],\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("@@ -139,7 +139,7 @@ impl Miniscript {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match self.node {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::PkH(ref hash) => vec![hash.clone()],\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::PkK(ref key) => vec![key.to_pubkeyhash()],\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::Multi(_, ref keys) => keys.iter().map(Pk::to_pubkeyhash).collect(),\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::Multi(_, ref keys) | Terminal::MultiA(_, ref keys) => keys.iter().map(Pk::to_pubkeyhash).collect(),\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" _ => vec![],\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("@@ -155,7 +155,7 @@ impl Miniscript {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match self.node {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::PkH(ref hash) => vec![PkPkh::HashedPubkey(hash.clone())],\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::PkK(ref key) => vec![PkPkh::PlainPubkey(key.clone())],\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::Multi(_, ref keys) => keys\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Terminal::Multi(_, ref keys) | Terminal::MultiA(_, ref keys) => keys\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .into_iter()\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .map(|key| PkPkh::PlainPubkey(key.clone()))\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" .collect(),\n")])]),e._v("@@ -170,7 +170,7 @@ impl Miniscript {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" pub fn get_nth_pk(&self, n: usize) -> Option {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match (&self.node, n) {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::PkK(ref key), 0) => Some(key.clone()),\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::Multi(_, ref keys), _) => keys.get(n).cloned(),\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::Multi(_, ref keys), _) | (&Terminal::MultiA(_, ref keys), _) => keys.get(n).cloned(),\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" _ => None,\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("@@ -186,7 +186,7 @@ impl Miniscript {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match (&self.node, n) {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::PkH(ref hash), 0) => Some(hash.clone()),\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::PkK(ref key), 0) => Some(key.to_pubkeyhash()),\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::Multi(_, ref keys), _) => keys.get(n).map(Pk::to_pubkeyhash),\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::Multi(_, ref keys), _) | (&Terminal::MultiA(_, ref keys), _) => keys.get(n).map(Pk::to_pubkeyhash),\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" _ => None,\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")])]),e._v("@@ -199,7 +199,7 @@ impl Miniscript {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match (&self.node, n) {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::PkH(ref hash), 0) => Some(PkPkh::HashedPubkey(hash.clone())),\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::PkK(ref key), 0) => Some(PkPkh::PlainPubkey(key.clone())),\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::Multi(_, ref keys), _) => {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" (&Terminal::Multi(_, ref keys), _) | (&Terminal::MultiA(_, ref keys), _) => {\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" keys.get(n).map(|key| PkPkh::PlainPubkey(key.clone()))\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" }\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" _ => None,\n")])])])])]),t("p",[e._v("Taproot descriptors add a new miniscript operator called "),t("code",[e._v("multi_a()")]),e._v(" which behaves like "),t("code",[e._v("multi()")]),e._v(" in non-Taproot descriptors, but uses the new "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki#script-execution",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("OP_CHECKSIGADD")]),t("OutboundLink")],1),e._v(" opcode when serialized in a script.")]),e._v(" "),t("p",[e._v("When this was added, somebody forgot to update the various methods that iterate over the public keys of a descriptor to correctly return the keys contained in "),t("code",[e._v("multi_a()")]),e._v(" - essentially, it was falling back in\nthe default case used by the operators that don't contain any key, but this one does!")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git show 8b108c5\n")])])]),t("div",{staticClass:"language-diff extra-class"},[t("pre",{pre:!0,attrs:{class:"language-diff"}},[t("code",[e._v("commit 8b108c5c0bf50b66b7220746525742b71f6cd4b4\nAuthor: Alekos Filini \nDate: Sat Nov 13 17:26:53 2021 +0100\n\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Fix witness generation for `MultiA`\n")])]),e._v("\ndiff --git a/src/miniscript/satisfy.rs b/src/miniscript/satisfy.rs\nindex 655436e..ab43707 100644\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("--- a/src/miniscript/satisfy.rs")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token coord"}},[e._v("+++ b/src/miniscript/satisfy.rs")]),e._v("\n@@ -1264,7 +1264,7 @@ impl Satisfaction {\n"),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" // Collect all available signatures\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let mut sig_count = 0;\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" let mut sigs = vec![vec![vec![]]; keys.len()];\n")])]),t("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[t("span",{pre:!0,attrs:{class:"token prefix deleted"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" for (i, pk) in keys.iter().enumerate() {\n")])]),t("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[t("span",{pre:!0,attrs:{class:"token prefix inserted"}},[e._v("+")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" for (i, pk) in keys.iter().rev().enumerate() {\n")])]),t("span",{pre:!0,attrs:{class:"token unchanged"}},[t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" match Witness::signature::<_, _, Ctx>(stfr, pk, leaf_hash) {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" Witness::Stack(sig) => {\n")]),t("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[e._v(" ")]),t("span",{pre:!0,attrs:{class:"token line"}},[e._v(" sigs[i] = sig;\n")])])])])]),t("p",[e._v("And finally, the last little fix: the "),t("code",[e._v("multi_a()")]),e._v(" operator is satisfied by pushing to the witness either a signature (if you have one available for that specific public key) or an empty vector. The problem is,\nthey have to be in the right order to match the order of public keys in your Taproot script.")]),e._v(" "),t("p",[e._v("rust-miniscript was pushing them in reverse order, so script validation was always failing for multisigs that had more than 1 key. Adding a "),t("code",[e._v(".rev()")]),e._v(" to the iterator fixed the issue.")]),e._v(" "),t("h2",{attrs:{id:"conclusion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),t("p",[e._v("And that was it! We now have a fully working "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-bitcoin",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-bitcoin"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust-miniscript"),t("OutboundLink")],1),e._v(" ready for Taproot.")]),e._v(" "),t("p",[e._v("In "),t("a",{attrs:{href:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2"}},[e._v("Part 2")]),e._v(" I will go over the code changes in BDK, but I think it's now time for you and I to take a break 😃")])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/51.29907970.js b/assets/js/51.072a36a2.js similarity index 99% rename from assets/js/51.29907970.js rename to assets/js/51.072a36a2.js index 2f2802e1b6..91a13b00a8 100644 --- a/assets/js/51.29907970.js +++ b/assets/js/51.072a36a2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{401:function(t,s,e){"use strict";e.r(s);var a=e(7),n=Object(a.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("p",[t._v("This is the second part of a two-part blog series in which I talk through the changes made to BDK to make a Taproot transaction. If you haven't read it yet, check out "),s("a",{attrs:{href:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1"}},[t._v("Part 1")]),t._v(".")]),t._v(" "),s("p",[t._v("While in the first part I managed to show full raw commits, in this case I will only focus on the relevant changes, otherwise the post would get very long. You can always find the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/aa075f0...afilini:taproot-testing",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),s("OutboundLink")],1),t._v(" here, if you are interested\nin that.")]),t._v(" "),s("h2",{attrs:{id:"shortcuts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#shortcuts"}},[t._v("#")]),t._v(" Shortcuts")]),t._v(" "),s("p",[t._v("As mentioned previously, the main goal of this journey for me was to find out what it really takes to support Taproot in BDK. The code shown here wasn't written to be readable and/or maintainable, so\nsome shortcuts were taken, in particular:")]),t._v(" "),s("ul",[s("li",[t._v('No support for BIP32 extended keys: this is probably very quick to add, but in the first "proof of concept" I decided to only work with WIF keys for simplicity')]),t._v(" "),s("li",[t._v("No support for "),s("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("SIGHASH_DEFAULT")]),s("OutboundLink")],1),t._v(': this would require some minor changes to a few traits in BDK that still use the "legacy" '),s("code",[t._v("SigHashType")]),t._v(" enum from "),s("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-bitcoin",target:"_blank",rel:"noopener noreferrer"}},[t._v("rust-bitcoin"),s("OutboundLink")],1)])]),t._v(" "),s("h2",{attrs:{id:"utilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#utilities"}},[t._v("#")]),t._v(" Utilities")]),t._v(" "),s("p",[t._v("Let's start with some utilities:")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("ecdsa_to_schnorr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("pk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("ecdsa"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PublicKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("schnorr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PublicKey")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("schnorr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PublicKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_slice")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("pk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_bytes")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("expect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Key conversion failure"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("compute_merkle_root")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n leaf_hash"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("taproot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TapLeafHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n control_block"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("taproot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ControlBlock")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("taproot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TapBranchHash")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("taproot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TapBranchHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_inner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n control_block\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("merkle_branch\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("as_inner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fold")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("taproot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NodeInfo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new_hidden")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("sha256"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Hash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_slice")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("leaf_hash"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("as_inner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("expect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Invalid TapLeafHash"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token closure-params"}},[s("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[t._v("|")]),t._v("acc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" branch"),s("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[t._v("|")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("taproot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NodeInfo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("combine")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("acc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("taproot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NodeInfo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new_hidden")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("branch"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("expect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Invalid tree"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("hash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_inner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v('The first function "converts" an ECDSA key to a Schnorr key by dropping the first byte that encodes the key parity, since Schnorr keys are "x-only".')]),t._v(" "),s("p",[t._v("The second one constructs the merkle root of a taptree given a leaf hash and the corresponding control block.")]),t._v(" "),s("h2",{attrs:{id:"wrap-fallible-methods"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#wrap-fallible-methods"}},[t._v("#")]),t._v(" Wrap Fallible Methods")]),t._v(" "),s("p",[t._v("Many of the methods exposed by a "),s("code",[t._v("Descriptor")]),t._v(' struct used to be infallible: for instance, it was always possible to "encode" a descriptor into a Bitcoin script by calling the '),s("code",[t._v("script_pubkey()")]),t._v(" method.")]),t._v(" "),s("p",[t._v("Unfortunately, taproot descriptors need some extra metadata to do that: they can be computed by calling the "),s("code",[t._v("spend_info()")]),t._v(" method, and they will be cached inside the descriptor, but since it's not guaranteed by the\ncompiler that the method will be called before trying to encode it, the infallible methods had to be changed to return a "),s("code",[t._v("Result")]),t._v(", so that they can fail if the spend info is not present.")]),t._v(" "),s("p",[t._v("In BDK we call the "),s("code",[t._v("spend_info()")]),t._v(' method right after "deriving" the descriptor, so it\'s guaranteed that we will never encounter that error: for this reason, we wrap those methods and call '),s("code",[t._v("expect()")]),t._v(" on them, to keep\nthe original code mostly unchanged.")]),t._v(" "),s("p",[t._v("Here we call "),s("code",[t._v("spend_info()")]),t._v(" right after deriving the descriptor, if it's a "),s("code",[t._v("Tr")]),t._v(" variant:")]),t._v(" "),s("div",{staticClass:"language-diff extra-class"},[s("pre",{pre:!0,attrs:{class:"language-diff"}},[s("code",[t._v("@@ -136,10 +133,16 @@ impl AsDerived for Descriptor {\n"),s("span",{pre:!0,attrs:{class:"token unchanged"}},[s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" index: u32,\n")]),s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" secp: &'s SecpCtx,\n")]),s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" ) -> Descriptor> {\n")])]),s("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[s("span",{pre:!0,attrs:{class:"token prefix deleted"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" self.derive(index).translate_pk_infallible(\n")])]),s("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" let mut derived = self.derive(index).translate_pk_infallible(\n")])]),s("span",{pre:!0,attrs:{class:"token unchanged"}},[s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" |key| DerivedDescriptorKey::new(key.clone(), secp),\n")]),s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" |key| DerivedDescriptorKey::new(key.clone(), secp),\n")])]),s("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[s("span",{pre:!0,attrs:{class:"token prefix deleted"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" )\n")])]),s("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" );\n")]),s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v("\n")]),s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" if let Descriptor::Tr(tr) = &mut derived {\n")]),s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" tr.spend_info(secp);\n")]),s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" }\n")]),s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v("\n")]),s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" derived\n")])]),s("span",{pre:!0,attrs:{class:"token unchanged"}},[s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" }\n")])])])])]),s("p",[t._v("And here we wrap the "),s("code",[t._v("script_pubkey()")]),t._v(" method and call "),s("code",[t._v("expect()")]),t._v(" on it. Note that we only implement it on "),s("code",[t._v("DerivedDescriptor")]),t._v(', because it\'s not guaranteed that "extended descriptors" will have the cached metadata inside.')]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("crate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("trait")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[t._v("DerivedDescriptorSafeOps")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/// The [`Descriptor::script_pubkey`] method can fail on `Tr` descriptors that don't have the")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/// `spend_info` inside. Since we generate those upon derivation, it's guaranteed that the")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/// method will not fail on `DerivedDescriptor`s.")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("script_pubkey_derived")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Script")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token lifetime-annotation symbol"}},[t._v("'s")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivedDescriptorSafeOps")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Descriptor")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivedDescriptorKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token lifetime-annotation symbol"}},[t._v("'s")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("script_pubkey_derived")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Script")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("expect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"`spend_info` is always present in `DerivedDescriptor`s"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"descriptor-metadata"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-metadata"}},[t._v("#")]),t._v(" Descriptor Metadata")]),t._v(" "),s("p",[t._v('In BDK we have a few traits that in a way "unify" the interface of a descriptor: things like the '),s("code",[t._v("redeem_script")]),t._v(" of an input has to be computed differently depending on the type of descriptor. The traits we define\nare implemented on the "),s("code",[t._v("DerivedDescriptor")]),t._v(" or "),s("code",[t._v("ExtendedDescriptor")]),t._v(" structs and allow us to quickly get what we need without having to check the descriptor type manually.")]),t._v(" "),s("p",[t._v("Internally, they are essentially large "),s("code",[t._v("match")]),t._v("es that return different things depending on the descriptor variant. Due to some renaming that had been done recently in "),s("code",[t._v("miniscript")]),t._v(" (not necessarily related to taproot)\nwe have to update them:")]),t._v(" "),s("div",{staticClass:"language-diff extra-class"},[s("pre",{pre:!0,attrs:{class:"language-diff"}},[s("code",[t._v("@@ -337,6 +339,7 @@ pub(crate) trait DerivedDescriptorMeta {\n\n"),s("span",{pre:!0,attrs:{class:"token unchanged"}},[s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v("pub(crate) trait DescriptorMeta {\n")]),s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" fn is_witness(&self) -> bool;\n")])]),s("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" fn is_tap(&self) -> bool;\n")])]),s("span",{pre:!0,attrs:{class:"token unchanged"}},[s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" fn get_extended_keys(&self) -> Result>, DescriptorError>;\n")]),s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" fn derive_from_hd_keypaths<'s>(\n")]),s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" &self,\n")])]),t._v("@@ -358,23 +361,29 @@ pub(crate) trait DescriptorScripts {\n\n"),s("span",{pre:!0,attrs:{class:"token unchanged"}},[s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v("impl<'s> DescriptorScripts for DerivedDescriptor<'s> {\n")]),s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" fn psbt_redeem_script(&self) -> Option + diff --git a/bdk-cli/concept/index.html b/bdk-cli/concept/index.html index ea235a611e..0a1ff13b28 100644 --- a/bdk-cli/concept/index.html +++ b/bdk-cli/concept/index.html @@ -31,7 +31,7 @@ - + @@ -62,7 +62,7 @@ will never contain any data that can't be recreated purely by looking at the blockchain. Keys, descriptors, Electrum endpoints are not stored in the database. This explains why you'll have to specify them every time in the command line. It can be seen more like a cache and can be safely deleted without risking funds.
  • BDK doesn't automatically "monitor" the blockchain, instead there's a sync command that has to be called by the user.
  • When you create a transaction and then sign it, it's not automatically broadcast to the network. There's a broadcast command that does this. Moreover, the command doesn't accept a normal Bitcoin raw transaction, but instead a PSBT. That's because internally transactions are always moved as PSBTs, and again, the broadcast command is just a very thin wrapper over the raw library call.
  • There are probably more of these examples, but hopefully by this point you'll have more or less understood the gist of it. If you are not a developer, some parts of this will feel weird, inefficient, hard -to understand, and that's absolutely normal. Just try to survive through the pain and you'll be rewarded!

    - + diff --git a/bdk-cli/index.html b/bdk-cli/index.html index baf3d2d084..5fbd8a1b23 100644 --- a/bdk-cli/index.html +++ b/bdk-cli/index.html @@ -33,7 +33,7 @@ - + @@ -59,7 +59,7 @@ GitHub (opens new window)

    # BDK-CLI

    The bdk-cli (opens new window) repo has an example interactive shell built using the bdk library called bdk-cli that acts both as a reference implementation of a wallet -and a tool to quickly experiment with descriptors and transactions.

    - + diff --git a/bdk-cli/installation/index.html b/bdk-cli/installation/index.html index e12ed9ad79..4188cc7c0d 100644 --- a/bdk-cli/installation/index.html +++ b/bdk-cli/installation/index.html @@ -35,7 +35,7 @@ - + @@ -110,7 +110,7 @@ wallet Wallet Operations

    An example command to sync a testnet wallet to a default electrum server looks like this:

    bdk-cli wallet -w example --descriptor "wpkh(tprv8ZgxMBicQKsPexGYyaFwnAsCXCjmz2FaTm6LtesyyihjbQE3gRMfXqQBXKM43DvC1UgRVv1qom1qFxNMSqVAs88qx9PhgFnfGVUdiiDf6j4/0/*)" sync
    -
    BDK Foundation
    - + diff --git a/bdk-cli/interface/index.html b/bdk-cli/interface/index.html index 674de52a81..bc9b1f949a 100644 --- a/bdk-cli/interface/index.html +++ b/bdk-cli/interface/index.html @@ -29,7 +29,7 @@ - + @@ -364,7 +364,7 @@ --psbt <BASE64_PSBT> Sets the PSBT to sign --assume_height <HEIGHT> Assume the blockchain has reached a specific height. This affects the transaction finalization, if there are timelocks in the descriptor --trust_witness_utxo <WITNESS> Whether the signer should trust the witness_utxo, if the non_witness_utxo hasn’t been provided -

    Adds to the PSBT all the signatures it can produce with the secrets embedded in the descriptor (xprv or WIF keys). Returns the signed PSBT and, if there are enough item to satisfy the script, also the extracted raw Bitcoin transaction.

    Optionally, the --assume_height option can be specified to let the wallet assume the blockchain has reached a specific height. This affects the finalization of the PSBT which is done right at the end of the signing process: the wallet tries to satisfy the spending condition of each input using the partial signatures collected. In case timelocks are present the wallet needs to know whether or not they have expired. This flag is particularly useful for offline wallets.

    # sync

    This subcommand has no extra flags. It connects to the chosen Electrum server and synchronizes the list of transactions received and available UTXOs.

    Adds to the PSBT all the signatures it can produce with the secrets embedded in the descriptor (xprv or WIF keys). Returns the signed PSBT and, if there are enough item to satisfy the script, also the extracted raw Bitcoin transaction.

    Optionally, the --assume_height option can be specified to let the wallet assume the blockchain has reached a specific height. This affects the finalization of the PSBT which is done right at the end of the signing process: the wallet tries to satisfy the spending condition of each input using the partial signatures collected. In case timelocks are present the wallet needs to know whether or not they have expired. This flag is particularly useful for offline wallets.

    # sync

    This subcommand has no extra flags. It connects to the chosen Electrum server and synchronizes the list of transactions received and available UTXOs.

    BDK Foundation
    - + diff --git a/bdk-cli/introduction/index.html b/bdk-cli/introduction/index.html index fa50ae02c3..17faf3aa67 100644 --- a/bdk-cli/introduction/index.html +++ b/bdk-cli/introduction/index.html @@ -29,7 +29,7 @@ - + @@ -53,7 +53,7 @@ Blog GitHub - (opens new window)

    # Introduction

    bdk-cli (opens new window) is a lightweight repl (opens new window) wrapper over bdk that comes as a command line application. It is useful for quick testing and prototyping of bdk functionalities.

    This can also be used as an example application to create your own command line bitcoin wallet tool using bdk.

    bdk-cli can interface with all the blockchain backends currently supported by bdk, like rpc, electrum, esplora and compact_filters.

    Check out project documentation (opens new window) for more details.

    The following sections goes into more details on the installation and usage of bdk-cli.

    - + diff --git a/bdk-cli/playground/index.html b/bdk-cli/playground/index.html index 163a75bd15..981291601a 100644 --- a/bdk-cli/playground/index.html +++ b/bdk-cli/playground/index.html @@ -27,7 +27,7 @@ - + @@ -51,7 +51,7 @@ Blog GitHub - (opens new window)

    # Playground

    - + diff --git a/bdk-cli/regtest/index.html b/bdk-cli/regtest/index.html index 15ddf9b3d5..c83a6db885 100644 --- a/bdk-cli/regtest/index.html +++ b/bdk-cli/regtest/index.html @@ -31,7 +31,7 @@ - + @@ -60,7 +60,7 @@

    Just like before, this command will probably take a while to finish.

    Once it's done, assuming you have a regtest bitcoind running in background, you can launch a new terminal and run the following command to actually start electrs:

    electrs --log-filters INFO --timestamp --db-dir /tmp/electrs-db --electrum-rpc-addr="127.0.0.1:50001" --network=regtest --cookie-file=$HOME/.bitcoin/regtest/.cookie
     

    on macOS you should change the cookie-file to $HOME/Library/Application Support/Bitcoin/regtest/.cookie.

    This will start the Electrum server on port 50001. You can then add the -n regtest -s 127.0.0.1:50001 to the bdk-cli commands to switch to the local regtest.

    # Troubleshooting

    # Stuck with "wait until bitcoind is synced (i.e. initialblockdownload = false)"

    Just generate a few blocks with bitcoin-cli generatetoaddress 1 <address>

    # Bonus: Docker

    If you have already installed Docker on your machine, you can also use 🍣 Nigiri CLI (opens new window) to spin-up a complete development environment in regtest that includes a bitcoin node, an electrs explorer and the esplora (opens new window) web-app to visualize blocks and transactions in the browser.

    Install 🍣 Nigiri

    $ curl https://getnigiri.vulpem.com | bash
     

    Start Docker daemon and run Nigiri box

    $ nigiri start
    -

    This will start electrum RPC interface on port 51401, the REST interface on 3000 and the esplora UI on 5000 (You can visit with the browser and look for blocks, addresses and transactions)

    You can then add the -n regtest -s 127.0.0.1:51401 to the bdk-cli commands to switch to the local regtest.

    This will start electrum RPC interface on port 51401, the REST interface on 3000 and the esplora UI on 5000 (You can visit with the browser and look for blocks, addresses and transactions)

    You can then add the -n regtest -s 127.0.0.1:51401 to the bdk-cli commands to switch to the local regtest.

    BDK Foundation
    - + diff --git a/blog/2020/12/hello-world/index.html b/blog/2020/12/hello-world/index.html index b299d0cea3..819605e170 100644 --- a/blog/2020/12/hello-world/index.html +++ b/blog/2020/12/hello-world/index.html @@ -30,7 +30,7 @@ - + @@ -147,7 +147,7 @@ txid = txid );

    # Custom Database and Blockchain types

    We briefly mentioned before that for our example we used the MemoryDatabase, but that it could also be swapped for a different one: this is one example of the modularity of BDK. By default, some database types are already implemented in the library, namely the MemoryDatabase (opens new window) which only keeps data in RAM, the Sled (opens new window) database that can store data on a filesystem, and the SqliteDatabase (opens new window) that can store data into a SQLite database. But since the Database trait is public, users of the library can also implement different database types more suitable for their use-case.

    The same is true for the Blockchain types: the library provides (through the use of opt-in features) implementations for the Electrum, Esplora, CompactFilters (Neutrino) and Bitcoin Core rpc backends. Those again can also be -swapped with custom types if the user desires to do so.

    # Conclusion

    Hopefully, this article will help you get started with BDK! This is just a very quick and gentle introduction to the library, and only barely scratches the surface of what's inside: we will keep publishing more articles in the future to explain some of the more advanced features of BDK, like key generation, using complex descriptors with multiple keys and/or timelocks, using external signers, etc.

    If you'd like to learn more about the library feel free to ask any questions in the comment section down below, or join our Discord Community (opens new window) to chat with us directly!

    - + diff --git a/blog/2020/12/release-v0.2.0/index.html b/blog/2020/12/release-v0.2.0/index.html index 575bf39df6..f86cb3523e 100644 --- a/blog/2020/12/release-v0.2.0/index.html +++ b/blog/2020/12/release-v0.2.0/index.html @@ -30,7 +30,7 @@ - + @@ -128,7 +128,7 @@ .map_err(|e| KeyError::Message(e.to_string()))?) } } -

    # Support for sortedmulti()

    Thanks to the addition of sortedmulti() in rust-miniscript, we can now also support them in BDK, which means we are getting more and more compatible with other descriptor-based wallets out there like Bitcoin Core.

    # Contributors

    A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.

    Since the 0.1.0-beta.1 release over three months ago, we've had 213 new commits made by 10 different contributors for a total of 9990 additions and 2993 deletions. Here's the full diff (opens new window).

    A special thanks to the 7 new contributors:

    - + diff --git a/blog/bdk-cli-basics-multisig-2of3/index.html b/blog/bdk-cli-basics-multisig-2of3/index.html index 3299f7ef65..7c8a26d96a 100644 --- a/blog/bdk-cli-basics-multisig-2of3/index.html +++ b/blog/bdk-cli-basics-multisig-2of3/index.html @@ -30,7 +30,7 @@ - + @@ -126,7 +126,7 @@

    # Step 12: Broadcast Transaction

    ▶️ bdk-cli wallet --wallet wallet_name_msd01 --descriptor $MULTI_DESCRIPTOR_01 broadcast --psbt $SECONDSIG_PSBT

    {
       "txid": "61da2451874a483aa8d1d0787c7680d157639f284840de8885098cac43f6cc2f"
     }
    -

    # Verify Transaction

    Verify transcation in the memory pool on testnet Mempool-testnet! (opens new window)

    - + diff --git a/blog/tags/basics/index.html b/blog/tags/basics/index.html index 5969237b20..fcb2b0122b 100644 --- a/blog/tags/basics/index.html +++ b/blog/tags/basics/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/bdk-cli/index.html b/blog/tags/bdk-cli/index.html index 699cb832b7..3c426e1c10 100644 --- a/blog/tags/bdk-cli/index.html +++ b/blog/tags/bdk-cli/index.html @@ -25,7 +25,7 @@ - + @@ -114,6 +114,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/bdk-rn/index.html b/blog/tags/bdk-rn/index.html index 10b397e71b..0dd2c41ad4 100644 --- a/blog/tags/bdk-rn/index.html +++ b/blog/tags/bdk-rn/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/bdk/index.html b/blog/tags/bdk/index.html index e7376ba079..3fc461dfd3 100644 --- a/blog/tags/bdk/index.html +++ b/blog/tags/bdk/index.html @@ -25,7 +25,7 @@ - + @@ -169,6 +169,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/bindings/index.html b/blog/tags/bindings/index.html index 03b244221b..1ba75ef21d 100644 --- a/blog/tags/bindings/index.html +++ b/blog/tags/bindings/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/bitcoin-cli/index.html b/blog/tags/bitcoin-cli/index.html index 9987f55464..73a90fdad0 100644 --- a/blog/tags/bitcoin-cli/index.html +++ b/blog/tags/bitcoin-cli/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/bitcoin/index.html b/blog/tags/bitcoin/index.html index 082f149099..bdf5f4d383 100644 --- a/blog/tags/bitcoin/index.html +++ b/blog/tags/bitcoin/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/blockchain/index.html b/blog/tags/blockchain/index.html index 49c610f61d..4bf614d633 100644 --- a/blog/tags/blockchain/index.html +++ b/blog/tags/blockchain/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/coin selection/index.html b/blog/tags/coin selection/index.html index d2d10c7bfa..af0914e8b6 100644 --- a/blog/tags/coin selection/index.html +++ b/blog/tags/coin selection/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/compact_filters/index.html b/blog/tags/compact_filters/index.html index 1430434eff..14e63e02b9 100644 --- a/blog/tags/compact_filters/index.html +++ b/blog/tags/compact_filters/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/descriptor/index.html b/blog/tags/descriptor/index.html index adc6c98ed5..ae7fd98ae8 100644 --- a/blog/tags/descriptor/index.html +++ b/blog/tags/descriptor/index.html @@ -25,7 +25,7 @@ - + @@ -114,6 +114,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/development/index.html b/blog/tags/development/index.html index d76db12a2d..cb1741b5df 100644 --- a/blog/tags/development/index.html +++ b/blog/tags/development/index.html @@ -25,7 +25,7 @@ - + @@ -103,6 +103,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/fee/index.html b/blog/tags/fee/index.html index 415c96f5c5..6b307ed78c 100644 --- a/blog/tags/fee/index.html +++ b/blog/tags/fee/index.html @@ -25,7 +25,7 @@ - + @@ -103,6 +103,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/getting started/index.html b/blog/tags/getting started/index.html index 4cae0d7e8f..29029a432c 100644 --- a/blog/tags/getting started/index.html +++ b/blog/tags/getting started/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/guide/index.html b/blog/tags/guide/index.html index b14fad44a3..0756968e59 100644 --- a/blog/tags/guide/index.html +++ b/blog/tags/guide/index.html @@ -25,7 +25,7 @@ - + @@ -125,6 +125,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/iOS/index.html b/blog/tags/iOS/index.html index 0800b2b4a4..e0cc05d25c 100644 --- a/blog/tags/iOS/index.html +++ b/blog/tags/iOS/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/index.html b/blog/tags/index.html index 1bbb62559d..619e337119 100644 --- a/blog/tags/index.html +++ b/blog/tags/index.html @@ -25,7 +25,7 @@ - + @@ -49,7 +49,7 @@ Blog GitHub - (opens new window)
    - + diff --git a/blog/tags/miniscript/index.html b/blog/tags/miniscript/index.html index a445ea1859..a79ba7f091 100644 --- a/blog/tags/miniscript/index.html +++ b/blog/tags/miniscript/index.html @@ -25,7 +25,7 @@ - + @@ -114,6 +114,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/mobile/index.html b/blog/tags/mobile/index.html index 391407c4ca..00ed4d711d 100644 --- a/blog/tags/mobile/index.html +++ b/blog/tags/mobile/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/multi-sig/index.html b/blog/tags/multi-sig/index.html index 972dacf5ad..ad2e13cef6 100644 --- a/blog/tags/multi-sig/index.html +++ b/blog/tags/multi-sig/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/novice/index.html b/blog/tags/novice/index.html index dfce2d79b3..2cfc58c956 100644 --- a/blog/tags/novice/index.html +++ b/blog/tags/novice/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/paper wallets/index.html b/blog/tags/paper wallets/index.html index 0c4baa2b33..34cbc5ce70 100644 --- a/blog/tags/paper wallets/index.html +++ b/blog/tags/paper wallets/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/project/index.html b/blog/tags/project/index.html index 3f26838fb3..ff723eac4d 100644 --- a/blog/tags/project/index.html +++ b/blog/tags/project/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/release/index.html b/blog/tags/release/index.html index 532721191e..7a3cdde917 100644 --- a/blog/tags/release/index.html +++ b/blog/tags/release/index.html @@ -25,7 +25,7 @@ - + @@ -158,6 +158,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/rust/index.html b/blog/tags/rust/index.html index 8f0b5f856f..574078ff6c 100644 --- a/blog/tags/rust/index.html +++ b/blog/tags/rust/index.html @@ -25,7 +25,7 @@ - + @@ -169,6 +169,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/security/index.html b/blog/tags/security/index.html index f7184584f4..525d35cd2d 100644 --- a/blog/tags/security/index.html +++ b/blog/tags/security/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/summer of bitcoin/index.html b/blog/tags/summer of bitcoin/index.html index 1f7b3e87b8..cdb80cfd36 100644 --- a/blog/tags/summer of bitcoin/index.html +++ b/blog/tags/summer of bitcoin/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/taproot/index.html b/blog/tags/taproot/index.html index 66d22240ba..d8557c72a9 100644 --- a/blog/tags/taproot/index.html +++ b/blog/tags/taproot/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/tor/index.html b/blog/tags/tor/index.html index 0bb602eb0f..083a0cd4af 100644 --- a/blog/tags/tor/index.html +++ b/blog/tags/tor/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/tutorial/index.html b/blog/tags/tutorial/index.html index 7f1413d4b6..84250ae9d9 100644 --- a/blog/tags/tutorial/index.html +++ b/blog/tags/tutorial/index.html @@ -25,7 +25,7 @@ - + @@ -147,6 +147,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/wallet/index.html b/blog/tags/wallet/index.html index 79241ca137..c86413c0cd 100644 --- a/blog/tags/wallet/index.html +++ b/blog/tags/wallet/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/using-bdk-with-hardware-wallets/index.html b/blog/using-bdk-with-hardware-wallets/index.html index 64e7205ea5..2dd81d3ffd 100644 --- a/blog/using-bdk-with-hardware-wallets/index.html +++ b/blog/using-bdk-with-hardware-wallets/index.html @@ -30,7 +30,7 @@ - + @@ -181,7 +181,7 @@ blockchain.broadcast(&raw_transaction)?; println!("Transaction broadcasted! TXID: {txid}.\nExplorer URL: https://mempool.space/testnet/tx/{txid}", txid = txid); -

    # Conclusion

    We just received coins on a hardware wallet and spent from it - how cool is that?!

    See the hardware signer example (opens new window) for the full code, and, if you have any questions or suggestions, head to our Discord (opens new window). See you there!

    - + diff --git a/descriptors/index.html b/descriptors/index.html index b91613b813..92a442e2a9 100644 --- a/descriptors/index.html +++ b/descriptors/index.html @@ -33,7 +33,7 @@ - + @@ -63,7 +63,7 @@ aims to produce the first "Native Descriptor" Bitcoin library that can be used by developers to build their own "Native Descriptor Wallets" (opens new window).

    # Compatibility Matrix

    Below are some tables to highlight the differences between Bitcoin Core's descriptor support, rust-miniscript's one and BDK's.

    # Key Types

    Key Type BDK rust-miniscript Bitcoin Core
    Hex PublicKey
    WIF PrivateKey
    Extended Keys (xpub/xprv)

    # Script Types (top level)

    Script Type BDK rust-miniscript Bitcoin Core
    pk()
    pkh()
    wpkh()
    sh(wpkh())
    sh()
    wsh()
    sh(wsh())
    combo()
    addr()
    raw()
    Bare scripts

    # Operators

    Operator BDK rust-miniscript Bitcoin Core
    pk()
    pkh()
    older()
    after()
    sha256()
    hash256()
    ripemd160()
    hash160()
    andor()
    and_{v,b,n}()
    or_{b,c,d,i}()
    multi()
    thresh()
    sortedmulti()

    # Modifiers

    Script Type BDK rust-miniscript Bitcoin Core
    a:
    s:
    c:
    t:
    d:
    v:
    j:
    n:
    l:
    u:

    For a more thorough description of these operators and modifiers see Sipa's Miniscript Page (opens new window) and Bitcoin Core's (opens new window).

    # Examples

    Some examples of valid BDK descriptors are:

    Spending Policy Descriptor Address 0 Address 1
    Static P2PKH pkh(cSQPHDBwXGjVzWRqAHm6zfvQhaTuj1f2bFH58h55ghbjtFwvmeXR) mrkwtj5xpYQjHeJe5wsweNjVeTKkvR5fCr mrkwtj5xpYQjHeJe5wsweNjVeTKkvR5fCr
    Static P2PKH, watch-only pkh(02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c) mrkwtj5xpYQjHeJe5wsweNjVeTKkvR5fCr mrkwtj5xpYQjHeJe5wsweNjVeTKkvR5fCr
    P2WSH 2-of-2 with one private key wsh(multi(2,tprv8ZgxMBicQKsPePmENhT9N9yiSfTtDoC1f39P7nNmgEyCB6Nm4Qiv1muq4CykB9jtnQg2VitBrWh8PJU8LHzoGMHTrS2VKBSgAz7Ssjf9S3P/0/*,tpubDBYDcH8P2PedrEN3HxWYJJJMZEdgnrqMsjeKpPNzwe7jmGwk5M3HRdSf5vudAXwrJPfUsfvUPFooKWmz79Lh111U51RNotagXiGNeJe3i6t/1/*)) tb1qqsat6c82fvdy73rfzye8f7nwxcz3xny7t56azl73g95mt3tmzvgs9a8vjs tb1q7sgx6gscgtau57jduend6a8l445ahpk3dt3u5zu58rx5qm27lhkqgfdjdr
    P2WSH-P2SH one key + 10 days timelock sh(wsh(and_v(vc:pk_h(tprv8ZgxMBicQKsPePmENhT9N9yiSfTtDoC1f39P7nNmgEyCB6Nm4Qiv1muq4CykB9jtnQg2VitBrWh8PJU8LHzoGMHTrS2VKBSgAz7Ssjf9S3P/0/*),older(1440)))) 2Mtk2nyS98MCi2P7TkoBGLaJviBy956XxB1 2MuEStKzYhqb5HCFgHz9153tZsL5sVqV5xC

    # Implementation Details

    BDK extends the capabilities of rust-miniscript (opens new window) by introducing the concept of an ExtendedDescriptor: it represents a descriptor that contains one or more "derivable keys" like xpubs or xprvs and can be "derived" from a normal Descriptor by deriving every single one of its keys. It is currently called "StringDescriptor" in the code, because it's implemented as a wrapped miniscript::Descriptor<String>.

    ExtendedDescriptors are derived using a single index instead of a full derivation path: this is because normally most of the path is fixed and can be represented right after the xpub/xprv itself, and only the final index changes for each address. This is what's normally called a DescriptorExtendedKey in the codebase, it is represented with a similar syntax to Bitcoin Core's, such as:

    [d34db33f/44'/0'/0']xpub6ERApfZwUNrhL.......rBGRjaDMzQLcgJvLJuZZvRcEL/0/*
    -
    BDK Foundation
    - + diff --git a/docs-rs/bdk/nightly/latest/bdk/descriptor/enum.Descriptor.html b/docs-rs/bdk/nightly/latest/bdk/descriptor/enum.Descriptor.html index 932fca642d..5054ad6a98 100644 --- a/docs-rs/bdk/nightly/latest/bdk/descriptor/enum.Descriptor.html +++ b/docs-rs/bdk/nightly/latest/bdk/descriptor/enum.Descriptor.html @@ -176,7 +176,7 @@
    Errors

    Trait Implementations§

    Returns a copy of the value. Read more
    Performs copy-assignment from source. Read more
    Formats the value using the given formatter. Read more
    Returns the minimum value (in satoshis) at which an output is broadcastable. Panics if the descriptor wildcard is hardened. Read more
    Deserialize this value from the given Serde deserializer. Read more
    Formats the value using the given formatter. Read more
    Extract the spending policy
    Run a predicate on every key in the descriptor, returning whether the predicate returned true for every key Read more
    Run a predicate on every key in the descriptor, returning whether -the predicate returned true for any key Read more
    Converts to this type from the input type.
    Converts to this type from the input type.
    Converts to this type from the input type.
    Converts to this type from the input type.
    Converts to this type from the input type.
    Converts to this type from the input type.
    The associated error which can be returned from parsing.
    Parses a string s to return a value of this type. Read more

    Parse an expression tree into a descriptor.

    +the predicate returned true for any key Read more
    Converts to this type from the input type.
    Converts to this type from the input type.
    Converts to this type from the input type.
    Converts to this type from the input type.
    Converts to this type from the input type.
    Converts to this type from the input type.
    The associated error which can be returned from parsing.
    Parses a string s to return a value of this type. Read more

    Parse an expression tree into a descriptor.

    Feeds this value into the given Hasher. Read more
    Feeds a slice of this type into the given Hasher. Read more
    Converts this object into an abstract policy.
    This method returns an Ordering between self and other. Read more
    Compares and returns the maximum of two values. Read more
    Compares and returns the minimum of two values. Read more
    Restrict a value to a certain interval. Read more
    This method tests for self and other values to be equal, and is used by ==. Read more
    This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
    This method returns an ordering between self and other values if one exists. Read more
    This method tests less than (for self and other) and is used by the < operator. Read more
    This method tests less than or equal to (for self and other) and is used by the <= diff --git a/docs-rs/bdk/nightly/latest/bdk/wallet/enum.ApplyBlockError.html b/docs-rs/bdk/nightly/latest/bdk/wallet/enum.ApplyBlockError.html index 2dd9b9db72..649431a104 100644 --- a/docs-rs/bdk/nightly/latest/bdk/wallet/enum.ApplyBlockError.html +++ b/docs-rs/bdk/nightly/latest/bdk/wallet/enum.ApplyBlockError.html @@ -1,5 +1,5 @@ ApplyBlockError in bdk::wallet - Rust
    pub enum ApplyBlockError {
    +                    logo

    ApplyBlockError

    pub enum ApplyBlockError {
         CannotConnect(CannotConnectError),
         UnexpectedConnectedToHash {
             connected_to_hash: BlockHash,
    @@ -10,7 +10,7 @@
     
    §

    UnexpectedConnectedToHash

    Fields

    §connected_to_hash: BlockHash

    Block hash of connected_to.

    §expected_hash: BlockHash

    Expected block hash of connected_to, as derived from block.

    Occurs when the connected_to hash does not match the hash derived from block.

    -

    Trait Implementations§

    Formats the value using the given formatter. Read more
    Formats the value using the given formatter. Read more
    The lower-level source of this error, if any. Read more
    👎Deprecated since 1.42.0: use the Display impl or to_string()
    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +

    Trait Implementations§

    Formats the value using the given formatter. Read more
    Formats the value using the given formatter. Read more
    The lower-level source of this error, if any. Read more
    👎Deprecated since 1.42.0: use the Display impl or to_string()
    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    Calls U::from(self).

    That is, this conversion is whatever the implementation of From<T> for U chooses to do.

    diff --git a/docs-rs/bdk/nightly/latest/bdk/wallet/enum.InsertTxError.html b/docs-rs/bdk/nightly/latest/bdk/wallet/enum.InsertTxError.html index 2c7ccbba1f..f396687f04 100644 --- a/docs-rs/bdk/nightly/latest/bdk/wallet/enum.InsertTxError.html +++ b/docs-rs/bdk/nightly/latest/bdk/wallet/enum.InsertTxError.html @@ -1,5 +1,5 @@ InsertTxError in bdk::wallet - Rust
    pub enum InsertTxError {
    +                    logo

    InsertTxError

    pub enum InsertTxError {
         ConfirmationHeightCannotBeGreaterThanTip {
             tip_height: u32,
             tx_height: u32,
    @@ -9,7 +9,7 @@
     
    §tx_height: u32

    The introduced transaction’s confirmation height.

    The error variant that occurs when the caller attempts to insert a transaction with a confirmation height that is greater than the internal chain tip.

    -

    Trait Implementations§

    Formats the value using the given formatter. Read more
    Formats the value using the given formatter. Read more
    The lower-level source of this error, if any. Read more
    👎Deprecated since 1.42.0: use the Display impl or to_string()
    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +

    Trait Implementations§

    Formats the value using the given formatter. Read more
    Formats the value using the given formatter. Read more
    The lower-level source of this error, if any. Read more
    👎Deprecated since 1.42.0: use the Display impl or to_string()
    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    Calls U::from(self).

    That is, this conversion is whatever the implementation of From<T> for U chooses to do.

    diff --git a/docs-rs/bdk/nightly/latest/bdk/wallet/enum.LoadError.html b/docs-rs/bdk/nightly/latest/bdk/wallet/enum.LoadError.html index c657020255..a7a2d12451 100644 --- a/docs-rs/bdk/nightly/latest/bdk/wallet/enum.LoadError.html +++ b/docs-rs/bdk/nightly/latest/bdk/wallet/enum.LoadError.html @@ -1,5 +1,5 @@ LoadError in bdk::wallet - Rust

    Enum bdk::wallet::LoadError

    source ·
    pub enum LoadError {
    +                    logo

    LoadError

    Enum bdk::wallet::LoadError

    source ·
    pub enum LoadError {
         Descriptor(DescriptorError),
         Persist(Error),
         NotInitialized,
    @@ -12,7 +12,7 @@
     
    §

    NotInitialized

    Wallet not initialized, persistence backend is empty.

    §

    MissingNetwork

    Data loaded from persistence is missing network type.

    §

    MissingGenesis

    Data loaded from persistence is missing genesis hash.

    -

    Trait Implementations§

    Formats the value using the given formatter. Read more
    Formats the value using the given formatter. Read more
    The lower-level source of this error, if any. Read more
    👎Deprecated since 1.42.0: use the Display impl or to_string()
    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +

    Trait Implementations§

    Formats the value using the given formatter. Read more
    Formats the value using the given formatter. Read more
    The lower-level source of this error, if any. Read more
    👎Deprecated since 1.42.0: use the Display impl or to_string()
    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    Calls U::from(self).

    That is, this conversion is whatever the implementation of From<T> for U chooses to do.

    diff --git a/docs-rs/bdk/nightly/latest/bdk/wallet/enum.NewError.html b/docs-rs/bdk/nightly/latest/bdk/wallet/enum.NewError.html index ed6c11d359..b3c1c83111 100644 --- a/docs-rs/bdk/nightly/latest/bdk/wallet/enum.NewError.html +++ b/docs-rs/bdk/nightly/latest/bdk/wallet/enum.NewError.html @@ -1,5 +1,5 @@ NewError in bdk::wallet - Rust

    Variants§

    §

    NonEmptyDatabase

    Database already has data.

    §

    Descriptor(DescriptorError)

    There was problem with the passed-in descriptor(s).

    §

    Persist(Error)

    We were unable to write the wallet’s data to the persistence backend.

    -

    Trait Implementations§

    Formats the value using the given formatter. Read more
    Formats the value using the given formatter. Read more
    The lower-level source of this error, if any. Read more
    👎Deprecated since 1.42.0: use the Display impl or to_string()
    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +

    Trait Implementations§

    Formats the value using the given formatter. Read more
    Formats the value using the given formatter. Read more
    The lower-level source of this error, if any. Read more
    👎Deprecated since 1.42.0: use the Display impl or to_string()
    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    Calls U::from(self).

    That is, this conversion is whatever the implementation of From<T> for U chooses to do.

    diff --git a/docs-rs/bdk/nightly/latest/bdk/wallet/enum.NewOrLoadError.html b/docs-rs/bdk/nightly/latest/bdk/wallet/enum.NewOrLoadError.html index 0cec09449f..27c1d7f85e 100644 --- a/docs-rs/bdk/nightly/latest/bdk/wallet/enum.NewOrLoadError.html +++ b/docs-rs/bdk/nightly/latest/bdk/wallet/enum.NewOrLoadError.html @@ -1,5 +1,5 @@ NewOrLoadError in bdk::wallet - Rust
    pub enum NewOrLoadError {
    +                    logo

    NewOrLoadError

    pub enum NewOrLoadError {
         Descriptor(DescriptorError),
         Persist(Error),
         NotInitialized,
    @@ -22,7 +22,7 @@
     
    §

    LoadedNetworkDoesNotMatch

    Fields

    §expected: Network

    The expected network type.

    §got: Option<Network>

    The network type loaded from persistence.

    The loaded network type does not match what was provided.

    -

    Trait Implementations§

    Formats the value using the given formatter. Read more
    Formats the value using the given formatter. Read more
    The lower-level source of this error, if any. Read more
    👎Deprecated since 1.42.0: use the Display impl or to_string()
    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +

    Trait Implementations§

    Formats the value using the given formatter. Read more
    Formats the value using the given formatter. Read more
    The lower-level source of this error, if any. Read more
    👎Deprecated since 1.42.0: use the Display impl or to_string()
    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    Calls U::from(self).

    That is, this conversion is whatever the implementation of From<T> for U chooses to do.

    diff --git a/docs-rs/bdk/nightly/latest/bdk/wallet/fn.wallet_name_from_descriptor.html b/docs-rs/bdk/nightly/latest/bdk/wallet/fn.wallet_name_from_descriptor.html index 50f72a16da..f572311cb5 100644 --- a/docs-rs/bdk/nightly/latest/bdk/wallet/fn.wallet_name_from_descriptor.html +++ b/docs-rs/bdk/nightly/latest/bdk/wallet/fn.wallet_name_from_descriptor.html @@ -1,4 +1,4 @@ wallet_name_from_descriptor in bdk::wallet - Rust
    pub fn wallet_name_from_descriptor<T>(
        descriptor: T,
        change_descriptor: Option<T>,
        network: Network,
        secp: &Secp256k1<All>
    ) -> Result<String, DescriptorError>where
        T: IntoWalletDescriptor,
    Expand description

    Deterministically generate a unique name given the descriptors defining the wallet

    + logo
    pub fn wallet_name_from_descriptor<T>(
        descriptor: T,
        change_descriptor: Option<T>,
        network: Network,
        secp: &Secp256k1<All>
    ) -> Result<String, DescriptorError>where
        T: IntoWalletDescriptor,
    Expand description

    Deterministically generate a unique name given the descriptors defining the wallet

    Compatible with wallet_name_from_descriptor

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk/wallet/index.html b/docs-rs/bdk/nightly/latest/bdk/wallet/index.html index d30e4d13d4..a50fe8a782 100644 --- a/docs-rs/bdk/nightly/latest/bdk/wallet/index.html +++ b/docs-rs/bdk/nightly/latest/bdk/wallet/index.html @@ -1,5 +1,5 @@ bdk::wallet - Rust

    Module bdk::wallet

    source ·
    Expand description

    Wallet

    + logo

    Module wallet

    Module bdk::wallet

    source ·
    Expand description

    Wallet

    This module defines the Wallet.

    Modules

    Coin selection
    Errors that can be thrown by the Wallet
    Wallet export
    Generalized signers
    Transaction builder

    Structs

    A derived address and the index it was found at. For convenience this automatically derefs to Address
    Balance, differentiated into various categories.
    The changes made to a wallet by applying an Update.
    An update to Wallet.
    A Bitcoin wallet

    Enums

    An error that may occur when applying a block to Wallet.
    An error that may occur when inserting a transaction into Wallet.
    The error type when loading a Wallet from persistence.
    The error type when constructing a fresh Wallet.
    Error type for when we try load a Wallet from persistence and creating it if non-existent.

    Traits

    Trait to check if a value is below the dust limit. diff --git a/docs-rs/bdk/nightly/latest/bdk/wallet/struct.AddressInfo.html b/docs-rs/bdk/nightly/latest/bdk/wallet/struct.AddressInfo.html index 87aabb18d1..0dd349c0a8 100644 --- a/docs-rs/bdk/nightly/latest/bdk/wallet/struct.AddressInfo.html +++ b/docs-rs/bdk/nightly/latest/bdk/wallet/struct.AddressInfo.html @@ -1,5 +1,5 @@ AddressInfo in bdk::wallet - Rust

    Trait Implementations§

    Formats the value using the given formatter. Read more
    The resulting type after dereferencing.
    Dereferences the value.
    Formats the value using the given formatter. Read more
    This method tests for self and other values to be equal, and is used +

    Trait Implementations§

    Formats the value using the given formatter. Read more
    The resulting type after dereferencing.
    Dereferences the value.
    Formats the value using the given formatter. Read more
    This method tests for self and other values to be equal, and is used by ==. Read more
    This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +sufficient, and should not be overridden without very good reason. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    Calls U::from(self).

    That is, this conversion is whatever the implementation of From<T> for U chooses to do.

    diff --git a/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Balance.html b/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Balance.html index 350738cdef..9d7d4de81b 100644 --- a/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Balance.html +++ b/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Balance.html @@ -13,7 +13,7 @@

    This is the balance you can spend right now that shouldn’t get cancelled via another party double spending it.

    Get the whole balance visible to the wallet.

    -

    Trait Implementations§

    The resulting type after applying the + operator.
    Performs the + operation. Read more
    Returns a copy of the value. Read more
    Performs copy-assignment from source. Read more
    Formats the value using the given formatter. Read more
    Returns the “default value” for a type. Read more
    Deserialize this value from the given Serde deserializer. Read more
    Formats the value using the given formatter. Read more
    This method tests for self and other values to be equal, and is used +

    Trait Implementations§

    The resulting type after applying the + operator.
    Performs the + operation. Read more
    Returns a copy of the value. Read more
    Performs copy-assignment from source. Read more
    Formats the value using the given formatter. Read more
    Returns the “default value” for a type. Read more
    Deserialize this value from the given Serde deserializer. Read more
    Formats the value using the given formatter. Read more
    This method tests for self and other values to be equal, and is used by ==. Read more
    This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
    Serialize this value into the given Serde serializer. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    Calls U::from(self).

    diff --git a/docs-rs/bdk/nightly/latest/bdk/wallet/struct.ChangeSet.html b/docs-rs/bdk/nightly/latest/bdk/wallet/struct.ChangeSet.html index aed6058d8e..fef5681e8b 100644 --- a/docs-rs/bdk/nightly/latest/bdk/wallet/struct.ChangeSet.html +++ b/docs-rs/bdk/nightly/latest/bdk/wallet/struct.ChangeSet.html @@ -1,5 +1,5 @@ ChangeSet in bdk::wallet - Rust

    Fields§

    §chain: ChangeSet

    Changes to the LocalChain.

    §indexed_tx_graph: ChangeSet<ConfirmationTimeHeightAnchor, ChangeSet<KeychainKind>>

    Changes to IndexedTxGraph.

    §network: Option<Network>

    Stores the network type of the wallet.

    -

    Trait Implementations§

    Append another object of the same type onto self.
    Returns whether the structure is considered empty.
    Returns a copy of the value. Read more
    Performs copy-assignment from source. Read more
    Formats the value using the given formatter. Read more
    Returns the “default value” for a type. Read more
    Deserialize this value from the given Serde deserializer. Read more
    Converts to this type from the input type.
    Converts to this type from the input type.
    This method tests for self and other values to be equal, and is used +

    Trait Implementations§

    Append another object of the same type onto self.
    Returns whether the structure is considered empty.
    Returns a copy of the value. Read more
    Performs copy-assignment from source. Read more
    Formats the value using the given formatter. Read more
    Returns the “default value” for a type. Read more
    Deserialize this value from the given Serde deserializer. Read more
    Converts to this type from the input type.
    Converts to this type from the input type.
    This method tests for self and other values to be equal, and is used by ==. Read more
    This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason. Read more
    Serialize this value into the given Serde serializer. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +sufficient, and should not be overridden without very good reason. Read more
    Serialize this value into the given Serde serializer. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    Calls U::from(self).

    That is, this conversion is whatever the implementation of From<T> for U chooses to do.

    diff --git a/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Update.html b/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Update.html index 404a12dc6a..d3a32414ba 100644 --- a/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Update.html +++ b/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Update.html @@ -1,5 +1,5 @@ Update in bdk::wallet - Rust

    Struct bdk::wallet::Update

    source ·
    pub struct Update {
    +                    logo

    Update

    Struct bdk::wallet::Update

    source ·
    pub struct Update {
         pub last_active_indices: BTreeMap<KeychainKind, u32>,
         pub graph: TxGraph<ConfirmationTimeHeightAnchor>,
         pub chain: Option<CheckPoint>,
    @@ -9,7 +9,7 @@
     [KeychainTxOutIndex].

    §graph: TxGraph<ConfirmationTimeHeightAnchor>

    Update for the wallet’s internal [TxGraph].

    §chain: Option<CheckPoint>

    Update for the wallet’s internal LocalChain.

    -

    Trait Implementations§

    Returns a copy of the value. Read more
    Performs copy-assignment from source. Read more
    Formats the value using the given formatter. Read more
    Returns the “default value” for a type. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +

    Trait Implementations§

    Returns a copy of the value. Read more
    Performs copy-assignment from source. Read more
    Formats the value using the given formatter. Read more
    Returns the “default value” for a type. Read more
    Converts to this type from the input type.
    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    Calls U::from(self).

    That is, this conversion is whatever the implementation of From<T> for U chooses to do.

    diff --git a/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Wallet.html b/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Wallet.html index 8e312f6904..6f05ecbaf3 100644 --- a/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Wallet.html +++ b/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Wallet.html @@ -1,89 +1,89 @@ Wallet in bdk::wallet - Rust

    Struct bdk::wallet::Wallet

    source ·
    pub struct Wallet { /* private fields */ }
    Expand description

    A Bitcoin wallet

    + logo

    Wallet

    Struct bdk::wallet::Wallet

    source ·
    pub struct Wallet { /* private fields */ }
    Expand description

    A Bitcoin wallet

    The Wallet acts as a way of coherently interfacing with output descriptors and related transactions. Its main components are:

    1. output descriptors from which it can derive addresses.
    2. signers that can contribute signatures to addresses instantiated from the descriptors.
    -

    Implementations§

    Creates a wallet that does not persist data.

    -

    Creates a wallet that does not persist data, with a custom genesis hash.

    -

    Initialize an empty Wallet.

    -

    Initialize an empty Wallet with a custom genesis hash.

    +

    Implementations§

    Creates a wallet that does not persist data.

    +

    Creates a wallet that does not persist data, with a custom genesis hash.

    +

    Initialize an empty Wallet.

    +

    Initialize an empty Wallet with a custom genesis hash.

    This is like Wallet::new with an additional genesis_hash parameter. This is useful for syncing from alternative networks.

    -

    Load Wallet from the given persistence backend.

    -

    Either loads Wallet from persistence, or initializes it if it does not exist.

    +

    Load Wallet from the given persistence backend.

    +

    Either loads Wallet from persistence, or initializes it if it does not exist.

    This method will fail if the loaded Wallet has different parameters to those provided.

    -

    Either loads Wallet from persistence, or initializes it if it does not exist (with a +

    Either loads Wallet from persistence, or initializes it if it does not exist (with a custom genesis hash).

    This method will fail if the loaded Wallet has different parameters to those provided. This is like Wallet::new_or_load with an additional genesis_hash parameter. This is useful for syncing from alternative networks.

    -

    Get the Bitcoin network the wallet is using.

    -

    Iterator over all keychains in this wallet

    -

    Peek an address of the given keychain at index without revealing it.

    +

    Get the Bitcoin network the wallet is using.

    +

    Iterator over all keychains in this wallet

    +

    Peek an address of the given keychain at index without revealing it.

    For non-wildcard descriptors this returns the same address at every provided index.

    Panics

    This panics when the caller requests for an address of derivation index greater than the BIP32 max index.

    -

    Attempt to reveal the next address of the given keychain.

    +

    Attempt to reveal the next address of the given keychain.

    This will increment the internal derivation index. If the keychain’s descriptor doesn’t contain a wildcard or every address is already revealed up to the maximum derivation index defined in BIP32, then returns the last revealed address.

    Errors

    If writing to persistent storage fails.

    -

    Reveal addresses up to and including the target index and return an iterator +

    Reveal addresses up to and including the target index and return an iterator of newly revealed addresses.

    If the target index is unreachable, we make a best effort to reveal up to the last possible index. If all addresses up to the given index are already revealed, then no new addresses are returned.

    Errors

    If writing to persistent storage fails.

    -

    Get the next unused address for the given keychain, i.e. the address with the lowest +

    Get the next unused address for the given keychain, i.e. the address with the lowest derivation index that hasn’t been used.

    This will attempt to derive and reveal a new address if no newly revealed addresses are available. See also reveal_next_address.

    Errors

    If writing to persistent storage fails.

    -

    Marks an address used of the given keychain at index.

    +

    Marks an address used of the given keychain at index.

    Returns whether the given index was present and then removed from the unused set.

    -

    Undoes the effect of mark_used and returns whether the index was inserted +

    Undoes the effect of mark_used and returns whether the index was inserted back into the unused set.

    Since this is only a superficial marker, it will have no effect if the address at the given index was actually used, i.e. the wallet has previously indexed a tx output for the derived spk.

    -

    List addresses that are revealed but unused.

    +

    List addresses that are revealed but unused.

    Note if the returned iterator is empty you can reveal more addresses by using reveal_next_address or reveal_addresses_to.

    -

    Return whether or not a script is part of this wallet (either internal or external)

    -

    Finds how the wallet derived the script pubkey spk.

    +

    Return whether or not a script is part of this wallet (either internal or external)

    +

    Finds how the wallet derived the script pubkey spk.

    Will only return Some(_) if the wallet has given out the spk.

    -

    Return the list of unspent outputs of this wallet

    -

    List all relevant outputs (includes both spent and unspent, confirmed and unconfirmed).

    +

    Return the list of unspent outputs of this wallet

    +

    List all relevant outputs (includes both spent and unspent, confirmed and unconfirmed).

    To list only unspent outputs (UTXOs), use Wallet::list_unspent instead.

    -

    Get all the checkpoints the wallet is currently storing indexed by height.

    -

    Returns the latest checkpoint.

    -

    Get unbounded script pubkey iterators for both Internal and External keychains.

    +

    Get all the checkpoints the wallet is currently storing indexed by height.

    +

    Returns the latest checkpoint.

    +

    Get unbounded script pubkey iterators for both Internal and External keychains.

    This is intended to be used when doing a full scan of your addresses (e.g. after restoring from seed words). You pass the BTreeMap of iterators to a blockchain data source (e.g. electrum server) which will go through each address until it reaches a stop gap.

    Note carefully that iterators go over all script pubkeys on the keychains (not what script pubkeys the wallet is storing internally).

    -

    Get an unbounded script pubkey iterator for the given keychain.

    +

    Get an unbounded script pubkey iterator for the given keychain.

    See all_unbounded_spk_iters for more documentation

    -

    Returns the utxo owned by this wallet corresponding to outpoint if it exists in the +

    Returns the utxo owned by this wallet corresponding to outpoint if it exists in the wallet’s database.

    -

    Inserts a [TxOut] at [OutPoint] into the wallet’s transaction graph.

    +

    Inserts a [TxOut] at [OutPoint] into the wallet’s transaction graph.

    This is used for providing a previous output’s value so that we can use calculate_fee or calculate_fee_rate on a given transaction. Outputs inserted with this method will not be returned in list_unspent or list_output.

    Any inserted TxOuts are not persisted until commit is called.

    WARNING: This should only be used to add TxOuts that the wallet does not own. Only insert TxOuts that you trust the values for!

    -

    Calculates the fee of a given transaction. Returns 0 if tx is a coinbase transaction.

    +

    Calculates the fee of a given transaction. Returns 0 if tx is a coinbase transaction.

    To calculate the fee for a [Transaction] with inputs not owned by this wallet you must manually insert the TxOut(s) into the tx graph using the insert_txout function.

    Note tx does not have to be in the graph for this to work.

    @@ -93,7 +93,7 @@
    Examples
    let tx = &psbt.clone().extract_tx().expect("tx");
     let fee = wallet.calculate_fee(tx).expect("fee");
    -

    Calculate the [FeeRate] for a given transaction.

    +

    Calculate the [FeeRate] for a given transaction.

    To calculate the fee rate for a [Transaction] with inputs not owned by this wallet you must manually insert the TxOut(s) into the tx graph using the insert_txout function.

    Note tx does not have to be in the graph for this to work.

    @@ -103,7 +103,7 @@
    Examples
    let tx = &psbt.clone().extract_tx().expect("tx");
     let fee_rate = wallet.calculate_fee_rate(tx).expect("fee rate");
    -

    Compute the tx’s sent and received amounts (in satoshis).

    +

    Compute the tx’s sent and received amounts (in satoshis).

    This method returns a tuple (sent, received). Sent is the sum of the txin amounts that spend from previous txouts tracked by this wallet. Received is the summation of this tx’s outputs that send to script pubkeys tracked by this wallet.

    @@ -113,7 +113,7 @@
    Examples
    let tx = &psbt.clone().extract_tx().expect("tx");
     let (sent, received) = wallet.sent_and_received(tx);
    -

    Get a single transaction from the wallet as a [CanonicalTx] (if the transaction exists).

    +

    Get a single transaction from the wallet as a [CanonicalTx] (if the transaction exists).

    CanonicalTx contains the full transaction alongside meta-data such as:

    • Blocks that the transaction is Anchored in. These may or may not be blocks that exist @@ -151,11 +151,11 @@
      Examples
      last_seen, ), }
    -

    Add a new checkpoint to the wallet’s internal view of the chain. +

    Add a new checkpoint to the wallet’s internal view of the chain. This stages but does not commit the change.

    Returns whether anything changed with the insertion (e.g. false if checkpoint was already there).

    -

    Add a transaction to the wallet’s internal view of the chain. This stages but does not +

    Add a transaction to the wallet’s internal view of the chain. This stages but does not commit the change.

    Returns whether anything changed with the transaction insertion (e.g. false if the transaction was already inserted at the same position).

    @@ -165,12 +165,12 @@
    Examples

    WARNING: If position is confirmed, we anchor the tx to a the lowest checkpoint that is >= the position’s height. The caller is responsible for ensuring the tx exists in our local view of the best chain’s history.

    -

    Iterate over the transactions in the wallet.

    -

    Return the balance, separated into available, trusted-pending, untrusted-pending and immature +

    Iterate over the transactions in the wallet.

    +

    Return the balance, separated into available, trusted-pending, untrusted-pending and immature values.

    -

    Add an external signer

    +

    Add an external signer

    See the signer module for an example.

    -

    Get the signers

    +

    Get the signers

    Example
    let wallet = Wallet::new_no_persist("wpkh(tprv8ZgxMBicQKsPe73PBRSmNbTfbcsZnwWhz5eVmhHpi31HW29Z7mc9B4cWGRQzopNUzZUT391DeDJxL2PefNunWyLgqCKRMDkU1s2s8bAfoSk/84'/0'/0'/0/*)", None, Network::Testnet)?;
     for secret_key in wallet.get_signers(KeychainKind::External).signers().iter().filter_map(|s| s.descriptor_secret_key()) {
    @@ -179,7 +179,7 @@ 
    Example
    } Ok::<(), Box<dyn std::error::Error>>(())
    -

    Start building a transaction.

    +

    Start building a transaction.

    This returns a blank TxBuilder from which you can specify the parameters for the transaction.

    Example
    let psbt = {
    @@ -190,7 +190,7 @@ 
    Example
    }; // sign and broadcast ...
    -

    Bump the fee of a transaction previously created with this wallet.

    +

    Bump the fee of a transaction previously created with this wallet.

    Returns an error if the transaction is already confirmed or doesn’t explicitly signal replace by fee (RBF). If the transaction can be fee bumped then it returns a TxBuilder pre-populated with the inputs and outputs of the original transaction.

    @@ -215,7 +215,7 @@
    Example
    let _ = wallet.sign(&mut psbt, SignOptions::default())?; let fee_bumped_tx = psbt.extract_tx(); // broadcast fee_bumped_tx to replace original
    -

    Sign a transaction with all the wallet’s signers, in the order specified by every signer’s +

    Sign a transaction with all the wallet’s signers, in the order specified by every signer’s SignerOrdering. This function returns the Result type with an encapsulated bool that has the value true if the PSBT was finalized, or false otherwise.

    The SignOptions can be used to tweak the behavior of the software signers, and the way the transaction is finalized at the end. Note that it can’t be guaranteed that every @@ -229,52 +229,63 @@

    Example
    }; let finalized = wallet.sign(&mut psbt, SignOptions::default())?; assert!(finalized, "we should have signed all the inputs");
    -

    Return the spending policies for the wallet’s descriptor

    -

    Return the “public” version of the wallet’s descriptor, meaning a new descriptor that has +

    Return the spending policies for the wallet’s descriptor

    +

    Return the “public” version of the wallet’s descriptor, meaning a new descriptor that has the same structure but with every secret key removed

    This can be used to build a watch-only version of a wallet

    -

    Finalize a PSBT, i.e., for each input determine if sufficient data is available to pass +

    Finalize a PSBT, i.e., for each input determine if sufficient data is available to pass validation and construct the respective scriptSig or scriptWitness. Please refer to BIP174 for further information.

    Returns true if the PSBT could be finalized, and false otherwise.

    The SignOptions can be used to tweak the behavior of the finalizer.

    -

    Return the secp256k1 context used for all signing operations

    -

    Returns the descriptor used to create addresses for a particular keychain.

    -

    The derivation index of this wallet. It will return None if it has not derived any addresses. +

    Return the secp256k1 context used for all signing operations

    +

    Returns the descriptor used to create addresses for a particular keychain.

    +

    The derivation index of this wallet. It will return None if it has not derived any addresses. Otherwise, it will return the index of the highest address it has derived.

    -

    The index of the next address that you would get if you were to ask the wallet for a new address

    -

    Informs the wallet that you no longer intend to broadcast a tx that was built from it.

    +

    The index of the next address that you would get if you were to ask the wallet for a new address

    +

    Informs the wallet that you no longer intend to broadcast a tx that was built from it.

    This frees up the change address used when creating the tx for use in future transactions.

    -

    get the corresponding PSBT Input for a LocalUtxo

    -

    Return the checksum of the public descriptor associated to keychain

    +

    get the corresponding PSBT Input for a LocalUtxo

    +

    Return the checksum of the public descriptor associated to keychain

    Internally calls Self::get_descriptor_for_keychain to fetch the right descriptor

    -

    Applies an update to the wallet and stages the changes (but does not commit them).

    +

    Applies an update to the wallet and stages the changes (but does not commit them).

    Usually you create an update by interacting with some blockchain data source and inserting transactions related to your wallet into it.

    -

    Commits all currently staged changed to the persistence backend returning and error when +

    Commits all currently staged changed to the persistence backend returning and error when this fails.

    This returns whether the update resulted in any changes.

    -

    Returns the changes that will be committed with the next call to commit.

    -

    Get a reference to the inner [TxGraph].

    -

    Get a reference to the inner [KeychainTxOutIndex].

    -

    Get a reference to the inner [LocalChain].

    -

    Introduces a block of height to the wallet, and tries to connect it to the +

    Returns the changes that will be committed with the next call to commit.

    +

    Get a reference to the inner [TxGraph].

    +

    Get a reference to the inner [KeychainTxOutIndex].

    +

    Get a reference to the inner [LocalChain].

    +

    Introduces a block of height to the wallet, and tries to connect it to the prev_blockhash of the block’s header.

    This is a convenience method that is equivalent to calling apply_block_connected_to with prev_blockhash and height-1 as the connected_to parameter.

    -

    Applies relevant transactions from block of height to the wallet, and connects the +

    Applies relevant transactions from block of height to the wallet, and connects the block to the internal chain.

    The connected_to parameter informs the wallet how this block connects to the internal [LocalChain]. Relevant transactions are filtered from the block and inserted into the internal [TxGraph].

    -

    Apply relevant unconfirmed transactions to the wallet.

    +

    Apply relevant unconfirmed transactions to the wallet.

    Transactions that are not relevant are filtered out.

    This method takes in an iterator of (tx, last_seen) where last_seen is the timestamp of when the transaction was last seen in the mempool. This is used for conflict resolution when there is conflicting unconfirmed transactions. The transaction with the later last_seen is prioritized.

    -

    Trait Implementations§

    Converts this type into a shared reference of the (usually inferred) input type.
    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +

    Methods to construct sync/full-scan requests for spk-based chain sources.

    +

    Create a partial [SyncRequest] for this wallet for all revealed spks.

    +

    This is the first step when performing a spk-based wallet partial sync, the returned +[SyncRequest] collects all revealed script pubkeys from the wallet keychain needed to +start a blockchain sync with a spk based blockchain client.

    +

    Create a [`FullScanRequest] for this wallet.

    +

    This is the first step when performing a spk-based wallet full scan, the returned +[`FullScanRequest] collects iterators for the wallet’s keychain script pub keys needed to +start a blockchain full scan with a spk based blockchain client.

    +

    This operation is generally only used when importing or restoring a previously used wallet +in which the list of used scripts is not known.

    +

    Trait Implementations§

    Converts this type into a shared reference of the (usually inferred) input type.
    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    Calls U::from(self).

    That is, this conversion is whatever the implementation of From<T> for U chooses to do.

    diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/all.html b/docs-rs/bdk/nightly/latest/bdk_chain/all.html index 862d12b6af..325cfb833b 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/all.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/all.html @@ -1 +1 @@ -List of all items in this crate
    \ No newline at end of file +List of all items in this crate
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/constant.COINBASE_MATURITY.html b/docs-rs/bdk/nightly/latest/bdk_chain/constant.COINBASE_MATURITY.html index 655bca0e35..6032de91a2 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/constant.COINBASE_MATURITY.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/constant.COINBASE_MATURITY.html @@ -1,2 +1,2 @@ -COINBASE_MATURITY in bdk_chain - Rust
    pub const COINBASE_MATURITY: u32 = 100;
    Expand description

    How many confirmations are needed f or a coinbase output to be spent.

    +COINBASE_MATURITY in bdk_chain - Rust
    pub const COINBASE_MATURITY: u32 = 100;
    Expand description

    How many confirmations are needed f or a coinbase output to be spent.

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/index.html b/docs-rs/bdk/nightly/latest/bdk_chain/index.html index fec2538075..ab76e34197 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/index.html @@ -1,4 +1,4 @@ -bdk_chain - Rust

    Crate bdk_chain

    source ·
    Expand description

    This crate is a collection of core structures for Bitcoin Dev Kit.

    +bdk_chain - Rust

    Crate bdk_chain

    source ·
    Expand description

    This crate is a collection of core structures for Bitcoin Dev Kit.

    The goal of this crate is to give wallets the mechanisms needed to:

    1. Figure out what data they need to fetch.
    2. @@ -15,6 +15,6 @@ cache or how you retrieve it from persistent storage.

    Re-exports

    pub extern crate serde_crate as serde;
    pub use bitcoin;
    pub use indexed_tx_graph::IndexedTxGraph;
    pub use tx_graph::TxGraph;
    pub use miniscript;

    Modules

    Contains the IndexedTxGraph and associated types. Refer to the -IndexedTxGraph documentation for more.
    Module for keychain related structures.
    The LocalChain is a local implementation of ChainOracle.
    Module for structures that store and traverse transactions.

    Structs

    A reference to a block in the canonical chain.
    An Anchor implementation that also records the exact confirmation height of the transaction.
    An Anchor implementation that also records the exact confirmation time and height of the +IndexedTxGraph documentation for more.
    Module for keychain related structures.
    The LocalChain is a local implementation of ChainOracle.
    Helper types for spk-based blockchain clients.
    Module for structures that store and traverse transactions.

    Structs

    A reference to a block in the canonical chain.
    An Anchor implementation that also records the exact confirmation height of the transaction.
    An Anchor implementation that also records the exact confirmation time and height of the transaction.
    A TxOut with as much data as we can retrieve about it
    An iterator for derived script pubkeys.
    An index storing TxOuts that have a script pubkey that matches those in a list.

    Enums

    Represents the observed position of some chain data.
    Block height and timestamp at which a transaction is confirmed.

    Constants

    Maximum BIP32 derivation index.
    How many confirmations are needed f or a coinbase output to be spent.

    Traits

    Trait that “anchors” blockchain data to a specific block of height and hash.
    An Anchor that can be constructed from a given block, block height and transaction position within the block.
    Trait that makes an object appendable.
    Represents a service that tracks the blockchain.
    A trait to extend the functionality of a miniscript descriptor.
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/sidebar-items.js b/docs-rs/bdk/nightly/latest/bdk_chain/sidebar-items.js index 28c488a0dd..c8aa264eb7 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/sidebar-items.js +++ b/docs-rs/bdk/nightly/latest/bdk_chain/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"constant":[["BIP32_MAX_INDEX","Maximum BIP32 derivation index."],["COINBASE_MATURITY","How many confirmations are needed f or a coinbase output to be spent."]],"enum":[["ChainPosition","Represents the observed position of some chain data."],["ConfirmationTime","Block height and timestamp at which a transaction is confirmed."]],"externcrate":[["serde",""]],"mod":[["indexed_tx_graph","Contains the [`IndexedTxGraph`] and associated types. Refer to the [`IndexedTxGraph`] documentation for more."],["keychain","Module for keychain related structures."],["local_chain","The [`LocalChain`] is a local implementation of [`ChainOracle`]."],["tx_graph","Module for structures that store and traverse transactions."]],"struct":[["BlockId","A reference to a block in the canonical chain."],["ConfirmationHeightAnchor","An [`Anchor`] implementation that also records the exact confirmation height of the transaction."],["ConfirmationTimeHeightAnchor","An [`Anchor`] implementation that also records the exact confirmation time and height of the transaction."],["FullTxOut","A `TxOut` with as much data as we can retrieve about it"],["SpkIterator","An iterator for derived script pubkeys."],["SpkTxOutIndex","An index storing `TxOut`s that have a script pubkey that matches those in a list."]],"trait":[["Anchor","Trait that “anchors” blockchain data to a specific block of height and hash."],["AnchorFromBlockPosition","An [`Anchor`] that can be constructed from a given block, block height and transaction position within the block."],["Append","Trait that makes an object appendable."],["ChainOracle","Represents a service that tracks the blockchain."],["DescriptorExt","A trait to extend the functionality of a miniscript descriptor."]]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"constant":[["BIP32_MAX_INDEX","Maximum BIP32 derivation index."],["COINBASE_MATURITY","How many confirmations are needed f or a coinbase output to be spent."]],"enum":[["ChainPosition","Represents the observed position of some chain data."],["ConfirmationTime","Block height and timestamp at which a transaction is confirmed."]],"externcrate":[["serde",""]],"mod":[["indexed_tx_graph","Contains the [`IndexedTxGraph`] and associated types. Refer to the [`IndexedTxGraph`] documentation for more."],["keychain","Module for keychain related structures."],["local_chain","The [`LocalChain`] is a local implementation of [`ChainOracle`]."],["spk_client","Helper types for spk-based blockchain clients."],["tx_graph","Module for structures that store and traverse transactions."]],"struct":[["BlockId","A reference to a block in the canonical chain."],["ConfirmationHeightAnchor","An [`Anchor`] implementation that also records the exact confirmation height of the transaction."],["ConfirmationTimeHeightAnchor","An [`Anchor`] implementation that also records the exact confirmation time and height of the transaction."],["FullTxOut","A `TxOut` with as much data as we can retrieve about it"],["SpkIterator","An iterator for derived script pubkeys."],["SpkTxOutIndex","An index storing `TxOut`s that have a script pubkey that matches those in a list."]],"trait":[["Anchor","Trait that “anchors” blockchain data to a specific block of height and hash."],["AnchorFromBlockPosition","An [`Anchor`] that can be constructed from a given block, block height and transaction position within the block."],["Append","Trait that makes an object appendable."],["ChainOracle","Represents a service that tracks the blockchain."],["DescriptorExt","A trait to extend the functionality of a miniscript descriptor."]]}; \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/index.html b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/index.html new file mode 100644 index 0000000000..98df709141 --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/index.html @@ -0,0 +1,2 @@ +bdk_chain::spk_client - Rust

    Module bdk_chain::spk_client

    source ·
    Expand description

    Helper types for spk-based blockchain clients.

    +

    Structs

    Data required to perform a spk-based blockchain client full scan.
    Data returned from a spk-based blockchain client full scan.
    Data required to perform a spk-based blockchain client sync.
    Data returned from a spk-based blockchain client sync.
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/sidebar-items.js b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/sidebar-items.js new file mode 100644 index 0000000000..4e71da4faf --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":[["FullScanRequest","Data required to perform a spk-based blockchain client full scan."],["FullScanResult","Data returned from a spk-based blockchain client full scan."],["SyncRequest","Data required to perform a spk-based blockchain client sync."],["SyncResult","Data returned from a spk-based blockchain client sync."]]}; \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanRequest.html b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanRequest.html new file mode 100644 index 0000000000..7bfe2cd9e5 --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanRequest.html @@ -0,0 +1,31 @@ +FullScanRequest in bdk_chain::spk_client - Rust
    pub struct FullScanRequest<K> {
    +    pub chain_tip: CheckPoint,
    +    pub spks_by_keychain: BTreeMap<K, Box<dyn Iterator<Item = (u32, ScriptBuf)> + Send>>,
    +}
    Expand description

    Data required to perform a spk-based blockchain client full scan.

    +

    A client full scan iterates through all the scripts for the given keychains, fetching relevant +data until some stop gap number of scripts is found that have no data. This operation is +generally only used when importing or restoring previously used keychains in which the list of +used scripts is not known. The full scan process also updates the chain from the given CheckPoint.

    +

    Fields§

    §chain_tip: CheckPoint

    A checkpoint for the current LocalChain::tip. +The full scan process will return a new chain update that extends this tip.

    +
    §spks_by_keychain: BTreeMap<K, Box<dyn Iterator<Item = (u32, ScriptBuf)> + Send>>

    Iterators of script pubkeys indexed by the keychain index.

    +

    Implementations§

    Construct a new FullScanRequest from a given chain_tip.

    +

    Construct a new FullScanRequest from a given chain_tip and index.

    +

    Unbounded script pubkey iterators for each keychain (K) are extracted using +KeychainTxOutIndex::all_unbounded_spk_iters and is used to populate the +FullScanRequest.

    +

    Set the [Script]s for a given keychain.

    +

    This consumes the FullScanRequest and returns the updated one.

    +

    Chain on additional [Script]s that will be synced against.

    +

    This consumes the FullScanRequest and returns the updated one.

    +

    Add a closure that will be called for every [Script] previously added to any keychain in +this request.

    +

    This consumes the SyncRequest and returns the updated one.

    +

    Add a closure that will be called for every [Script] previously added to a given +keychain in this request.

    +

    This consumes the SyncRequest and returns the updated one.

    +

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +

    Calls U::from(self).

    +

    That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

    +
    The type returned in the event of a conversion error.
    Performs the conversion.
    The type returned in the event of a conversion error.
    Performs the conversion.
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanResult.html b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanResult.html new file mode 100644 index 0000000000..68841fb4db --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanResult.html @@ -0,0 +1,14 @@ +FullScanResult in bdk_chain::spk_client - Rust
    pub struct FullScanResult<K> {
    +    pub graph_update: TxGraph<ConfirmationTimeHeightAnchor>,
    +    pub chain_update: CheckPoint,
    +    pub last_active_indices: BTreeMap<K, u32>,
    +}
    Expand description

    Data returned from a spk-based blockchain client full scan.

    +

    See also FullScanRequest.

    +

    Fields§

    §graph_update: TxGraph<ConfirmationTimeHeightAnchor>

    The update to apply to the receiving LocalChain.

    +
    §chain_update: CheckPoint

    The update to apply to the receiving TxGraph.

    +
    §last_active_indices: BTreeMap<K, u32>

    Last active indices for the corresponding keychains (K).

    +

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +

    Calls U::from(self).

    +

    That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

    +
    The type returned in the event of a conversion error.
    Performs the conversion.
    The type returned in the event of a conversion error.
    Performs the conversion.
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncRequest.html b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncRequest.html new file mode 100644 index 0000000000..a99e60a2c8 --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncRequest.html @@ -0,0 +1,39 @@ +SyncRequest in bdk_chain::spk_client - Rust
    pub struct SyncRequest {
    +    pub chain_tip: CheckPoint,
    +    pub spks: Box<dyn ExactSizeIterator<Item = ScriptBuf> + Send>,
    +    pub txids: Box<dyn ExactSizeIterator<Item = Txid> + Send>,
    +    pub outpoints: Box<dyn ExactSizeIterator<Item = OutPoint> + Send>,
    +}
    Expand description

    Data required to perform a spk-based blockchain client sync.

    +

    A client sync fetches relevant chain data for a known list of scripts, transaction ids and +outpoints. The sync process also updates the chain from the given CheckPoint.

    +

    Fields§

    §chain_tip: CheckPoint

    A checkpoint for the current chain LocalChain::tip. +The sync process will return a new chain update that extends this tip.

    +
    §spks: Box<dyn ExactSizeIterator<Item = ScriptBuf> + Send>

    Transactions that spend from or to these indexed script pubkeys.

    +
    §txids: Box<dyn ExactSizeIterator<Item = Txid> + Send>

    Transactions with these txids.

    +
    §outpoints: Box<dyn ExactSizeIterator<Item = OutPoint> + Send>

    Transactions with these outpoints or spent from these outpoints.

    +

    Implementations§

    Construct a new SyncRequest from a given cp tip.

    +

    Set the [Script]s that will be synced against.

    +

    This consumes the SyncRequest and returns the updated one.

    +

    Set the [Txid]s that will be synced against.

    +

    This consumes the SyncRequest and returns the updated one.

    +

    Set the [OutPoint]s that will be synced against.

    +

    This consumes the SyncRequest and returns the updated one.

    +

    Chain on additional [Script]s that will be synced against.

    +

    This consumes the SyncRequest and returns the updated one.

    +

    Chain on additional [Txid]s that will be synced against.

    +

    This consumes the SyncRequest and returns the updated one.

    +

    Chain on additional [OutPoint]s that will be synced against.

    +

    This consumes the SyncRequest and returns the updated one.

    +

    Add a closure that will be called for [Script]s previously added to this request.

    +

    This consumes the SyncRequest and returns the updated one.

    +

    Add a closure that will be called for [Txid]s previously added to this request.

    +

    This consumes the SyncRequest and returns the updated one.

    +

    Add a closure that will be called for [OutPoint]s previously added to this request.

    +

    This consumes the SyncRequest and returns the updated one.

    +

    Populate the request with revealed script pubkeys from index with the given spk_range.

    +

    This consumes the SyncRequest and returns the updated one.

    +

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +

    Calls U::from(self).

    +

    That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

    +
    The type returned in the event of a conversion error.
    Performs the conversion.
    The type returned in the event of a conversion error.
    Performs the conversion.
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncResult.html b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncResult.html new file mode 100644 index 0000000000..b5a5e673d5 --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncResult.html @@ -0,0 +1,12 @@ +SyncResult in bdk_chain::spk_client - Rust
    pub struct SyncResult<A = ConfirmationTimeHeightAnchor> {
    +    pub graph_update: TxGraph<A>,
    +    pub chain_update: CheckPoint,
    +}
    Expand description

    Data returned from a spk-based blockchain client sync.

    +

    See also SyncRequest.

    +

    Fields§

    §graph_update: TxGraph<A>

    The update to apply to the receiving TxGraph.

    +
    §chain_update: CheckPoint

    The update to apply to the receiving LocalChain.

    +

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +

    Calls U::from(self).

    +

    That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

    +
    The type returned in the event of a conversion error.
    Performs the conversion.
    The type returned in the event of a conversion error.
    Performs the conversion.
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_esplora/all.html b/docs-rs/bdk/nightly/latest/bdk_esplora/all.html index 59a394f4c5..57e4414480 100644 --- a/docs-rs/bdk/nightly/latest/bdk_esplora/all.html +++ b/docs-rs/bdk/nightly/latest/bdk_esplora/all.html @@ -1 +1 @@ -List of all items in this crate

    List of all items

    Structs

    Traits

    Type Definitions

    \ No newline at end of file +List of all items in this crate

    List of all items

    Traits

    Type Definitions

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_esplora/index.html b/docs-rs/bdk/nightly/latest/bdk_esplora/index.html index 621a41d5f1..9cfd92e9cb 100644 --- a/docs-rs/bdk/nightly/latest/bdk_esplora/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_esplora/index.html @@ -1,4 +1,4 @@ -bdk_esplora - Rust

    Crate bdk_esplora

    source ·
    Expand description

    BDK Esplora

    +bdk_esplora - Rust

    Crate bdk_esplora

    source ·
    Expand description

    BDK Esplora

    BDK Esplora extends esplora-client to update bdk_chain structures from an Esplora server.

    Usage

    @@ -29,4 +29,4 @@

    Usage

    sync or full scan the user receives relevant blockchain data and output updates for bdk_chain via a new TxGraph to be appended to any existing TxGraph data.

    Refer to example_esplora for a complete example.

    -

    Re-exports

    pub use esplora_client;

    Structs

    Update returns from a full scan.
    Update returned from a sync.

    Traits

    Trait to extend the functionality of [esplora_client::AsyncClient].
    Trait to extend the functionality of [esplora_client::BlockingClient].

    Type Definitions

    [esplora_client::Error]
    \ No newline at end of file +

    Re-exports

    pub use esplora_client;

    Traits

    Trait to extend the functionality of [esplora_client::AsyncClient].
    Trait to extend the functionality of [esplora_client::BlockingClient].

    Type Definitions

    [esplora_client::Error]
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_esplora/sidebar-items.js b/docs-rs/bdk/nightly/latest/bdk_esplora/sidebar-items.js index 98b84c28a2..552c0c06a4 100644 --- a/docs-rs/bdk/nightly/latest/bdk_esplora/sidebar-items.js +++ b/docs-rs/bdk/nightly/latest/bdk_esplora/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"struct":[["FullScanUpdate","Update returns from a full scan."],["SyncUpdate","Update returned from a sync."]],"trait":[["EsploraAsyncExt","Trait to extend the functionality of [`esplora_client::AsyncClient`]."],["EsploraExt","Trait to extend the functionality of [`esplora_client::BlockingClient`]."]],"type":[["Error","[`esplora_client::Error`]"]]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"trait":[["EsploraAsyncExt","Trait to extend the functionality of [`esplora_client::AsyncClient`]."],["EsploraExt","Trait to extend the functionality of [`esplora_client::BlockingClient`]."]],"type":[["Error","[`esplora_client::Error`]"]]}; \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_esplora/struct.FullScanUpdate.html b/docs-rs/bdk/nightly/latest/bdk_esplora/struct.FullScanUpdate.html deleted file mode 100644 index a5fb1a5183..0000000000 --- a/docs-rs/bdk/nightly/latest/bdk_esplora/struct.FullScanUpdate.html +++ /dev/null @@ -1,23 +0,0 @@ -FullScanUpdate in bdk_esplora - Rust
    pub struct FullScanUpdate<K> {
    -    pub local_chain: CheckPoint,
    -    pub tx_graph: TxGraph<ConfirmationTimeHeightAnchor>,
    -    pub last_active_indices: BTreeMap<K, u32>,
    -}
    Expand description

    Update returns from a full scan.

    -

    Fields§

    §local_chain: CheckPoint

    The update to apply to the receiving LocalChain.

    -
    §tx_graph: TxGraph<ConfirmationTimeHeightAnchor>

    The update to apply to the receiving [TxGraph].

    -
    §last_active_indices: BTreeMap<K, u32>

    Last active indices for the corresponding keychains (K).

    -

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    -
    Instruments this type with the provided [Span], returning an -Instrumented wrapper. Read more
    Instruments this type with the current Span, returning an -Instrumented wrapper. Read more

    Calls U::from(self).

    -

    That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

    -
    Converts self into a Left variant of Either<Self, Self> -if into_left is true. -Converts self into a Right variant of Either<Self, Self> -otherwise. Read more
    Converts self into a Left variant of Either<Self, Self> -if into_left(&self) returns true. -Converts self into a Right variant of Either<Self, Self> -otherwise. Read more
    The type returned in the event of a conversion error.
    Performs the conversion.
    The type returned in the event of a conversion error.
    Performs the conversion.
    Attaches the provided Subscriber to this type, returning a -[WithDispatch] wrapper. Read more
    Attaches the current default Subscriber to this type, returning a -[WithDispatch] wrapper. Read more
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_esplora/struct.SyncUpdate.html b/docs-rs/bdk/nightly/latest/bdk_esplora/struct.SyncUpdate.html deleted file mode 100644 index 5ccf3a45d0..0000000000 --- a/docs-rs/bdk/nightly/latest/bdk_esplora/struct.SyncUpdate.html +++ /dev/null @@ -1,21 +0,0 @@ -SyncUpdate in bdk_esplora - Rust

    Struct bdk_esplora::SyncUpdate

    source ·
    pub struct SyncUpdate {
    -    pub local_chain: CheckPoint,
    -    pub tx_graph: TxGraph<ConfirmationTimeHeightAnchor>,
    -}
    Expand description

    Update returned from a sync.

    -

    Fields§

    §local_chain: CheckPoint

    The update to apply to the receiving LocalChain.

    -
    §tx_graph: TxGraph<ConfirmationTimeHeightAnchor>

    The update to apply to the receiving [TxGraph].

    -

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    -
    Instruments this type with the provided [Span], returning an -Instrumented wrapper. Read more
    Instruments this type with the current Span, returning an -Instrumented wrapper. Read more

    Calls U::from(self).

    -

    That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

    -
    Converts self into a Left variant of Either<Self, Self> -if into_left is true. -Converts self into a Right variant of Either<Self, Self> -otherwise. Read more
    Converts self into a Left variant of Either<Self, Self> -if into_left(&self) returns true. -Converts self into a Right variant of Either<Self, Self> -otherwise. Read more
    The type returned in the event of a conversion error.
    Performs the conversion.
    The type returned in the event of a conversion error.
    Performs the conversion.
    Attaches the provided Subscriber to this type, returning a -[WithDispatch] wrapper. Read more
    Attaches the current default Subscriber to this type, returning a -[WithDispatch] wrapper. Read more
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraAsyncExt.html b/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraAsyncExt.html index 30c29b37cc..ff6d2bccdc 100644 --- a/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraAsyncExt.html +++ b/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraAsyncExt.html @@ -1,9 +1,9 @@ -EsploraAsyncExt in bdk_esplora - Rust
    pub trait EsploraAsyncExt {
    -    fn full_scan<'life0, 'async_trait, K>(
            &'life0 self,
            local_tip: CheckPoint,
            keychain_spks: BTreeMap<K, impl 'async_trait + IntoIterator<IntoIter = impl 'async_trait + Iterator<Item = (u32, ScriptBuf)> + Send> + Send>,
            stop_gap: usize,
            parallel_requests: usize
        ) -> Pin<Box<dyn Future<Output = Result<FullScanUpdate<K>, Box<Error>>> + Send + 'async_trait>>
        where
            K: 'async_trait + Ord + Clone + Send,
            Self: 'async_trait,
            'life0: 'async_trait
    ; - fn sync<'life0, 'async_trait>(
            &'life0 self,
            local_tip: CheckPoint,
            misc_spks: impl 'async_trait + IntoIterator<IntoIter = impl 'async_trait + Iterator<Item = ScriptBuf> + Send> + Send,
            txids: impl 'async_trait + IntoIterator<IntoIter = impl 'async_trait + Iterator<Item = Txid> + Send> + Send,
            outpoints: impl 'async_trait + IntoIterator<IntoIter = impl 'async_trait + Iterator<Item = OutPoint> + Send> + Send,
            parallel_requests: usize
        ) -> Pin<Box<dyn Future<Output = Result<SyncUpdate, Box<Error>>> + Send + 'async_trait>>
        where
            Self: 'async_trait,
            'life0: 'async_trait
    ; +EsploraAsyncExt in bdk_esplora - Rust
    pub trait EsploraAsyncExt {
    +    fn full_scan<'life0, 'async_trait, K>(
            &'life0 self,
            request: FullScanRequest<K>,
            stop_gap: usize,
            parallel_requests: usize
        ) -> Pin<Box<dyn Future<Output = Result<FullScanResult<K>, Box<Error>>> + Send + 'async_trait>>
        where
            K: 'async_trait + Ord + Clone + Send,
            Self: 'async_trait,
            'life0: 'async_trait
    ; + fn sync<'life0, 'async_trait>(
            &'life0 self,
            request: SyncRequest,
            parallel_requests: usize
        ) -> Pin<Box<dyn Future<Output = Result<SyncResult, Box<Error>>> + Send + 'async_trait>>
        where
            Self: 'async_trait,
            'life0: 'async_trait
    ; }
    Expand description

    Trait to extend the functionality of [esplora_client::AsyncClient].

    Refer to crate-level documentation for more.

    -

    Required Methods§

    Scan keychain scripts for transactions against Esplora, returning an update that can be +

    Required Methods§

    Scan keychain scripts for transactions against Esplora, returning an update that can be applied to the receiving structures.

    Sync a set of scripts with the blockchain (via an Esplora client) for the data +

    Sync a set of scripts with the blockchain (via an Esplora client) for the data specified and return a [TxGraph].

    If the scripts to sync are unknown, such as when restoring or importing a keychain that may include scripts that have been used, use full_scan with the keychain.

    -

    Implementations on Foreign Types§

    Implementors§

    \ No newline at end of file +

    Implementations on Foreign Types§

    Implementors§

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraExt.html b/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraExt.html index 2a464b1fa9..d2e14724cf 100644 --- a/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraExt.html +++ b/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraExt.html @@ -1,9 +1,9 @@ -EsploraExt in bdk_esplora - Rust
    pub trait EsploraExt {
    -    fn full_scan<K: Ord + Clone>(
            &self,
            local_tip: CheckPoint,
            keychain_spks: BTreeMap<K, impl IntoIterator<Item = (u32, ScriptBuf)>>,
            stop_gap: usize,
            parallel_requests: usize
        ) -> Result<FullScanUpdate<K>, Error>; - fn sync(
            &self,
            local_tip: CheckPoint,
            misc_spks: impl IntoIterator<Item = ScriptBuf>,
            txids: impl IntoIterator<Item = Txid>,
            outpoints: impl IntoIterator<Item = OutPoint>,
            parallel_requests: usize
        ) -> Result<SyncUpdate, Error>; +EsploraExt in bdk_esplora - Rust
    pub trait EsploraExt {
    +    fn full_scan<K: Ord + Clone>(
            &self,
            request: FullScanRequest<K>,
            stop_gap: usize,
            parallel_requests: usize
        ) -> Result<FullScanResult<K>, Error>; + fn sync(
            &self,
            request: SyncRequest,
            parallel_requests: usize
        ) -> Result<SyncResult, Error>; }
    Expand description

    Trait to extend the functionality of [esplora_client::BlockingClient].

    Refer to crate-level documentation for more.

    -

    Required Methods§

    Scan keychain scripts for transactions against Esplora, returning an update that can be +

    Required Methods§

    Scan keychain scripts for transactions against Esplora, returning an update that can be applied to the receiving structures.

    Sync a set of scripts with the blockchain (via an Esplora client) for the data +

    Sync a set of scripts with the blockchain (via an Esplora client) for the data specified and return a [TxGraph].

    If the scripts to sync are unknown, such as when restoring or importing a keychain that may include scripts that have been used, use full_scan with the keychain.

    -

    Implementations on Foreign Types§

    Implementors§

    \ No newline at end of file +

    Implementations on Foreign Types§

    Implementors§

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_esplora/type.Error.html b/docs-rs/bdk/nightly/latest/bdk_esplora/type.Error.html index a3d60b3012..384570dd78 100644 --- a/docs-rs/bdk/nightly/latest/bdk_esplora/type.Error.html +++ b/docs-rs/bdk/nightly/latest/bdk_esplora/type.Error.html @@ -1,2 +1,2 @@ -Error in bdk_esplora - Rust

    Type Definition bdk_esplora::Error

    source ·
    pub type Error = Box<Error>;
    Expand description

    [esplora_client::Error]

    +Error in bdk_esplora - Rust

    Type Definition bdk_esplora::Error

    source ·
    pub type Error = Box<Error>;
    Expand description

    [esplora_client::Error]

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_esplora/constant.DB_MAGIC.html b/docs-rs/bdk/nightly/latest/example_esplora/constant.DB_MAGIC.html index d3330c5fe2..86675b1f1f 100644 --- a/docs-rs/bdk/nightly/latest/example_esplora/constant.DB_MAGIC.html +++ b/docs-rs/bdk/nightly/latest/example_esplora/constant.DB_MAGIC.html @@ -1 +1 @@ -DB_MAGIC in example_esplora - Rust

    Constant example_esplora::DB_MAGIC

    source ·
    pub(crate) const DB_MAGIC: &[u8] = b"bdk_example_esplora";
    \ No newline at end of file +DB_MAGIC in example_esplora - Rust

    Constant example_esplora::DB_MAGIC

    source ·
    pub(crate) const DB_MAGIC: &[u8] = b"bdk_example_esplora";
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_esplora/constant.DB_PATH.html b/docs-rs/bdk/nightly/latest/example_esplora/constant.DB_PATH.html index 3aa129ebee..967ad25090 100644 --- a/docs-rs/bdk/nightly/latest/example_esplora/constant.DB_PATH.html +++ b/docs-rs/bdk/nightly/latest/example_esplora/constant.DB_PATH.html @@ -1 +1 @@ -DB_PATH in example_esplora - Rust

    Constant example_esplora::DB_PATH

    source ·
    pub(crate) const DB_PATH: &str = ".bdk_esplora_example.db";
    \ No newline at end of file +DB_PATH in example_esplora - Rust

    Constant example_esplora::DB_PATH

    source ·
    pub(crate) const DB_PATH: &str = ".bdk_esplora_example.db";
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_esplora/enum.EsploraCommands.html b/docs-rs/bdk/nightly/latest/example_esplora/enum.EsploraCommands.html index 17673e24df..68f09aed04 100644 --- a/docs-rs/bdk/nightly/latest/example_esplora/enum.EsploraCommands.html +++ b/docs-rs/bdk/nightly/latest/example_esplora/enum.EsploraCommands.html @@ -1,4 +1,4 @@ -EsploraCommands in example_esplora - Rust
    pub(crate) enum EsploraCommands {
    +EsploraCommands in example_esplora - Rust
    pub(crate) enum EsploraCommands {
         Scan {
             stop_gap: usize,
             scan_options: ScanOptions,
    @@ -19,7 +19,7 @@
     
    §utxos: bool

    Scan unspent outpoints for spends or changes to confirmation status of residing tx.

    §unconfirmed: bool

    Scan unconfirmed transactions for updates.

    §scan_options: ScanOptions
    §esplora_args: EsploraArgs

    Scan for particular addresses and unconfirmed transactions using the esplora API.

    -

    Implementations§

    Trait Implementations§

    Returns a copy of the value. Read more
    Performs copy-assignment from source. Read more
    Formats the value using the given formatter. Read more
    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    Assign values from ArgMatches to self.
    Assign values from ArgMatches to self.
    Append to [Command] so it can instantiate Self. Read more
    Append to [Command] so it can update self. Read more
    Test whether Self can parse a specific subcommand

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +

    Implementations§

    Trait Implementations§

    Returns a copy of the value. Read more
    Performs copy-assignment from source. Read more
    Formats the value using the given formatter. Read more
    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    Assign values from ArgMatches to self.
    Assign values from ArgMatches to self.
    Append to [Command] so it can instantiate Self. Read more
    Append to [Command] so it can update self. Read more
    Test whether Self can parse a specific subcommand

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
    Instruments this type with the current Span, returning an Instrumented wrapper. Read more

    Calls U::from(self).

    diff --git a/docs-rs/bdk/nightly/latest/example_esplora/fn.main.html b/docs-rs/bdk/nightly/latest/example_esplora/fn.main.html index 013706d2fc..a2dfe6cf85 100644 --- a/docs-rs/bdk/nightly/latest/example_esplora/fn.main.html +++ b/docs-rs/bdk/nightly/latest/example_esplora/fn.main.html @@ -1 +1 @@ -main in example_esplora - Rust

    Function example_esplora::main

    source ·
    pub(crate) fn main() -> Result<()>
    \ No newline at end of file +main in example_esplora - Rust

    Function example_esplora::main

    source ·
    pub(crate) fn main() -> Result<()>
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_esplora/index.html b/docs-rs/bdk/nightly/latest/example_esplora/index.html index e3c179c4c6..393d46d1ec 100644 --- a/docs-rs/bdk/nightly/latest/example_esplora/index.html +++ b/docs-rs/bdk/nightly/latest/example_esplora/index.html @@ -1 +1 @@ -example_esplora - Rust
    \ No newline at end of file +example_esplora - Rust
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_esplora/struct.EsploraArgs.html b/docs-rs/bdk/nightly/latest/example_esplora/struct.EsploraArgs.html index 63061aeab4..c4763cbd1b 100644 --- a/docs-rs/bdk/nightly/latest/example_esplora/struct.EsploraArgs.html +++ b/docs-rs/bdk/nightly/latest/example_esplora/struct.EsploraArgs.html @@ -1,8 +1,8 @@ -EsploraArgs in example_esplora - Rust
    pub struct EsploraArgs {
    +EsploraArgs in example_esplora - Rust
    pub struct EsploraArgs {
         pub(crate) esplora_url: Option<String>,
     }

    Fields§

    §esplora_url: Option<String>

    The esplora url endpoint to connect to e.g. <https://blockstream.info/api> If not provided it’ll be set to a default for the network provided

    -

    Implementations§

    Trait Implementations§

    Append to [Command] so it can instantiate Self. Read more
    Append to [Command] so it can update self. Read more
    Returns a copy of the value. Read more
    Performs copy-assignment from source. Read more
    Formats the value using the given formatter. Read more
    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    Assign values from ArgMatches to self.
    Assign values from ArgMatches to self.

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +

    Implementations§

    Trait Implementations§

    Append to [Command] so it can instantiate Self. Read more
    Append to [Command] so it can update self. Read more
    Returns a copy of the value. Read more
    Performs copy-assignment from source. Read more
    Formats the value using the given formatter. Read more
    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    Assign values from ArgMatches to self.
    Assign values from ArgMatches to self.

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
    Instruments this type with the current Span, returning an Instrumented wrapper. Read more

    Calls U::from(self).

    diff --git a/docs-rs/bdk/nightly/latest/example_esplora/struct.ScanOptions.html b/docs-rs/bdk/nightly/latest/example_esplora/struct.ScanOptions.html index deb17bf78c..e35146c5ad 100644 --- a/docs-rs/bdk/nightly/latest/example_esplora/struct.ScanOptions.html +++ b/docs-rs/bdk/nightly/latest/example_esplora/struct.ScanOptions.html @@ -1,9 +1,9 @@ -ScanOptions in example_esplora - Rust
    pub struct ScanOptions {
    +ScanOptions in example_esplora - Rust
    pub struct ScanOptions {
         pub parallel_requests: usize,
     }

    Fields§

    §parallel_requests: usize

    Max number of concurrent esplora server requests.

    -

    Trait Implementations§

    Append to [Command] so it can instantiate Self. Read more
    Append to [Command] so it can update self. Read more
    Returns a copy of the value. Read more
    Performs copy-assignment from source. Read more
    Deprecated, replaced with CommandFactory::command
    Deprecated, replaced with CommandFactory::command_for_update
    Build a [Command] that can instantiate Self. Read more
    Build a [Command] that can update self. Read more
    Formats the value using the given formatter. Read more
    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    Assign values from ArgMatches to self.
    Assign values from ArgMatches to self.
    Parse from std::env::args_os(), exit on error
    Parse from std::env::args_os(), return Err on error.
    Parse from iterator, exit on error
    Parse from iterator, return Err on error.
    Update from iterator, exit on error
    Update from iterator, return Err on error.
    This method tests for self and other values to be equal, and is used +

    Trait Implementations§

    Append to [Command] so it can instantiate Self. Read more
    Append to [Command] so it can update self. Read more
    Returns a copy of the value. Read more
    Performs copy-assignment from source. Read more
    Deprecated, replaced with CommandFactory::command
    Deprecated, replaced with CommandFactory::command_for_update
    Build a [Command] that can instantiate Self. Read more
    Build a [Command] that can update self. Read more
    Formats the value using the given formatter. Read more
    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    Assign values from ArgMatches to self.
    Assign values from ArgMatches to self.
    Parse from std::env::args_os(), exit on error
    Parse from std::env::args_os(), return Err on error.
    Parse from iterator, exit on error
    Parse from iterator, return Err on error.
    Update from iterator, exit on error
    Update from iterator, return Err on error.
    This method tests for self and other values to be equal, and is used by ==. Read more
    This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    +sufficient, and should not be overridden without very good reason. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Gets the TypeId of self. Read more
    Immutably borrows from an owned value. Read more
    Mutably borrows from an owned value. Read more

    Returns the argument unchanged.

    Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
    Instruments this type with the current Span, returning an Instrumented wrapper. Read more

    Calls U::from(self).

    diff --git a/docs-rs/bdk/nightly/latest/example_esplora/type.ChangeSet.html b/docs-rs/bdk/nightly/latest/example_esplora/type.ChangeSet.html index 17a9a772b4..6e45f6925b 100644 --- a/docs-rs/bdk/nightly/latest/example_esplora/type.ChangeSet.html +++ b/docs-rs/bdk/nightly/latest/example_esplora/type.ChangeSet.html @@ -1 +1 @@ -ChangeSet in example_esplora - Rust

    Type Definition example_esplora::ChangeSet

    source ·
    pub(crate) type ChangeSet = (ChangeSet, ChangeSet<ConfirmationTimeHeightAnchor, ChangeSet<Keychain>>);
    \ No newline at end of file +ChangeSet in example_esplora - Rust

    Type Definition example_esplora::ChangeSet

    source ·
    pub(crate) type ChangeSet = (ChangeSet, ChangeSet<ConfirmationTimeHeightAnchor, ChangeSet<Keychain>>);
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/implementors/core/convert/trait.From.js b/docs-rs/bdk/nightly/latest/implementors/core/convert/trait.From.js index 1df93a1b35..06e27d8ef3 100644 --- a/docs-rs/bdk/nightly/latest/implementors/core/convert/trait.From.js +++ b/docs-rs/bdk/nightly/latest/implementors/core/convert/trait.From.js @@ -1,5 +1,5 @@ (function() {var implementors = { -"bdk":[["impl From<KeyError> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<HexToBytesError> for Error"],["impl From<PolicyError> for Error"],["impl From<bool> for Satisfaction"],["impl From<SatisfiableItem> for Policy"],["impl<Ctx: ScriptContext> From<Xpub> for ExtendedKey<Ctx>"],["impl<Ctx: ScriptContext> From<Xpriv> for ExtendedKey<Ctx>"],["impl From<Error> for KeyError"],["impl From<Error> for KeyError"],["impl From<Hash> for SignerId"],["impl From<Fingerprint> for SignerId"],["impl From<Error> for SignerError"],["impl From<Error> for CreateTxError"],["impl From<PolicyError> for CreateTxError"],["impl From<MiniscriptPsbtError> for CreateTxError"],["impl From<Error> for CreateTxError"],["impl From<Error> for CreateTxError"],["impl From<BTreeMap<u32, Option<BlockHash>, Global>> for ChangeSet"],["impl From<ChangeSet<ConfirmationTimeHeightAnchor, ChangeSet<KeychainKind>>> for ChangeSet"]], +"bdk":[["impl From<KeyError> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<HexToBytesError> for Error"],["impl From<PolicyError> for Error"],["impl From<bool> for Satisfaction"],["impl From<SatisfiableItem> for Policy"],["impl<Ctx: ScriptContext> From<Xpub> for ExtendedKey<Ctx>"],["impl<Ctx: ScriptContext> From<Xpriv> for ExtendedKey<Ctx>"],["impl From<Error> for KeyError"],["impl From<Error> for KeyError"],["impl From<Hash> for SignerId"],["impl From<Fingerprint> for SignerId"],["impl From<Error> for SignerError"],["impl From<Error> for CreateTxError"],["impl From<PolicyError> for CreateTxError"],["impl From<MiniscriptPsbtError> for CreateTxError"],["impl From<Error> for CreateTxError"],["impl From<Error> for CreateTxError"],["impl From<FullScanResult<KeychainKind>> for Update"],["impl From<SyncResult<ConfirmationTimeHeightAnchor>> for Update"],["impl From<BTreeMap<u32, Option<BlockHash>, Global>> for ChangeSet"],["impl From<ChangeSet<ConfirmationTimeHeightAnchor, ChangeSet<KeychainKind>>> for ChangeSet"]], "bdk_chain":[["impl From<ChainPosition<ConfirmationTimeHeightAnchor>> for ConfirmationTime"],["impl From<(u32, BlockHash)> for BlockId"],["impl From<BlockId> for (u32, BlockHash)"],["impl From<(&u32, &BlockHash)> for BlockId"],["impl<A, IA: Default> From<ChangeSet<A>> for ChangeSet<A, IA>"],["impl<A, K> From<ChangeSet<K>> for ChangeSet<A, ChangeSet<K>>"]], "bdk_coin_select":[["impl From<usize> for BnbLimit"],["impl From<Duration> for BnbLimit"]], "bdk_file_store":[["impl From<Error> for IterError"],["impl From<Error> for FileError"]], diff --git a/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Freeze.js b/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Freeze.js index 8f3def699e..eba2e9eb9d 100644 --- a/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Freeze.js +++ b/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Freeze.js @@ -1,10 +1,9 @@ (function() {var implementors = { "bdk":[["impl Freeze for Error",1,["bdk::descriptor::error::Error"]],["impl Freeze for PkOrF",1,["bdk::descriptor::policy::PkOrF"]],["impl Freeze for SatisfiableItem",1,["bdk::descriptor::policy::SatisfiableItem"]],["impl Freeze for Satisfaction",1,["bdk::descriptor::policy::Satisfaction"]],["impl Freeze for Policy",1,["bdk::descriptor::policy::Policy"]],["impl Freeze for Condition",1,["bdk::descriptor::policy::Condition"]],["impl Freeze for PolicyError",1,["bdk::descriptor::policy::PolicyError"]],["impl<'a> Freeze for BuildSatisfaction<'a>",1,["bdk::descriptor::policy::BuildSatisfaction"]],["impl<K> Freeze for P2Pkh<K>where
        K: Freeze,
    ",1,["bdk::descriptor::template::P2Pkh"]],["impl<K> Freeze for P2Wpkh_P2Sh<K>where
        K: Freeze,
    ",1,["bdk::descriptor::template::P2Wpkh_P2Sh"]],["impl<K> Freeze for P2Wpkh<K>where
        K: Freeze,
    ",1,["bdk::descriptor::template::P2Wpkh"]],["impl<K> Freeze for P2TR<K>where
        K: Freeze,
    ",1,["bdk::descriptor::template::P2TR"]],["impl<K> Freeze for Bip44<K>where
        K: Freeze,
    ",1,["bdk::descriptor::template::Bip44"]],["impl<K> Freeze for Bip44Public<K>where
        K: Freeze,
    ",1,["bdk::descriptor::template::Bip44Public"]],["impl<K> Freeze for Bip49<K>where
        K: Freeze,
    ",1,["bdk::descriptor::template::Bip49"]],["impl<K> Freeze for Bip49Public<K>where
        K: Freeze,
    ",1,["bdk::descriptor::template::Bip49Public"]],["impl<K> Freeze for Bip84<K>where
        K: Freeze,
    ",1,["bdk::descriptor::template::Bip84"]],["impl<K> Freeze for Bip84Public<K>where
        K: Freeze,
    ",1,["bdk::descriptor::template::Bip84Public"]],["impl<K> Freeze for Bip86<K>where
        K: Freeze,
    ",1,["bdk::descriptor::template::Bip86"]],["impl<K> Freeze for Bip86Public<K>where
        K: Freeze,
    ",1,["bdk::descriptor::template::Bip86Public"]],["impl<Ctx> Freeze for DescriptorKey<Ctx>",1,["bdk::keys::DescriptorKey"]],["impl Freeze for ScriptContextEnum",1,["bdk::keys::ScriptContextEnum"]],["impl<Ctx> Freeze for ExtendedKey<Ctx>",1,["bdk::keys::ExtendedKey"]],["impl<K, Ctx> Freeze for GeneratedKey<K, Ctx>where
        K: Freeze,
    ",1,["bdk::keys::GeneratedKey"]],["impl Freeze for PrivateKeyGenerateOptions",1,["bdk::keys::PrivateKeyGenerateOptions"]],["impl Freeze for KeyError",1,["bdk::keys::KeyError"]],["impl Freeze for KeychainKind",1,["bdk::types::KeychainKind"]],["impl Freeze for LocalOutput",1,["bdk::types::LocalOutput"]],["impl Freeze for WeightedUtxo",1,["bdk::types::WeightedUtxo"]],["impl Freeze for Utxo",1,["bdk::types::Utxo"]],["impl Freeze for Error",1,["bdk::wallet::coin_selection::Error"]],["impl Freeze for Excess",1,["bdk::wallet::coin_selection::Excess"]],["impl Freeze for CoinSelectionResult",1,["bdk::wallet::coin_selection::CoinSelectionResult"]],["impl Freeze for LargestFirstCoinSelection",1,["bdk::wallet::coin_selection::LargestFirstCoinSelection"]],["impl Freeze for OldestFirstCoinSelection",1,["bdk::wallet::coin_selection::OldestFirstCoinSelection"]],["impl Freeze for BranchAndBoundCoinSelection",1,["bdk::wallet::coin_selection::BranchAndBoundCoinSelection"]],["impl Freeze for FullyNodedExport",1,["bdk::wallet::export::FullyNodedExport"]],["impl Freeze for SignerId",1,["bdk::wallet::signer::SignerId"]],["impl Freeze for SignerError",1,["bdk::wallet::signer::SignerError"]],["impl Freeze for SignerContext",1,["bdk::wallet::signer::SignerContext"]],["impl<S> Freeze for SignerWrapper<S>where
        S: Freeze,
    ",1,["bdk::wallet::signer::SignerWrapper"]],["impl Freeze for SignerOrdering",1,["bdk::wallet::signer::SignerOrdering"]],["impl Freeze for SignersContainer",1,["bdk::wallet::signer::SignersContainer"]],["impl Freeze for SignOptions",1,["bdk::wallet::signer::SignOptions"]],["impl Freeze for TapLeavesOptions",1,["bdk::wallet::signer::TapLeavesOptions"]],["impl Freeze for CreateTx",1,["bdk::wallet::tx_builder::CreateTx"]],["impl Freeze for BumpFee",1,["bdk::wallet::tx_builder::BumpFee"]],["impl<'a, Cs, Ctx> Freeze for TxBuilder<'a, Cs, Ctx>where
        Cs: Freeze,
    ",1,["bdk::wallet::tx_builder::TxBuilder"]],["impl Freeze for AddUtxoError",1,["bdk::wallet::tx_builder::AddUtxoError"]],["impl Freeze for AddForeignUtxoError",1,["bdk::wallet::tx_builder::AddForeignUtxoError"]],["impl Freeze for AllowShrinkingError",1,["bdk::wallet::tx_builder::AllowShrinkingError"]],["impl Freeze for TxOrdering",1,["bdk::wallet::tx_builder::TxOrdering"]],["impl Freeze for ChangeSpendPolicy",1,["bdk::wallet::tx_builder::ChangeSpendPolicy"]],["impl Freeze for MiniscriptPsbtError",1,["bdk::wallet::error::MiniscriptPsbtError"]],["impl Freeze for CreateTxError",1,["bdk::wallet::error::CreateTxError"]],["impl Freeze for BuildFeeBumpError",1,["bdk::wallet::error::BuildFeeBumpError"]],["impl Freeze for Wallet",1,["bdk::wallet::Wallet"]],["impl Freeze for Update",1,["bdk::wallet::Update"]],["impl Freeze for ChangeSet",1,["bdk::wallet::ChangeSet"]],["impl Freeze for AddressInfo",1,["bdk::wallet::AddressInfo"]],["impl Freeze for NewError",1,["bdk::wallet::NewError"]],["impl Freeze for LoadError",1,["bdk::wallet::LoadError"]],["impl Freeze for NewOrLoadError",1,["bdk::wallet::NewOrLoadError"]],["impl Freeze for InsertTxError",1,["bdk::wallet::InsertTxError"]],["impl Freeze for ApplyBlockError",1,["bdk::wallet::ApplyBlockError"]]], "bdk_bitcoind_rpc":[["impl<'c, C> Freeze for Emitter<'c, C>",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> Freeze for BlockEvent<B>where
        B: Freeze,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], -"bdk_chain":[["impl<I> Freeze for SpkTxOutIndex<I>",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<A> Freeze for ChainPosition<A>where
        A: Freeze,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl Freeze for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Freeze for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Freeze for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Freeze for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl<A> Freeze for FullTxOut<A>where
        A: Freeze,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A, I> Freeze for IndexedTxGraph<A, I>where
        I: Freeze,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Freeze for ChangeSet<A, IA>where
        IA: Freeze,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<K> Freeze for KeychainTxOutIndex<K>",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Freeze for ChangeSet<K>",1,["bdk_chain::keychain::ChangeSet"]],["impl Freeze for Balance",1,["bdk_chain::keychain::Balance"]],["impl Freeze for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Freeze for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Freeze for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Freeze for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Freeze for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Freeze for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Freeze for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl<A> Freeze for TxGraph<A>",1,["bdk_chain::tx_graph::TxGraph"]],["impl<'a, T, A> Freeze for TxNode<'a, T, A>where
        T: Freeze,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'a, T, A> Freeze for CanonicalTx<'a, T, A>where
        T: Freeze,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl Freeze for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl<A> Freeze for ChangeSet<A>",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<'g, A, F> Freeze for TxAncestors<'g, A, F>where
        F: Freeze,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Freeze for TxDescendants<'g, A, F>where
        F: Freeze,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<D> Freeze for SpkIterator<D>where
        D: Freeze,
    ",1,["bdk_chain::spk_iter::SpkIterator"]]], +"bdk_chain":[["impl<I> Freeze for SpkTxOutIndex<I>",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<A> Freeze for ChainPosition<A>where
        A: Freeze,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl Freeze for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Freeze for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Freeze for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Freeze for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl<A> Freeze for FullTxOut<A>where
        A: Freeze,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A, I> Freeze for IndexedTxGraph<A, I>where
        I: Freeze,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Freeze for ChangeSet<A, IA>where
        IA: Freeze,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<K> Freeze for KeychainTxOutIndex<K>",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Freeze for ChangeSet<K>",1,["bdk_chain::keychain::ChangeSet"]],["impl Freeze for Balance",1,["bdk_chain::keychain::Balance"]],["impl Freeze for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Freeze for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Freeze for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Freeze for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Freeze for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Freeze for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Freeze for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl<A> Freeze for TxGraph<A>",1,["bdk_chain::tx_graph::TxGraph"]],["impl<'a, T, A> Freeze for TxNode<'a, T, A>where
        T: Freeze,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'a, T, A> Freeze for CanonicalTx<'a, T, A>where
        T: Freeze,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl Freeze for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl<A> Freeze for ChangeSet<A>",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<'g, A, F> Freeze for TxAncestors<'g, A, F>where
        F: Freeze,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Freeze for TxDescendants<'g, A, F>where
        F: Freeze,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<D> Freeze for SpkIterator<D>where
        D: Freeze,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl Freeze for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl<A> Freeze for SyncResult<A>",1,["bdk_chain::spk_client::SyncResult"]],["impl<K> Freeze for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> Freeze for FullScanResult<K>",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl Freeze for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl Freeze for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl<'a> Freeze for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl Freeze for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl Freeze for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl Freeze for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl Freeze for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl Freeze for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl Freeze for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl<'c, S> Freeze for Bnb<'c, S>where
        S: Freeze,
    ",1,["bdk_coin_select::bnb::Bnb"]],["impl<'c, 'f, S> Freeze for BnbIter<'c, 'f, S>where
        S: Freeze,
    ",1,["bdk_coin_select::bnb::BnbIter"]],["impl Freeze for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]]], "bdk_electrum":[["impl Freeze for RelevantTxids",1,["bdk_electrum::electrum_ext::RelevantTxids"]],["impl Freeze for ElectrumUpdate",1,["bdk_electrum::electrum_ext::ElectrumUpdate"]]], -"bdk_esplora":[["impl<K> Freeze for FullScanUpdate<K>",1,["bdk_esplora::FullScanUpdate"]],["impl Freeze for SyncUpdate",1,["bdk_esplora::SyncUpdate"]]], "bdk_file_store":[["impl<'t, T> Freeze for EntryIter<'t, T>",1,["bdk_file_store::entry_iter::EntryIter"]],["impl Freeze for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<C> Freeze for Store<C>",1,["bdk_file_store::store::Store"]],["impl<C> Freeze for AggregateChangesetsError<C>where
        C: Freeze,
    ",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl Freeze for FileError",1,["bdk_file_store::FileError"]]], "bdk_hwi":[["impl Freeze for HWISigner",1,["bdk_hwi::signer::HWISigner"]]], "bdk_persist":[["impl<C> Freeze for Persist<C>where
        C: Freeze,
    ",1,["bdk_persist::persist::Persist"]]], diff --git a/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Send.js b/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Send.js index c89dbccb70..373c3a153f 100644 --- a/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Send.js +++ b/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Send.js @@ -1,10 +1,9 @@ (function() {var implementors = { "bdk":[["impl Send for Error",1,["bdk::descriptor::error::Error"]],["impl Send for PkOrF",1,["bdk::descriptor::policy::PkOrF"]],["impl Send for SatisfiableItem",1,["bdk::descriptor::policy::SatisfiableItem"]],["impl Send for Satisfaction",1,["bdk::descriptor::policy::Satisfaction"]],["impl Send for Policy",1,["bdk::descriptor::policy::Policy"]],["impl Send for Condition",1,["bdk::descriptor::policy::Condition"]],["impl Send for PolicyError",1,["bdk::descriptor::policy::PolicyError"]],["impl<'a> Send for BuildSatisfaction<'a>",1,["bdk::descriptor::policy::BuildSatisfaction"]],["impl<K> Send for P2Pkh<K>where
        K: Send,
    ",1,["bdk::descriptor::template::P2Pkh"]],["impl<K> Send for P2Wpkh_P2Sh<K>where
        K: Send,
    ",1,["bdk::descriptor::template::P2Wpkh_P2Sh"]],["impl<K> Send for P2Wpkh<K>where
        K: Send,
    ",1,["bdk::descriptor::template::P2Wpkh"]],["impl<K> Send for P2TR<K>where
        K: Send,
    ",1,["bdk::descriptor::template::P2TR"]],["impl<K> Send for Bip44<K>where
        K: Send,
    ",1,["bdk::descriptor::template::Bip44"]],["impl<K> Send for Bip44Public<K>where
        K: Send,
    ",1,["bdk::descriptor::template::Bip44Public"]],["impl<K> Send for Bip49<K>where
        K: Send,
    ",1,["bdk::descriptor::template::Bip49"]],["impl<K> Send for Bip49Public<K>where
        K: Send,
    ",1,["bdk::descriptor::template::Bip49Public"]],["impl<K> Send for Bip84<K>where
        K: Send,
    ",1,["bdk::descriptor::template::Bip84"]],["impl<K> Send for Bip84Public<K>where
        K: Send,
    ",1,["bdk::descriptor::template::Bip84Public"]],["impl<K> Send for Bip86<K>where
        K: Send,
    ",1,["bdk::descriptor::template::Bip86"]],["impl<K> Send for Bip86Public<K>where
        K: Send,
    ",1,["bdk::descriptor::template::Bip86Public"]],["impl<Ctx> Send for DescriptorKey<Ctx>where
        Ctx: Send,
    ",1,["bdk::keys::DescriptorKey"]],["impl Send for ScriptContextEnum",1,["bdk::keys::ScriptContextEnum"]],["impl<Ctx> Send for ExtendedKey<Ctx>where
        Ctx: Send,
    ",1,["bdk::keys::ExtendedKey"]],["impl<K, Ctx> Send for GeneratedKey<K, Ctx>where
        Ctx: Send,
        K: Send,
    ",1,["bdk::keys::GeneratedKey"]],["impl Send for PrivateKeyGenerateOptions",1,["bdk::keys::PrivateKeyGenerateOptions"]],["impl Send for KeyError",1,["bdk::keys::KeyError"]],["impl Send for KeychainKind",1,["bdk::types::KeychainKind"]],["impl Send for LocalOutput",1,["bdk::types::LocalOutput"]],["impl Send for WeightedUtxo",1,["bdk::types::WeightedUtxo"]],["impl Send for Utxo",1,["bdk::types::Utxo"]],["impl Send for Error",1,["bdk::wallet::coin_selection::Error"]],["impl Send for Excess",1,["bdk::wallet::coin_selection::Excess"]],["impl Send for CoinSelectionResult",1,["bdk::wallet::coin_selection::CoinSelectionResult"]],["impl Send for LargestFirstCoinSelection",1,["bdk::wallet::coin_selection::LargestFirstCoinSelection"]],["impl Send for OldestFirstCoinSelection",1,["bdk::wallet::coin_selection::OldestFirstCoinSelection"]],["impl Send for BranchAndBoundCoinSelection",1,["bdk::wallet::coin_selection::BranchAndBoundCoinSelection"]],["impl Send for FullyNodedExport",1,["bdk::wallet::export::FullyNodedExport"]],["impl Send for SignerId",1,["bdk::wallet::signer::SignerId"]],["impl Send for SignerError",1,["bdk::wallet::signer::SignerError"]],["impl Send for SignerContext",1,["bdk::wallet::signer::SignerContext"]],["impl<S> Send for SignerWrapper<S>where
        S: Send,
    ",1,["bdk::wallet::signer::SignerWrapper"]],["impl Send for SignerOrdering",1,["bdk::wallet::signer::SignerOrdering"]],["impl Send for SignersContainer",1,["bdk::wallet::signer::SignersContainer"]],["impl Send for SignOptions",1,["bdk::wallet::signer::SignOptions"]],["impl Send for TapLeavesOptions",1,["bdk::wallet::signer::TapLeavesOptions"]],["impl Send for CreateTx",1,["bdk::wallet::tx_builder::CreateTx"]],["impl Send for BumpFee",1,["bdk::wallet::tx_builder::BumpFee"]],["impl<'a, Cs, Ctx> !Send for TxBuilder<'a, Cs, Ctx>",1,["bdk::wallet::tx_builder::TxBuilder"]],["impl Send for AddUtxoError",1,["bdk::wallet::tx_builder::AddUtxoError"]],["impl Send for AddForeignUtxoError",1,["bdk::wallet::tx_builder::AddForeignUtxoError"]],["impl Send for AllowShrinkingError",1,["bdk::wallet::tx_builder::AllowShrinkingError"]],["impl Send for TxOrdering",1,["bdk::wallet::tx_builder::TxOrdering"]],["impl Send for ChangeSpendPolicy",1,["bdk::wallet::tx_builder::ChangeSpendPolicy"]],["impl Send for MiniscriptPsbtError",1,["bdk::wallet::error::MiniscriptPsbtError"]],["impl Send for CreateTxError",1,["bdk::wallet::error::CreateTxError"]],["impl Send for BuildFeeBumpError",1,["bdk::wallet::error::BuildFeeBumpError"]],["impl Send for Wallet",1,["bdk::wallet::Wallet"]],["impl Send for Update",1,["bdk::wallet::Update"]],["impl Send for ChangeSet",1,["bdk::wallet::ChangeSet"]],["impl Send for AddressInfo",1,["bdk::wallet::AddressInfo"]],["impl Send for NewError",1,["bdk::wallet::NewError"]],["impl Send for LoadError",1,["bdk::wallet::LoadError"]],["impl Send for NewOrLoadError",1,["bdk::wallet::NewOrLoadError"]],["impl Send for InsertTxError",1,["bdk::wallet::InsertTxError"]],["impl Send for ApplyBlockError",1,["bdk::wallet::ApplyBlockError"]]], "bdk_bitcoind_rpc":[["impl<'c, C> Send for Emitter<'c, C>where
        C: Sync,
    ",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> Send for BlockEvent<B>where
        B: Send,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], -"bdk_chain":[["impl<I> Send for SpkTxOutIndex<I>where
        I: Send,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<A> Send for ChainPosition<A>where
        A: Send,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl Send for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Send for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Send for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Send for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl<A> Send for FullTxOut<A>where
        A: Send,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A, I> Send for IndexedTxGraph<A, I>where
        A: Send,
        I: Send,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Send for ChangeSet<A, IA>where
        A: Send,
        IA: Send,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<K> Send for KeychainTxOutIndex<K>where
        K: Send,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Send for ChangeSet<K>where
        K: Send,
    ",1,["bdk_chain::keychain::ChangeSet"]],["impl Send for Balance",1,["bdk_chain::keychain::Balance"]],["impl Send for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Send for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Send for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Send for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Send for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Send for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Send for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl<A> Send for TxGraph<A>where
        A: Send,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<'a, T, A> Send for TxNode<'a, T, A>where
        A: Sync,
        T: Send,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'a, T, A> Send for CanonicalTx<'a, T, A>where
        A: Sync,
        T: Send,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl Send for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl<A> Send for ChangeSet<A>where
        A: Send,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<'g, A, F> Send for TxAncestors<'g, A, F>where
        A: Sync,
        F: Send,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Send for TxDescendants<'g, A, F>where
        A: Sync,
        F: Send,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<D> Send for SpkIterator<D>where
        D: Send,
    ",1,["bdk_chain::spk_iter::SpkIterator"]]], +"bdk_chain":[["impl<I> Send for SpkTxOutIndex<I>where
        I: Send,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<A> Send for ChainPosition<A>where
        A: Send,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl Send for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Send for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Send for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Send for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl<A> Send for FullTxOut<A>where
        A: Send,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A, I> Send for IndexedTxGraph<A, I>where
        A: Send,
        I: Send,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Send for ChangeSet<A, IA>where
        A: Send,
        IA: Send,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<K> Send for KeychainTxOutIndex<K>where
        K: Send,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Send for ChangeSet<K>where
        K: Send,
    ",1,["bdk_chain::keychain::ChangeSet"]],["impl Send for Balance",1,["bdk_chain::keychain::Balance"]],["impl Send for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Send for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Send for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Send for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Send for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Send for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Send for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl<A> Send for TxGraph<A>where
        A: Send,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<'a, T, A> Send for TxNode<'a, T, A>where
        A: Sync,
        T: Send,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'a, T, A> Send for CanonicalTx<'a, T, A>where
        A: Sync,
        T: Send,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl Send for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl<A> Send for ChangeSet<A>where
        A: Send,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<'g, A, F> Send for TxAncestors<'g, A, F>where
        A: Sync,
        F: Send,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Send for TxDescendants<'g, A, F>where
        A: Sync,
        F: Send,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<D> Send for SpkIterator<D>where
        D: Send,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl Send for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl<A> Send for SyncResult<A>where
        A: Send,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<K> Send for FullScanRequest<K>where
        K: Send,
    ",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> Send for FullScanResult<K>where
        K: Send,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl Send for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl Send for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl<'a> Send for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl Send for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl Send for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl Send for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl Send for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl Send for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl Send for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl<'c, S> Send for Bnb<'c, S>where
        S: Send,
    ",1,["bdk_coin_select::bnb::Bnb"]],["impl<'c, 'f, S> !Send for BnbIter<'c, 'f, S>",1,["bdk_coin_select::bnb::BnbIter"]],["impl Send for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]]], "bdk_electrum":[["impl Send for RelevantTxids",1,["bdk_electrum::electrum_ext::RelevantTxids"]],["impl Send for ElectrumUpdate",1,["bdk_electrum::electrum_ext::ElectrumUpdate"]]], -"bdk_esplora":[["impl<K> Send for FullScanUpdate<K>where
        K: Send,
    ",1,["bdk_esplora::FullScanUpdate"]],["impl Send for SyncUpdate",1,["bdk_esplora::SyncUpdate"]]], "bdk_file_store":[["impl<'t, T> Send for EntryIter<'t, T>where
        T: Send,
    ",1,["bdk_file_store::entry_iter::EntryIter"]],["impl Send for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<C> Send for Store<C>",1,["bdk_file_store::store::Store"]],["impl<C> Send for AggregateChangesetsError<C>where
        C: Send,
    ",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl Send for FileError",1,["bdk_file_store::FileError"]]], "bdk_hwi":[["impl Send for HWISigner",1,["bdk_hwi::signer::HWISigner"]]], "bdk_persist":[["impl<C> Send for Persist<C>where
        C: Send,
    ",1,["bdk_persist::persist::Persist"]]], diff --git a/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Sync.js b/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Sync.js index 0ea0c63a90..85278dde73 100644 --- a/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Sync.js +++ b/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Sync.js @@ -1,10 +1,9 @@ (function() {var implementors = { "bdk":[["impl Sync for Error",1,["bdk::descriptor::error::Error"]],["impl Sync for PkOrF",1,["bdk::descriptor::policy::PkOrF"]],["impl Sync for SatisfiableItem",1,["bdk::descriptor::policy::SatisfiableItem"]],["impl Sync for Satisfaction",1,["bdk::descriptor::policy::Satisfaction"]],["impl Sync for Policy",1,["bdk::descriptor::policy::Policy"]],["impl Sync for Condition",1,["bdk::descriptor::policy::Condition"]],["impl Sync for PolicyError",1,["bdk::descriptor::policy::PolicyError"]],["impl<'a> Sync for BuildSatisfaction<'a>",1,["bdk::descriptor::policy::BuildSatisfaction"]],["impl<K> Sync for P2Pkh<K>where
        K: Sync,
    ",1,["bdk::descriptor::template::P2Pkh"]],["impl<K> Sync for P2Wpkh_P2Sh<K>where
        K: Sync,
    ",1,["bdk::descriptor::template::P2Wpkh_P2Sh"]],["impl<K> Sync for P2Wpkh<K>where
        K: Sync,
    ",1,["bdk::descriptor::template::P2Wpkh"]],["impl<K> Sync for P2TR<K>where
        K: Sync,
    ",1,["bdk::descriptor::template::P2TR"]],["impl<K> Sync for Bip44<K>where
        K: Sync,
    ",1,["bdk::descriptor::template::Bip44"]],["impl<K> Sync for Bip44Public<K>where
        K: Sync,
    ",1,["bdk::descriptor::template::Bip44Public"]],["impl<K> Sync for Bip49<K>where
        K: Sync,
    ",1,["bdk::descriptor::template::Bip49"]],["impl<K> Sync for Bip49Public<K>where
        K: Sync,
    ",1,["bdk::descriptor::template::Bip49Public"]],["impl<K> Sync for Bip84<K>where
        K: Sync,
    ",1,["bdk::descriptor::template::Bip84"]],["impl<K> Sync for Bip84Public<K>where
        K: Sync,
    ",1,["bdk::descriptor::template::Bip84Public"]],["impl<K> Sync for Bip86<K>where
        K: Sync,
    ",1,["bdk::descriptor::template::Bip86"]],["impl<K> Sync for Bip86Public<K>where
        K: Sync,
    ",1,["bdk::descriptor::template::Bip86Public"]],["impl<Ctx> Sync for DescriptorKey<Ctx>where
        Ctx: Sync,
    ",1,["bdk::keys::DescriptorKey"]],["impl Sync for ScriptContextEnum",1,["bdk::keys::ScriptContextEnum"]],["impl<Ctx> Sync for ExtendedKey<Ctx>where
        Ctx: Sync,
    ",1,["bdk::keys::ExtendedKey"]],["impl<K, Ctx> Sync for GeneratedKey<K, Ctx>where
        Ctx: Sync,
        K: Sync,
    ",1,["bdk::keys::GeneratedKey"]],["impl Sync for PrivateKeyGenerateOptions",1,["bdk::keys::PrivateKeyGenerateOptions"]],["impl Sync for KeyError",1,["bdk::keys::KeyError"]],["impl Sync for KeychainKind",1,["bdk::types::KeychainKind"]],["impl Sync for LocalOutput",1,["bdk::types::LocalOutput"]],["impl Sync for WeightedUtxo",1,["bdk::types::WeightedUtxo"]],["impl Sync for Utxo",1,["bdk::types::Utxo"]],["impl Sync for Error",1,["bdk::wallet::coin_selection::Error"]],["impl Sync for Excess",1,["bdk::wallet::coin_selection::Excess"]],["impl Sync for CoinSelectionResult",1,["bdk::wallet::coin_selection::CoinSelectionResult"]],["impl Sync for LargestFirstCoinSelection",1,["bdk::wallet::coin_selection::LargestFirstCoinSelection"]],["impl Sync for OldestFirstCoinSelection",1,["bdk::wallet::coin_selection::OldestFirstCoinSelection"]],["impl Sync for BranchAndBoundCoinSelection",1,["bdk::wallet::coin_selection::BranchAndBoundCoinSelection"]],["impl Sync for FullyNodedExport",1,["bdk::wallet::export::FullyNodedExport"]],["impl Sync for SignerId",1,["bdk::wallet::signer::SignerId"]],["impl Sync for SignerError",1,["bdk::wallet::signer::SignerError"]],["impl Sync for SignerContext",1,["bdk::wallet::signer::SignerContext"]],["impl<S> Sync for SignerWrapper<S>where
        S: Sync,
    ",1,["bdk::wallet::signer::SignerWrapper"]],["impl Sync for SignerOrdering",1,["bdk::wallet::signer::SignerOrdering"]],["impl Sync for SignersContainer",1,["bdk::wallet::signer::SignersContainer"]],["impl Sync for SignOptions",1,["bdk::wallet::signer::SignOptions"]],["impl Sync for TapLeavesOptions",1,["bdk::wallet::signer::TapLeavesOptions"]],["impl Sync for CreateTx",1,["bdk::wallet::tx_builder::CreateTx"]],["impl Sync for BumpFee",1,["bdk::wallet::tx_builder::BumpFee"]],["impl<'a, Cs, Ctx> !Sync for TxBuilder<'a, Cs, Ctx>",1,["bdk::wallet::tx_builder::TxBuilder"]],["impl Sync for AddUtxoError",1,["bdk::wallet::tx_builder::AddUtxoError"]],["impl Sync for AddForeignUtxoError",1,["bdk::wallet::tx_builder::AddForeignUtxoError"]],["impl Sync for AllowShrinkingError",1,["bdk::wallet::tx_builder::AllowShrinkingError"]],["impl Sync for TxOrdering",1,["bdk::wallet::tx_builder::TxOrdering"]],["impl Sync for ChangeSpendPolicy",1,["bdk::wallet::tx_builder::ChangeSpendPolicy"]],["impl Sync for MiniscriptPsbtError",1,["bdk::wallet::error::MiniscriptPsbtError"]],["impl Sync for CreateTxError",1,["bdk::wallet::error::CreateTxError"]],["impl Sync for BuildFeeBumpError",1,["bdk::wallet::error::BuildFeeBumpError"]],["impl Sync for Wallet",1,["bdk::wallet::Wallet"]],["impl Sync for Update",1,["bdk::wallet::Update"]],["impl Sync for ChangeSet",1,["bdk::wallet::ChangeSet"]],["impl Sync for AddressInfo",1,["bdk::wallet::AddressInfo"]],["impl Sync for NewError",1,["bdk::wallet::NewError"]],["impl Sync for LoadError",1,["bdk::wallet::LoadError"]],["impl Sync for NewOrLoadError",1,["bdk::wallet::NewOrLoadError"]],["impl Sync for InsertTxError",1,["bdk::wallet::InsertTxError"]],["impl Sync for ApplyBlockError",1,["bdk::wallet::ApplyBlockError"]]], "bdk_bitcoind_rpc":[["impl<'c, C> Sync for Emitter<'c, C>where
        C: Sync,
    ",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> Sync for BlockEvent<B>where
        B: Sync,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], -"bdk_chain":[["impl<I> Sync for SpkTxOutIndex<I>where
        I: Sync,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<A> Sync for ChainPosition<A>where
        A: Sync,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl Sync for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Sync for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Sync for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Sync for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl<A> Sync for FullTxOut<A>where
        A: Sync,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A, I> Sync for IndexedTxGraph<A, I>where
        A: Sync,
        I: Sync,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Sync for ChangeSet<A, IA>where
        A: Sync,
        IA: Sync,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<K> Sync for KeychainTxOutIndex<K>where
        K: Sync,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Sync for ChangeSet<K>where
        K: Sync,
    ",1,["bdk_chain::keychain::ChangeSet"]],["impl Sync for Balance",1,["bdk_chain::keychain::Balance"]],["impl Sync for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Sync for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Sync for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Sync for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Sync for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Sync for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Sync for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl<A> Sync for TxGraph<A>where
        A: Sync,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<'a, T, A> Sync for TxNode<'a, T, A>where
        A: Sync,
        T: Sync,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'a, T, A> Sync for CanonicalTx<'a, T, A>where
        A: Sync,
        T: Sync,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl Sync for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl<A> Sync for ChangeSet<A>where
        A: Sync,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<'g, A, F> Sync for TxAncestors<'g, A, F>where
        A: Sync,
        F: Sync,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Sync for TxDescendants<'g, A, F>where
        A: Sync,
        F: Sync,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<D> Sync for SpkIterator<D>where
        D: Sync,
    ",1,["bdk_chain::spk_iter::SpkIterator"]]], +"bdk_chain":[["impl<I> Sync for SpkTxOutIndex<I>where
        I: Sync,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<A> Sync for ChainPosition<A>where
        A: Sync,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl Sync for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Sync for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Sync for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Sync for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl<A> Sync for FullTxOut<A>where
        A: Sync,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A, I> Sync for IndexedTxGraph<A, I>where
        A: Sync,
        I: Sync,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Sync for ChangeSet<A, IA>where
        A: Sync,
        IA: Sync,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<K> Sync for KeychainTxOutIndex<K>where
        K: Sync,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Sync for ChangeSet<K>where
        K: Sync,
    ",1,["bdk_chain::keychain::ChangeSet"]],["impl Sync for Balance",1,["bdk_chain::keychain::Balance"]],["impl Sync for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Sync for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Sync for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Sync for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Sync for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Sync for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Sync for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl<A> Sync for TxGraph<A>where
        A: Sync,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<'a, T, A> Sync for TxNode<'a, T, A>where
        A: Sync,
        T: Sync,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'a, T, A> Sync for CanonicalTx<'a, T, A>where
        A: Sync,
        T: Sync,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl Sync for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl<A> Sync for ChangeSet<A>where
        A: Sync,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<'g, A, F> Sync for TxAncestors<'g, A, F>where
        A: Sync,
        F: Sync,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Sync for TxDescendants<'g, A, F>where
        A: Sync,
        F: Sync,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<D> Sync for SpkIterator<D>where
        D: Sync,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl !Sync for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl<A> Sync for SyncResult<A>where
        A: Sync,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<K> !Sync for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> Sync for FullScanResult<K>where
        K: Sync,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl Sync for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl Sync for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl<'a> Sync for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl Sync for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl Sync for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl Sync for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl Sync for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl Sync for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl Sync for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl<'c, S> Sync for Bnb<'c, S>where
        S: Sync,
    ",1,["bdk_coin_select::bnb::Bnb"]],["impl<'c, 'f, S> !Sync for BnbIter<'c, 'f, S>",1,["bdk_coin_select::bnb::BnbIter"]],["impl Sync for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]]], "bdk_electrum":[["impl Sync for RelevantTxids",1,["bdk_electrum::electrum_ext::RelevantTxids"]],["impl Sync for ElectrumUpdate",1,["bdk_electrum::electrum_ext::ElectrumUpdate"]]], -"bdk_esplora":[["impl<K> Sync for FullScanUpdate<K>where
        K: Sync,
    ",1,["bdk_esplora::FullScanUpdate"]],["impl Sync for SyncUpdate",1,["bdk_esplora::SyncUpdate"]]], "bdk_file_store":[["impl<'t, T> Sync for EntryIter<'t, T>where
        T: Sync,
    ",1,["bdk_file_store::entry_iter::EntryIter"]],["impl Sync for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<C> Sync for Store<C>",1,["bdk_file_store::store::Store"]],["impl<C> Sync for AggregateChangesetsError<C>where
        C: Sync,
    ",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl Sync for FileError",1,["bdk_file_store::FileError"]]], "bdk_hwi":[["impl Sync for HWISigner",1,["bdk_hwi::signer::HWISigner"]]], "bdk_persist":[["impl<C> Sync for Persist<C>where
        C: Sync,
    ",1,["bdk_persist::persist::Persist"]]], diff --git a/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Unpin.js b/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Unpin.js index ab3d033bb1..1ee76b31db 100644 --- a/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Unpin.js +++ b/docs-rs/bdk/nightly/latest/implementors/core/marker/trait.Unpin.js @@ -1,10 +1,9 @@ (function() {var implementors = { "bdk":[["impl Unpin for Error",1,["bdk::descriptor::error::Error"]],["impl Unpin for PkOrF",1,["bdk::descriptor::policy::PkOrF"]],["impl Unpin for SatisfiableItem",1,["bdk::descriptor::policy::SatisfiableItem"]],["impl Unpin for Satisfaction",1,["bdk::descriptor::policy::Satisfaction"]],["impl Unpin for Policy",1,["bdk::descriptor::policy::Policy"]],["impl Unpin for Condition",1,["bdk::descriptor::policy::Condition"]],["impl Unpin for PolicyError",1,["bdk::descriptor::policy::PolicyError"]],["impl<'a> Unpin for BuildSatisfaction<'a>",1,["bdk::descriptor::policy::BuildSatisfaction"]],["impl<K> Unpin for P2Pkh<K>where
        K: Unpin,
    ",1,["bdk::descriptor::template::P2Pkh"]],["impl<K> Unpin for P2Wpkh_P2Sh<K>where
        K: Unpin,
    ",1,["bdk::descriptor::template::P2Wpkh_P2Sh"]],["impl<K> Unpin for P2Wpkh<K>where
        K: Unpin,
    ",1,["bdk::descriptor::template::P2Wpkh"]],["impl<K> Unpin for P2TR<K>where
        K: Unpin,
    ",1,["bdk::descriptor::template::P2TR"]],["impl<K> Unpin for Bip44<K>where
        K: Unpin,
    ",1,["bdk::descriptor::template::Bip44"]],["impl<K> Unpin for Bip44Public<K>where
        K: Unpin,
    ",1,["bdk::descriptor::template::Bip44Public"]],["impl<K> Unpin for Bip49<K>where
        K: Unpin,
    ",1,["bdk::descriptor::template::Bip49"]],["impl<K> Unpin for Bip49Public<K>where
        K: Unpin,
    ",1,["bdk::descriptor::template::Bip49Public"]],["impl<K> Unpin for Bip84<K>where
        K: Unpin,
    ",1,["bdk::descriptor::template::Bip84"]],["impl<K> Unpin for Bip84Public<K>where
        K: Unpin,
    ",1,["bdk::descriptor::template::Bip84Public"]],["impl<K> Unpin for Bip86<K>where
        K: Unpin,
    ",1,["bdk::descriptor::template::Bip86"]],["impl<K> Unpin for Bip86Public<K>where
        K: Unpin,
    ",1,["bdk::descriptor::template::Bip86Public"]],["impl<Ctx> Unpin for DescriptorKey<Ctx>where
        Ctx: Unpin,
    ",1,["bdk::keys::DescriptorKey"]],["impl Unpin for ScriptContextEnum",1,["bdk::keys::ScriptContextEnum"]],["impl<Ctx> Unpin for ExtendedKey<Ctx>where
        Ctx: Unpin,
    ",1,["bdk::keys::ExtendedKey"]],["impl<K, Ctx> Unpin for GeneratedKey<K, Ctx>where
        Ctx: Unpin,
        K: Unpin,
    ",1,["bdk::keys::GeneratedKey"]],["impl Unpin for PrivateKeyGenerateOptions",1,["bdk::keys::PrivateKeyGenerateOptions"]],["impl Unpin for KeyError",1,["bdk::keys::KeyError"]],["impl Unpin for KeychainKind",1,["bdk::types::KeychainKind"]],["impl Unpin for LocalOutput",1,["bdk::types::LocalOutput"]],["impl Unpin for WeightedUtxo",1,["bdk::types::WeightedUtxo"]],["impl Unpin for Utxo",1,["bdk::types::Utxo"]],["impl Unpin for Error",1,["bdk::wallet::coin_selection::Error"]],["impl Unpin for Excess",1,["bdk::wallet::coin_selection::Excess"]],["impl Unpin for CoinSelectionResult",1,["bdk::wallet::coin_selection::CoinSelectionResult"]],["impl Unpin for LargestFirstCoinSelection",1,["bdk::wallet::coin_selection::LargestFirstCoinSelection"]],["impl Unpin for OldestFirstCoinSelection",1,["bdk::wallet::coin_selection::OldestFirstCoinSelection"]],["impl Unpin for BranchAndBoundCoinSelection",1,["bdk::wallet::coin_selection::BranchAndBoundCoinSelection"]],["impl Unpin for FullyNodedExport",1,["bdk::wallet::export::FullyNodedExport"]],["impl Unpin for SignerId",1,["bdk::wallet::signer::SignerId"]],["impl Unpin for SignerError",1,["bdk::wallet::signer::SignerError"]],["impl Unpin for SignerContext",1,["bdk::wallet::signer::SignerContext"]],["impl<S> Unpin for SignerWrapper<S>where
        S: Unpin,
    ",1,["bdk::wallet::signer::SignerWrapper"]],["impl Unpin for SignerOrdering",1,["bdk::wallet::signer::SignerOrdering"]],["impl Unpin for SignersContainer",1,["bdk::wallet::signer::SignersContainer"]],["impl Unpin for SignOptions",1,["bdk::wallet::signer::SignOptions"]],["impl Unpin for TapLeavesOptions",1,["bdk::wallet::signer::TapLeavesOptions"]],["impl Unpin for CreateTx",1,["bdk::wallet::tx_builder::CreateTx"]],["impl Unpin for BumpFee",1,["bdk::wallet::tx_builder::BumpFee"]],["impl<'a, Cs, Ctx> Unpin for TxBuilder<'a, Cs, Ctx>where
        Cs: Unpin,
        Ctx: Unpin,
    ",1,["bdk::wallet::tx_builder::TxBuilder"]],["impl Unpin for AddUtxoError",1,["bdk::wallet::tx_builder::AddUtxoError"]],["impl Unpin for AddForeignUtxoError",1,["bdk::wallet::tx_builder::AddForeignUtxoError"]],["impl Unpin for AllowShrinkingError",1,["bdk::wallet::tx_builder::AllowShrinkingError"]],["impl Unpin for TxOrdering",1,["bdk::wallet::tx_builder::TxOrdering"]],["impl Unpin for ChangeSpendPolicy",1,["bdk::wallet::tx_builder::ChangeSpendPolicy"]],["impl Unpin for MiniscriptPsbtError",1,["bdk::wallet::error::MiniscriptPsbtError"]],["impl Unpin for CreateTxError",1,["bdk::wallet::error::CreateTxError"]],["impl Unpin for BuildFeeBumpError",1,["bdk::wallet::error::BuildFeeBumpError"]],["impl Unpin for Wallet",1,["bdk::wallet::Wallet"]],["impl Unpin for Update",1,["bdk::wallet::Update"]],["impl Unpin for ChangeSet",1,["bdk::wallet::ChangeSet"]],["impl Unpin for AddressInfo",1,["bdk::wallet::AddressInfo"]],["impl Unpin for NewError",1,["bdk::wallet::NewError"]],["impl Unpin for LoadError",1,["bdk::wallet::LoadError"]],["impl Unpin for NewOrLoadError",1,["bdk::wallet::NewOrLoadError"]],["impl Unpin for InsertTxError",1,["bdk::wallet::InsertTxError"]],["impl Unpin for ApplyBlockError",1,["bdk::wallet::ApplyBlockError"]]], "bdk_bitcoind_rpc":[["impl<'c, C> Unpin for Emitter<'c, C>",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> Unpin for BlockEvent<B>where
        B: Unpin,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], -"bdk_chain":[["impl<I> Unpin for SpkTxOutIndex<I>where
        I: Unpin,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<A> Unpin for ChainPosition<A>where
        A: Unpin,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl Unpin for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Unpin for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Unpin for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Unpin for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl<A> Unpin for FullTxOut<A>where
        A: Unpin,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A, I> Unpin for IndexedTxGraph<A, I>where
        I: Unpin,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Unpin for ChangeSet<A, IA>where
        IA: Unpin,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<K> Unpin for KeychainTxOutIndex<K>where
        K: Unpin,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Unpin for ChangeSet<K>",1,["bdk_chain::keychain::ChangeSet"]],["impl Unpin for Balance",1,["bdk_chain::keychain::Balance"]],["impl Unpin for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Unpin for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Unpin for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Unpin for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Unpin for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Unpin for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Unpin for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl<A> Unpin for TxGraph<A>",1,["bdk_chain::tx_graph::TxGraph"]],["impl<'a, T, A> Unpin for TxNode<'a, T, A>where
        T: Unpin,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'a, T, A> Unpin for CanonicalTx<'a, T, A>where
        T: Unpin,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl Unpin for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl<A> Unpin for ChangeSet<A>",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<'g, A, F> Unpin for TxAncestors<'g, A, F>where
        F: Unpin,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Unpin for TxDescendants<'g, A, F>where
        F: Unpin,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<D> Unpin for SpkIterator<D>where
        D: Unpin,
    ",1,["bdk_chain::spk_iter::SpkIterator"]]], +"bdk_chain":[["impl<I> Unpin for SpkTxOutIndex<I>where
        I: Unpin,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<A> Unpin for ChainPosition<A>where
        A: Unpin,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl Unpin for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Unpin for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Unpin for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Unpin for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl<A> Unpin for FullTxOut<A>where
        A: Unpin,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A, I> Unpin for IndexedTxGraph<A, I>where
        I: Unpin,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Unpin for ChangeSet<A, IA>where
        IA: Unpin,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<K> Unpin for KeychainTxOutIndex<K>where
        K: Unpin,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Unpin for ChangeSet<K>",1,["bdk_chain::keychain::ChangeSet"]],["impl Unpin for Balance",1,["bdk_chain::keychain::Balance"]],["impl Unpin for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Unpin for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Unpin for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Unpin for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Unpin for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Unpin for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Unpin for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl<A> Unpin for TxGraph<A>",1,["bdk_chain::tx_graph::TxGraph"]],["impl<'a, T, A> Unpin for TxNode<'a, T, A>where
        T: Unpin,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'a, T, A> Unpin for CanonicalTx<'a, T, A>where
        T: Unpin,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl Unpin for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl<A> Unpin for ChangeSet<A>",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<'g, A, F> Unpin for TxAncestors<'g, A, F>where
        F: Unpin,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Unpin for TxDescendants<'g, A, F>where
        F: Unpin,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<D> Unpin for SpkIterator<D>where
        D: Unpin,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl Unpin for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl<A> Unpin for SyncResult<A>",1,["bdk_chain::spk_client::SyncResult"]],["impl<K> Unpin for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> Unpin for FullScanResult<K>",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl Unpin for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl Unpin for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl<'a> Unpin for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl Unpin for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl Unpin for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl Unpin for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl Unpin for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl Unpin for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl Unpin for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl<'c, S> Unpin for Bnb<'c, S>where
        S: Unpin,
    ",1,["bdk_coin_select::bnb::Bnb"]],["impl<'c, 'f, S> Unpin for BnbIter<'c, 'f, S>where
        S: Unpin,
        'c: 'f,
    ",1,["bdk_coin_select::bnb::BnbIter"]],["impl Unpin for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]]], "bdk_electrum":[["impl Unpin for RelevantTxids",1,["bdk_electrum::electrum_ext::RelevantTxids"]],["impl Unpin for ElectrumUpdate",1,["bdk_electrum::electrum_ext::ElectrumUpdate"]]], -"bdk_esplora":[["impl<K> Unpin for FullScanUpdate<K>",1,["bdk_esplora::FullScanUpdate"]],["impl Unpin for SyncUpdate",1,["bdk_esplora::SyncUpdate"]]], "bdk_file_store":[["impl<'t, T> Unpin for EntryIter<'t, T>where
        T: Unpin,
    ",1,["bdk_file_store::entry_iter::EntryIter"]],["impl Unpin for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<C> Unpin for Store<C>where
        C: Unpin,
    ",1,["bdk_file_store::store::Store"]],["impl<C> Unpin for AggregateChangesetsError<C>where
        C: Unpin,
    ",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl Unpin for FileError",1,["bdk_file_store::FileError"]]], "bdk_hwi":[["impl Unpin for HWISigner",1,["bdk_hwi::signer::HWISigner"]]], "bdk_persist":[["impl<C> Unpin for Persist<C>where
        C: Unpin,
    ",1,["bdk_persist::persist::Persist"]]], diff --git a/docs-rs/bdk/nightly/latest/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js b/docs-rs/bdk/nightly/latest/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js index aaa9ff9634..cd3fa7e1d9 100644 --- a/docs-rs/bdk/nightly/latest/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js +++ b/docs-rs/bdk/nightly/latest/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -1,10 +1,9 @@ (function() {var implementors = { "bdk":[["impl RefUnwindSafe for Error",1,["bdk::descriptor::error::Error"]],["impl RefUnwindSafe for PkOrF",1,["bdk::descriptor::policy::PkOrF"]],["impl RefUnwindSafe for SatisfiableItem",1,["bdk::descriptor::policy::SatisfiableItem"]],["impl RefUnwindSafe for Satisfaction",1,["bdk::descriptor::policy::Satisfaction"]],["impl RefUnwindSafe for Policy",1,["bdk::descriptor::policy::Policy"]],["impl RefUnwindSafe for Condition",1,["bdk::descriptor::policy::Condition"]],["impl RefUnwindSafe for PolicyError",1,["bdk::descriptor::policy::PolicyError"]],["impl<'a> RefUnwindSafe for BuildSatisfaction<'a>",1,["bdk::descriptor::policy::BuildSatisfaction"]],["impl<K> RefUnwindSafe for P2Pkh<K>where
        K: RefUnwindSafe,
    ",1,["bdk::descriptor::template::P2Pkh"]],["impl<K> RefUnwindSafe for P2Wpkh_P2Sh<K>where
        K: RefUnwindSafe,
    ",1,["bdk::descriptor::template::P2Wpkh_P2Sh"]],["impl<K> RefUnwindSafe for P2Wpkh<K>where
        K: RefUnwindSafe,
    ",1,["bdk::descriptor::template::P2Wpkh"]],["impl<K> RefUnwindSafe for P2TR<K>where
        K: RefUnwindSafe,
    ",1,["bdk::descriptor::template::P2TR"]],["impl<K> RefUnwindSafe for Bip44<K>where
        K: RefUnwindSafe,
    ",1,["bdk::descriptor::template::Bip44"]],["impl<K> RefUnwindSafe for Bip44Public<K>where
        K: RefUnwindSafe,
    ",1,["bdk::descriptor::template::Bip44Public"]],["impl<K> RefUnwindSafe for Bip49<K>where
        K: RefUnwindSafe,
    ",1,["bdk::descriptor::template::Bip49"]],["impl<K> RefUnwindSafe for Bip49Public<K>where
        K: RefUnwindSafe,
    ",1,["bdk::descriptor::template::Bip49Public"]],["impl<K> RefUnwindSafe for Bip84<K>where
        K: RefUnwindSafe,
    ",1,["bdk::descriptor::template::Bip84"]],["impl<K> RefUnwindSafe for Bip84Public<K>where
        K: RefUnwindSafe,
    ",1,["bdk::descriptor::template::Bip84Public"]],["impl<K> RefUnwindSafe for Bip86<K>where
        K: RefUnwindSafe,
    ",1,["bdk::descriptor::template::Bip86"]],["impl<K> RefUnwindSafe for Bip86Public<K>where
        K: RefUnwindSafe,
    ",1,["bdk::descriptor::template::Bip86Public"]],["impl<Ctx> RefUnwindSafe for DescriptorKey<Ctx>where
        Ctx: RefUnwindSafe,
    ",1,["bdk::keys::DescriptorKey"]],["impl RefUnwindSafe for ScriptContextEnum",1,["bdk::keys::ScriptContextEnum"]],["impl<Ctx> RefUnwindSafe for ExtendedKey<Ctx>where
        Ctx: RefUnwindSafe,
    ",1,["bdk::keys::ExtendedKey"]],["impl<K, Ctx> RefUnwindSafe for GeneratedKey<K, Ctx>where
        Ctx: RefUnwindSafe,
        K: RefUnwindSafe,
    ",1,["bdk::keys::GeneratedKey"]],["impl RefUnwindSafe for PrivateKeyGenerateOptions",1,["bdk::keys::PrivateKeyGenerateOptions"]],["impl RefUnwindSafe for KeyError",1,["bdk::keys::KeyError"]],["impl RefUnwindSafe for KeychainKind",1,["bdk::types::KeychainKind"]],["impl RefUnwindSafe for LocalOutput",1,["bdk::types::LocalOutput"]],["impl RefUnwindSafe for WeightedUtxo",1,["bdk::types::WeightedUtxo"]],["impl RefUnwindSafe for Utxo",1,["bdk::types::Utxo"]],["impl RefUnwindSafe for Error",1,["bdk::wallet::coin_selection::Error"]],["impl RefUnwindSafe for Excess",1,["bdk::wallet::coin_selection::Excess"]],["impl RefUnwindSafe for CoinSelectionResult",1,["bdk::wallet::coin_selection::CoinSelectionResult"]],["impl RefUnwindSafe for LargestFirstCoinSelection",1,["bdk::wallet::coin_selection::LargestFirstCoinSelection"]],["impl RefUnwindSafe for OldestFirstCoinSelection",1,["bdk::wallet::coin_selection::OldestFirstCoinSelection"]],["impl RefUnwindSafe for BranchAndBoundCoinSelection",1,["bdk::wallet::coin_selection::BranchAndBoundCoinSelection"]],["impl RefUnwindSafe for FullyNodedExport",1,["bdk::wallet::export::FullyNodedExport"]],["impl RefUnwindSafe for SignerId",1,["bdk::wallet::signer::SignerId"]],["impl RefUnwindSafe for SignerError",1,["bdk::wallet::signer::SignerError"]],["impl RefUnwindSafe for SignerContext",1,["bdk::wallet::signer::SignerContext"]],["impl<S> RefUnwindSafe for SignerWrapper<S>where
        S: RefUnwindSafe,
    ",1,["bdk::wallet::signer::SignerWrapper"]],["impl RefUnwindSafe for SignerOrdering",1,["bdk::wallet::signer::SignerOrdering"]],["impl !RefUnwindSafe for SignersContainer",1,["bdk::wallet::signer::SignersContainer"]],["impl RefUnwindSafe for SignOptions",1,["bdk::wallet::signer::SignOptions"]],["impl RefUnwindSafe for TapLeavesOptions",1,["bdk::wallet::signer::TapLeavesOptions"]],["impl RefUnwindSafe for CreateTx",1,["bdk::wallet::tx_builder::CreateTx"]],["impl RefUnwindSafe for BumpFee",1,["bdk::wallet::tx_builder::BumpFee"]],["impl<'a, Cs, Ctx> !RefUnwindSafe for TxBuilder<'a, Cs, Ctx>",1,["bdk::wallet::tx_builder::TxBuilder"]],["impl RefUnwindSafe for AddUtxoError",1,["bdk::wallet::tx_builder::AddUtxoError"]],["impl RefUnwindSafe for AddForeignUtxoError",1,["bdk::wallet::tx_builder::AddForeignUtxoError"]],["impl RefUnwindSafe for AllowShrinkingError",1,["bdk::wallet::tx_builder::AllowShrinkingError"]],["impl RefUnwindSafe for TxOrdering",1,["bdk::wallet::tx_builder::TxOrdering"]],["impl RefUnwindSafe for ChangeSpendPolicy",1,["bdk::wallet::tx_builder::ChangeSpendPolicy"]],["impl RefUnwindSafe for MiniscriptPsbtError",1,["bdk::wallet::error::MiniscriptPsbtError"]],["impl !RefUnwindSafe for CreateTxError",1,["bdk::wallet::error::CreateTxError"]],["impl RefUnwindSafe for BuildFeeBumpError",1,["bdk::wallet::error::BuildFeeBumpError"]],["impl !RefUnwindSafe for Wallet",1,["bdk::wallet::Wallet"]],["impl RefUnwindSafe for Update",1,["bdk::wallet::Update"]],["impl RefUnwindSafe for ChangeSet",1,["bdk::wallet::ChangeSet"]],["impl RefUnwindSafe for AddressInfo",1,["bdk::wallet::AddressInfo"]],["impl !RefUnwindSafe for NewError",1,["bdk::wallet::NewError"]],["impl !RefUnwindSafe for LoadError",1,["bdk::wallet::LoadError"]],["impl !RefUnwindSafe for NewOrLoadError",1,["bdk::wallet::NewOrLoadError"]],["impl RefUnwindSafe for InsertTxError",1,["bdk::wallet::InsertTxError"]],["impl RefUnwindSafe for ApplyBlockError",1,["bdk::wallet::ApplyBlockError"]]], "bdk_bitcoind_rpc":[["impl<'c, C> RefUnwindSafe for Emitter<'c, C>where
        C: RefUnwindSafe,
    ",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> RefUnwindSafe for BlockEvent<B>where
        B: RefUnwindSafe,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], -"bdk_chain":[["impl<I> RefUnwindSafe for SpkTxOutIndex<I>where
        I: RefUnwindSafe,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<A> RefUnwindSafe for ChainPosition<A>where
        A: RefUnwindSafe,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl RefUnwindSafe for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl RefUnwindSafe for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl RefUnwindSafe for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl RefUnwindSafe for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl<A> RefUnwindSafe for FullTxOut<A>where
        A: RefUnwindSafe,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A, I> RefUnwindSafe for IndexedTxGraph<A, I>where
        A: RefUnwindSafe,
        I: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> RefUnwindSafe for ChangeSet<A, IA>where
        A: RefUnwindSafe,
        IA: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<K> RefUnwindSafe for KeychainTxOutIndex<K>where
        K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> RefUnwindSafe for ChangeSet<K>where
        K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::ChangeSet"]],["impl RefUnwindSafe for Balance",1,["bdk_chain::keychain::Balance"]],["impl RefUnwindSafe for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl RefUnwindSafe for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl RefUnwindSafe for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl RefUnwindSafe for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl RefUnwindSafe for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl RefUnwindSafe for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl RefUnwindSafe for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl<A> RefUnwindSafe for TxGraph<A>where
        A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<'a, T, A> RefUnwindSafe for TxNode<'a, T, A>where
        A: RefUnwindSafe,
        T: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'a, T, A> RefUnwindSafe for CanonicalTx<'a, T, A>where
        A: RefUnwindSafe,
        T: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl RefUnwindSafe for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl<A> RefUnwindSafe for ChangeSet<A>where
        A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<'g, A, F> RefUnwindSafe for TxAncestors<'g, A, F>where
        A: RefUnwindSafe,
        F: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> RefUnwindSafe for TxDescendants<'g, A, F>where
        A: RefUnwindSafe,
        F: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<D> RefUnwindSafe for SpkIterator<D>where
        D: RefUnwindSafe,
    ",1,["bdk_chain::spk_iter::SpkIterator"]]], +"bdk_chain":[["impl<I> RefUnwindSafe for SpkTxOutIndex<I>where
        I: RefUnwindSafe,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<A> RefUnwindSafe for ChainPosition<A>where
        A: RefUnwindSafe,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl RefUnwindSafe for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl RefUnwindSafe for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl RefUnwindSafe for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl RefUnwindSafe for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl<A> RefUnwindSafe for FullTxOut<A>where
        A: RefUnwindSafe,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A, I> RefUnwindSafe for IndexedTxGraph<A, I>where
        A: RefUnwindSafe,
        I: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> RefUnwindSafe for ChangeSet<A, IA>where
        A: RefUnwindSafe,
        IA: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<K> RefUnwindSafe for KeychainTxOutIndex<K>where
        K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> RefUnwindSafe for ChangeSet<K>where
        K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::ChangeSet"]],["impl RefUnwindSafe for Balance",1,["bdk_chain::keychain::Balance"]],["impl RefUnwindSafe for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl RefUnwindSafe for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl RefUnwindSafe for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl RefUnwindSafe for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl RefUnwindSafe for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl RefUnwindSafe for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl RefUnwindSafe for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl<A> RefUnwindSafe for TxGraph<A>where
        A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<'a, T, A> RefUnwindSafe for TxNode<'a, T, A>where
        A: RefUnwindSafe,
        T: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'a, T, A> RefUnwindSafe for CanonicalTx<'a, T, A>where
        A: RefUnwindSafe,
        T: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl RefUnwindSafe for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl<A> RefUnwindSafe for ChangeSet<A>where
        A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<'g, A, F> RefUnwindSafe for TxAncestors<'g, A, F>where
        A: RefUnwindSafe,
        F: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> RefUnwindSafe for TxDescendants<'g, A, F>where
        A: RefUnwindSafe,
        F: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<D> RefUnwindSafe for SpkIterator<D>where
        D: RefUnwindSafe,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl !RefUnwindSafe for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl<A> RefUnwindSafe for SyncResult<A>where
        A: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<K> !RefUnwindSafe for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> RefUnwindSafe for FullScanResult<K>where
        K: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl RefUnwindSafe for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl RefUnwindSafe for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl<'a> RefUnwindSafe for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl RefUnwindSafe for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl RefUnwindSafe for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl RefUnwindSafe for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl RefUnwindSafe for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl RefUnwindSafe for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl RefUnwindSafe for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl<'c, S> RefUnwindSafe for Bnb<'c, S>where
        S: RefUnwindSafe,
    ",1,["bdk_coin_select::bnb::Bnb"]],["impl<'c, 'f, S> !RefUnwindSafe for BnbIter<'c, 'f, S>",1,["bdk_coin_select::bnb::BnbIter"]],["impl RefUnwindSafe for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]]], "bdk_electrum":[["impl RefUnwindSafe for RelevantTxids",1,["bdk_electrum::electrum_ext::RelevantTxids"]],["impl RefUnwindSafe for ElectrumUpdate",1,["bdk_electrum::electrum_ext::ElectrumUpdate"]]], -"bdk_esplora":[["impl<K> RefUnwindSafe for FullScanUpdate<K>where
        K: RefUnwindSafe,
    ",1,["bdk_esplora::FullScanUpdate"]],["impl RefUnwindSafe for SyncUpdate",1,["bdk_esplora::SyncUpdate"]]], "bdk_file_store":[["impl<'t, T> RefUnwindSafe for EntryIter<'t, T>where
        T: RefUnwindSafe,
    ",1,["bdk_file_store::entry_iter::EntryIter"]],["impl !RefUnwindSafe for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<C> RefUnwindSafe for Store<C>where
        C: RefUnwindSafe,
    ",1,["bdk_file_store::store::Store"]],["impl<C> !RefUnwindSafe for AggregateChangesetsError<C>",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl !RefUnwindSafe for FileError",1,["bdk_file_store::FileError"]]], "bdk_hwi":[["impl !RefUnwindSafe for HWISigner",1,["bdk_hwi::signer::HWISigner"]]], "bdk_persist":[["impl<C> !RefUnwindSafe for Persist<C>",1,["bdk_persist::persist::Persist"]]], diff --git a/docs-rs/bdk/nightly/latest/implementors/core/panic/unwind_safe/trait.UnwindSafe.js b/docs-rs/bdk/nightly/latest/implementors/core/panic/unwind_safe/trait.UnwindSafe.js index f5a11d3912..33e67e8beb 100644 --- a/docs-rs/bdk/nightly/latest/implementors/core/panic/unwind_safe/trait.UnwindSafe.js +++ b/docs-rs/bdk/nightly/latest/implementors/core/panic/unwind_safe/trait.UnwindSafe.js @@ -1,10 +1,9 @@ (function() {var implementors = { "bdk":[["impl UnwindSafe for Error",1,["bdk::descriptor::error::Error"]],["impl UnwindSafe for PkOrF",1,["bdk::descriptor::policy::PkOrF"]],["impl UnwindSafe for SatisfiableItem",1,["bdk::descriptor::policy::SatisfiableItem"]],["impl UnwindSafe for Satisfaction",1,["bdk::descriptor::policy::Satisfaction"]],["impl UnwindSafe for Policy",1,["bdk::descriptor::policy::Policy"]],["impl UnwindSafe for Condition",1,["bdk::descriptor::policy::Condition"]],["impl UnwindSafe for PolicyError",1,["bdk::descriptor::policy::PolicyError"]],["impl<'a> UnwindSafe for BuildSatisfaction<'a>",1,["bdk::descriptor::policy::BuildSatisfaction"]],["impl<K> UnwindSafe for P2Pkh<K>where
        K: UnwindSafe,
    ",1,["bdk::descriptor::template::P2Pkh"]],["impl<K> UnwindSafe for P2Wpkh_P2Sh<K>where
        K: UnwindSafe,
    ",1,["bdk::descriptor::template::P2Wpkh_P2Sh"]],["impl<K> UnwindSafe for P2Wpkh<K>where
        K: UnwindSafe,
    ",1,["bdk::descriptor::template::P2Wpkh"]],["impl<K> UnwindSafe for P2TR<K>where
        K: UnwindSafe,
    ",1,["bdk::descriptor::template::P2TR"]],["impl<K> UnwindSafe for Bip44<K>where
        K: UnwindSafe,
    ",1,["bdk::descriptor::template::Bip44"]],["impl<K> UnwindSafe for Bip44Public<K>where
        K: UnwindSafe,
    ",1,["bdk::descriptor::template::Bip44Public"]],["impl<K> UnwindSafe for Bip49<K>where
        K: UnwindSafe,
    ",1,["bdk::descriptor::template::Bip49"]],["impl<K> UnwindSafe for Bip49Public<K>where
        K: UnwindSafe,
    ",1,["bdk::descriptor::template::Bip49Public"]],["impl<K> UnwindSafe for Bip84<K>where
        K: UnwindSafe,
    ",1,["bdk::descriptor::template::Bip84"]],["impl<K> UnwindSafe for Bip84Public<K>where
        K: UnwindSafe,
    ",1,["bdk::descriptor::template::Bip84Public"]],["impl<K> UnwindSafe for Bip86<K>where
        K: UnwindSafe,
    ",1,["bdk::descriptor::template::Bip86"]],["impl<K> UnwindSafe for Bip86Public<K>where
        K: UnwindSafe,
    ",1,["bdk::descriptor::template::Bip86Public"]],["impl<Ctx> UnwindSafe for DescriptorKey<Ctx>where
        Ctx: UnwindSafe,
    ",1,["bdk::keys::DescriptorKey"]],["impl UnwindSafe for ScriptContextEnum",1,["bdk::keys::ScriptContextEnum"]],["impl<Ctx> UnwindSafe for ExtendedKey<Ctx>where
        Ctx: UnwindSafe,
    ",1,["bdk::keys::ExtendedKey"]],["impl<K, Ctx> UnwindSafe for GeneratedKey<K, Ctx>where
        Ctx: UnwindSafe,
        K: UnwindSafe,
    ",1,["bdk::keys::GeneratedKey"]],["impl UnwindSafe for PrivateKeyGenerateOptions",1,["bdk::keys::PrivateKeyGenerateOptions"]],["impl UnwindSafe for KeyError",1,["bdk::keys::KeyError"]],["impl UnwindSafe for KeychainKind",1,["bdk::types::KeychainKind"]],["impl UnwindSafe for LocalOutput",1,["bdk::types::LocalOutput"]],["impl UnwindSafe for WeightedUtxo",1,["bdk::types::WeightedUtxo"]],["impl UnwindSafe for Utxo",1,["bdk::types::Utxo"]],["impl UnwindSafe for Error",1,["bdk::wallet::coin_selection::Error"]],["impl UnwindSafe for Excess",1,["bdk::wallet::coin_selection::Excess"]],["impl UnwindSafe for CoinSelectionResult",1,["bdk::wallet::coin_selection::CoinSelectionResult"]],["impl UnwindSafe for LargestFirstCoinSelection",1,["bdk::wallet::coin_selection::LargestFirstCoinSelection"]],["impl UnwindSafe for OldestFirstCoinSelection",1,["bdk::wallet::coin_selection::OldestFirstCoinSelection"]],["impl UnwindSafe for BranchAndBoundCoinSelection",1,["bdk::wallet::coin_selection::BranchAndBoundCoinSelection"]],["impl UnwindSafe for FullyNodedExport",1,["bdk::wallet::export::FullyNodedExport"]],["impl UnwindSafe for SignerId",1,["bdk::wallet::signer::SignerId"]],["impl UnwindSafe for SignerError",1,["bdk::wallet::signer::SignerError"]],["impl UnwindSafe for SignerContext",1,["bdk::wallet::signer::SignerContext"]],["impl<S> UnwindSafe for SignerWrapper<S>where
        S: UnwindSafe,
    ",1,["bdk::wallet::signer::SignerWrapper"]],["impl UnwindSafe for SignerOrdering",1,["bdk::wallet::signer::SignerOrdering"]],["impl !UnwindSafe for SignersContainer",1,["bdk::wallet::signer::SignersContainer"]],["impl UnwindSafe for SignOptions",1,["bdk::wallet::signer::SignOptions"]],["impl UnwindSafe for TapLeavesOptions",1,["bdk::wallet::signer::TapLeavesOptions"]],["impl UnwindSafe for CreateTx",1,["bdk::wallet::tx_builder::CreateTx"]],["impl UnwindSafe for BumpFee",1,["bdk::wallet::tx_builder::BumpFee"]],["impl<'a, Cs, Ctx> !UnwindSafe for TxBuilder<'a, Cs, Ctx>",1,["bdk::wallet::tx_builder::TxBuilder"]],["impl UnwindSafe for AddUtxoError",1,["bdk::wallet::tx_builder::AddUtxoError"]],["impl UnwindSafe for AddForeignUtxoError",1,["bdk::wallet::tx_builder::AddForeignUtxoError"]],["impl UnwindSafe for AllowShrinkingError",1,["bdk::wallet::tx_builder::AllowShrinkingError"]],["impl UnwindSafe for TxOrdering",1,["bdk::wallet::tx_builder::TxOrdering"]],["impl UnwindSafe for ChangeSpendPolicy",1,["bdk::wallet::tx_builder::ChangeSpendPolicy"]],["impl UnwindSafe for MiniscriptPsbtError",1,["bdk::wallet::error::MiniscriptPsbtError"]],["impl !UnwindSafe for CreateTxError",1,["bdk::wallet::error::CreateTxError"]],["impl UnwindSafe for BuildFeeBumpError",1,["bdk::wallet::error::BuildFeeBumpError"]],["impl !UnwindSafe for Wallet",1,["bdk::wallet::Wallet"]],["impl UnwindSafe for Update",1,["bdk::wallet::Update"]],["impl UnwindSafe for ChangeSet",1,["bdk::wallet::ChangeSet"]],["impl UnwindSafe for AddressInfo",1,["bdk::wallet::AddressInfo"]],["impl !UnwindSafe for NewError",1,["bdk::wallet::NewError"]],["impl !UnwindSafe for LoadError",1,["bdk::wallet::LoadError"]],["impl !UnwindSafe for NewOrLoadError",1,["bdk::wallet::NewOrLoadError"]],["impl UnwindSafe for InsertTxError",1,["bdk::wallet::InsertTxError"]],["impl UnwindSafe for ApplyBlockError",1,["bdk::wallet::ApplyBlockError"]]], "bdk_bitcoind_rpc":[["impl<'c, C> UnwindSafe for Emitter<'c, C>where
        C: RefUnwindSafe,
    ",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> UnwindSafe for BlockEvent<B>where
        B: UnwindSafe,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], -"bdk_chain":[["impl<I> UnwindSafe for SpkTxOutIndex<I>where
        I: UnwindSafe + RefUnwindSafe,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<A> UnwindSafe for ChainPosition<A>where
        A: UnwindSafe,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl UnwindSafe for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl UnwindSafe for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl UnwindSafe for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl UnwindSafe for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl<A> UnwindSafe for FullTxOut<A>where
        A: UnwindSafe,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A, I> UnwindSafe for IndexedTxGraph<A, I>where
        A: RefUnwindSafe,
        I: UnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> UnwindSafe for ChangeSet<A, IA>where
        A: RefUnwindSafe,
        IA: UnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<K> UnwindSafe for KeychainTxOutIndex<K>where
        K: UnwindSafe + RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> UnwindSafe for ChangeSet<K>where
        K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::ChangeSet"]],["impl UnwindSafe for Balance",1,["bdk_chain::keychain::Balance"]],["impl UnwindSafe for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl UnwindSafe for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl UnwindSafe for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl UnwindSafe for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl UnwindSafe for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl UnwindSafe for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl UnwindSafe for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl<A> UnwindSafe for TxGraph<A>where
        A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<'a, T, A> UnwindSafe for TxNode<'a, T, A>where
        A: RefUnwindSafe,
        T: UnwindSafe,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'a, T, A> UnwindSafe for CanonicalTx<'a, T, A>where
        A: RefUnwindSafe,
        T: UnwindSafe,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl UnwindSafe for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl<A> UnwindSafe for ChangeSet<A>where
        A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<'g, A, F> UnwindSafe for TxAncestors<'g, A, F>where
        A: RefUnwindSafe,
        F: UnwindSafe,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> UnwindSafe for TxDescendants<'g, A, F>where
        A: RefUnwindSafe,
        F: UnwindSafe,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<D> UnwindSafe for SpkIterator<D>where
        D: UnwindSafe,
    ",1,["bdk_chain::spk_iter::SpkIterator"]]], +"bdk_chain":[["impl<I> UnwindSafe for SpkTxOutIndex<I>where
        I: UnwindSafe + RefUnwindSafe,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<A> UnwindSafe for ChainPosition<A>where
        A: UnwindSafe,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl UnwindSafe for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl UnwindSafe for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl UnwindSafe for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl UnwindSafe for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl<A> UnwindSafe for FullTxOut<A>where
        A: UnwindSafe,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A, I> UnwindSafe for IndexedTxGraph<A, I>where
        A: RefUnwindSafe,
        I: UnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> UnwindSafe for ChangeSet<A, IA>where
        A: RefUnwindSafe,
        IA: UnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<K> UnwindSafe for KeychainTxOutIndex<K>where
        K: UnwindSafe + RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> UnwindSafe for ChangeSet<K>where
        K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::ChangeSet"]],["impl UnwindSafe for Balance",1,["bdk_chain::keychain::Balance"]],["impl UnwindSafe for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl UnwindSafe for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl UnwindSafe for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl UnwindSafe for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl UnwindSafe for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl UnwindSafe for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl UnwindSafe for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl<A> UnwindSafe for TxGraph<A>where
        A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<'a, T, A> UnwindSafe for TxNode<'a, T, A>where
        A: RefUnwindSafe,
        T: UnwindSafe,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'a, T, A> UnwindSafe for CanonicalTx<'a, T, A>where
        A: RefUnwindSafe,
        T: UnwindSafe,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl UnwindSafe for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl<A> UnwindSafe for ChangeSet<A>where
        A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<'g, A, F> UnwindSafe for TxAncestors<'g, A, F>where
        A: RefUnwindSafe,
        F: UnwindSafe,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> UnwindSafe for TxDescendants<'g, A, F>where
        A: RefUnwindSafe,
        F: UnwindSafe,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<D> UnwindSafe for SpkIterator<D>where
        D: UnwindSafe,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl !UnwindSafe for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl<A> UnwindSafe for SyncResult<A>where
        A: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<K> !UnwindSafe for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> UnwindSafe for FullScanResult<K>where
        K: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl UnwindSafe for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl UnwindSafe for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl<'a> UnwindSafe for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl UnwindSafe for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl UnwindSafe for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl UnwindSafe for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl UnwindSafe for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl UnwindSafe for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl UnwindSafe for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl<'c, S> UnwindSafe for Bnb<'c, S>where
        S: UnwindSafe,
    ",1,["bdk_coin_select::bnb::Bnb"]],["impl<'c, 'f, S> !UnwindSafe for BnbIter<'c, 'f, S>",1,["bdk_coin_select::bnb::BnbIter"]],["impl UnwindSafe for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]]], "bdk_electrum":[["impl UnwindSafe for RelevantTxids",1,["bdk_electrum::electrum_ext::RelevantTxids"]],["impl UnwindSafe for ElectrumUpdate",1,["bdk_electrum::electrum_ext::ElectrumUpdate"]]], -"bdk_esplora":[["impl<K> UnwindSafe for FullScanUpdate<K>where
        K: RefUnwindSafe,
    ",1,["bdk_esplora::FullScanUpdate"]],["impl UnwindSafe for SyncUpdate",1,["bdk_esplora::SyncUpdate"]]], "bdk_file_store":[["impl<'t, T> !UnwindSafe for EntryIter<'t, T>",1,["bdk_file_store::entry_iter::EntryIter"]],["impl !UnwindSafe for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<C> UnwindSafe for Store<C>where
        C: UnwindSafe,
    ",1,["bdk_file_store::store::Store"]],["impl<C> !UnwindSafe for AggregateChangesetsError<C>",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl !UnwindSafe for FileError",1,["bdk_file_store::FileError"]]], "bdk_hwi":[["impl UnwindSafe for HWISigner",1,["bdk_hwi::signer::HWISigner"]]], "bdk_persist":[["impl<C> !UnwindSafe for Persist<C>",1,["bdk_persist::persist::Persist"]]], diff --git a/docs-rs/bdk/nightly/latest/search-index.js b/docs-rs/bdk/nightly/latest/search-index.js index 73e600bdee..1f7bc40b2f 100644 --- a/docs-rs/bdk/nightly/latest/search-index.js +++ b/docs-rs/bdk/nightly/latest/search-index.js @@ -1,10 +1,10 @@ var searchIndex = JSON.parse('{\ -"bdk":{"doc":"bdk","t":[13,13,2,13,4,13,3,2,2,4,2,3,11,11,11,11,11,11,11,11,11,11,2,11,11,11,11,11,11,11,11,11,12,12,0,14,11,11,11,11,11,11,11,11,11,11,14,11,11,11,11,11,11,11,11,11,11,12,12,0,11,12,11,0,12,11,11,11,2,2,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,12,5,11,11,11,11,0,12,12,12,13,6,4,2,4,6,8,6,8,16,4,3,13,13,2,8,4,13,13,6,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,2,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,10,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,12,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,10,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,5,5,13,13,4,13,13,13,13,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,13,13,13,4,13,3,6,13,13,6,13,13,13,13,13,13,13,13,13,13,13,4,3,4,13,13,13,13,13,4,4,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,12,11,11,11,12,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,3,3,3,3,3,3,3,3,8,6,3,3,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,13,8,4,4,4,16,16,8,4,13,8,8,3,8,13,13,13,16,4,6,13,13,13,13,13,16,13,3,13,8,4,13,13,13,3,3,4,3,13,6,13,13,13,5,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,11,5,11,10,11,11,5,10,11,11,12,12,11,11,11,11,11,11,10,12,11,11,11,11,11,10,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,8,10,10,10,3,4,3,13,3,13,13,13,13,4,8,4,13,13,13,13,4,4,13,13,13,13,13,13,13,3,3,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,0,11,12,11,11,11,11,11,11,11,11,11,11,11,11,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,12,11,12,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,5,12,12,12,12,12,12,12,12,13,13,3,13,8,3,6,4,4,13,3,13,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,5,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,4,13,13,13,4,13,13,13,13,13,13,13,13,4,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,3,6,12,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,13,13,13,13,13,13,13,8,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,3,8,4,4,4,3,3,3,13,4,8,13,11,12,12,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,10,11,11,11,10,11,12,11,12,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,4,4,4,13,3,13,13,4,3,13,13,13,13,13,13,3,8,4,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12],"n":["External","Foreign","HdKeyPaths","Internal","KeychainKind","Local","LocalOutput","SignOptions","TxBuilder","Utxo","Wallet","WeightedUtxo","as_byte","as_ref","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","chain","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","confirmation_time","derivation_index","descriptor","descriptor","deserialize","deserialize","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fragment","from","from","from","from","hash","hash","into","into","into","into","is_spent","keychain","keys","outpoint","outpoint","partial_cmp","psbt","satisfaction_weight","sequence","serialize","serialize","signer","template","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","txout","txout","type_id","type_id","type_id","type_id","utxo","version","vzip","vzip","vzip","vzip","wallet","outpoint","psbt_input","sequence","Bare","DerivedDescriptor","Descriptor","DescriptorError","DescriptorPublicKey","ExtendedDescriptor","ExtractPolicy","HdKeyPaths","IntoWalletDescriptor","Key","Legacy","Miniscript","MultiXPub","Pkh","Policy","ScriptContext","Segwitv0","Sh","Single","TapKeyOrigins","Tr","Wpkh","Wsh","XPub","address","as_enum","as_enum","as_inner","as_node","at_derivation_index","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","branches","build_template","build_template_mall","calc_checksum","check_global_consensus_validity","check_global_consensus_validity","check_global_consensus_validity","check_global_policy_validity","check_global_policy_validity","check_global_validity","check_local_consensus_validity","check_local_consensus_validity","check_local_consensus_validity","check_local_policy_validity","check_local_policy_validity","check_local_policy_validity","check_local_validity","check_pk","check_pk","check_pk","check_terminal_non_malleable","check_terminal_non_malleable","check_terminal_non_malleable","check_witness","check_witness","check_witness","checksum","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","contains_raw_pkh","derive","derived_descriptor","derived_descriptor","desc_type","deserialize","deserialize","dust_value","encode","eq","eq","eq","eq","error","explicit_script","ext","ext_check","extract_policy","extract_policy","extract_policy","find_derivation_index_for_spk","fmt","fmt","fmt","fmt","fmt","fmt","for_each_key","for_each_key","from","from","from","from","from","from","from","from","from","from","from_ast","from_components_unchecked","from_str","from_str","from_str_ext","from_str_insane","from_tree","from_tree","get_nth_child","get_nth_pk","get_satisfaction","get_satisfaction_mall","has_mixed_timelocks","has_repeated_keys","has_wildcard","hash","hash","hash","hash","into","into","into","into","into_inner","into_single_descriptors","into_wallet_descriptor","into_wallet_descriptor","is_deriveable","is_multipath","is_non_malleable","iter","iter_pk","lift","lift","lift_check","max_satisfaction_size","max_satisfaction_size","max_satisfaction_size","max_satisfaction_size","max_satisfaction_weight","max_satisfaction_witness_elements","max_weight_to_satisfy","name_str","name_str","name_str","new_bare","new_pk","new_pkh","new_sh","new_sh_sortedmulti","new_sh_with_wpkh","new_sh_with_wsh","new_sh_wpkh","new_sh_wsh","new_sh_wsh_sortedmulti","new_tr","new_wpkh","new_wsh","new_wsh_sortedmulti","node","other_top_level_checks","parse","parse_descriptor","parse_insane","parse_with_ext","partial_cmp","partial_cmp","partial_cmp","partial_cmp","pk_len","pk_len","pk_len","plan","plan_mall","policy","requires_sig","sanity_check","sanity_check","satisfy","satisfy","satisfy_malleable","script_code","script_pubkey","script_size","serialize","serialize","sig_type","sig_type","sig_type","substitute_raw_pkh","template","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string_with_secret","top_level_checks","top_level_type_check","translate_pk","translate_pk","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","ty","type_id","type_id","type_id","type_id","unsigned_script_sig","vzip","vzip","vzip","vzip","within_resource_limits","calc_checksum","calc_checksum_bytes","Base58","Bip32","Error","HardenedDerivationXpub","Hex","InvalidDescriptorCharacter","InvalidDescriptorChecksum","InvalidHdKeyPath","Key","Miniscript","MultiPath","Pk","Policy","borrow","borrow_mut","fmt","fmt","from","from","from","from","from","from","from","from","into","provide","to_string","try_from","try_into","type_id","vzip","AbsoluteTimelock","AddOnLeaf","AddOnPartialComplete","BuildSatisfaction","Complete","Condition","ConditionMap","EcdsaSignature","Fingerprint","FoldedConditionMap","Hash160Preimage","Hash256Preimage","IncompatibleConditions","IndexOutOfRange","MixedTimelockUnits","Multisig","None","None","NotEnoughItemsSelected","Partial","PartialComplete","PkOrF","Policy","PolicyError","Psbt","PsbtTimelocks","Pubkey","RelativeTimelock","Ripemd160Preimage","Satisfaction","SatisfiableItem","SchnorrSignature","Sha256Preimage","Thresh","XOnlyPubkey","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","contribution","csv","default","eq","eq","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","get_condition","hash","hash","id","id","into","into","into","into","into","into","into","is_leaf","is_leaf","is_null","item","partial_cmp","provide","requires_path","satisfaction","serialize","serialize","serialize","serialize","serialize","timelock","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","current_height","input_max_height","psbt","condition","conditions","conditions","items","items","m","m","n","n","sorted","sorted","hash","hash","hash","hash","items","keys","threshold","threshold","value","value","Bip44","Bip44Public","Bip49","Bip49Public","Bip84","Bip84Public","Bip86","Bip86Public","DescriptorTemplate","DescriptorTemplateOut","P2Pkh","P2TR","P2Wpkh","P2Wpkh_P2Sh","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","build","build","build","build","build","build","build","build","build","build","build","build","from","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","into","into","into","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","Bip32","DerivableKey","DescriptorKey","DescriptorPublicKey","DescriptorSecretKey","Entropy","Error","ExtScriptContext","ExtendedKey","FullKey","GeneratableDefaultOptions","GeneratableKey","GeneratedKey","IntoDescriptorKey","InvalidChecksum","InvalidNetwork","InvalidScriptContext","Key","KeyError","KeyMap","Legacy","Message","Miniscript","MultiXPrv","MultiXPub","Options","Private","PrivateKeyGenerateOptions","Public","ScriptContext","ScriptContextEnum","Segwitv0","Single","Single","SinglePriv","SinglePub","SinglePubKey","SortedMultiVec","Tap","ValidNetworks","XOnly","XPrv","XPub","any_network","as_enum","at_derivation_index","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build_template","check_global_consensus_validity","check_global_policy_validity","check_global_validity","check_local_consensus_validity","check_local_policy_validity","check_local_validity","check_pk","check_terminal_non_malleable","check_witness","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","compressed","default","deref","derive","deserialize","encode","eq","eq","eq","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","for_each_key","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_public","from_secret","from_str","from_str","from_tree","full_derivation_path","full_derivation_paths","generate","generate_default","generate_with_entropy","generate_with_entropy_default","has_secret","has_wildcard","hash","hash","hash","hash","into","into","into","into","into","into","into","into","into","into","into","into","into_assets","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_extended_key","into_extended_key","into_extended_key","into_key","into_single_keys","into_single_keys","into_xprv","into_xpub","is_deriveable","is_legacy","is_legacy","is_multipath","is_multipath","is_segwit_v0","is_segwit_v0","is_taproot","is_taproot","is_uncompressed","is_x_only_key","k","key","key","lift","mainnet_network","master_fingerprint","max_satisfaction_size","max_satisfaction_size","max_satisfaction_witness_elements","merge_networks","name_str","new","num_der_paths","origin","origin","other_top_level_checks","override_valid_networks","partial_cmp","partial_cmp","partial_cmp","partial_cmp","pk_len","pks","provide","sanity_check","satisfy","script_size","serialize","sig_type","sorted_node","test_networks","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_public","to_string","to_string","to_string","to_string","top_level_checks","top_level_type_check","translate_pk","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","PsbtUtils","fee_amount","fee_rate","get_utxo_for","AddressInfo","ApplyBlockError","Balance","CannotConnect","ChangeSet","ConfirmationHeightCannotBeGreaterThanTip","Descriptor","Descriptor","Descriptor","InsertTxError","IsDust","LoadError","LoadedGenesisDoesNotMatch","LoadedNetworkDoesNotMatch","MissingGenesis","MissingNetwork","NewError","NewOrLoadError","NonEmptyDatabase","NotInitialized","NotInitialized","Persist","Persist","Persist","UnexpectedConnectedToHash","Update","Wallet","add","add_signer","address","all_unbounded_spk_iters","append","apply_block","apply_block_connected_to","apply_unconfirmed_txs","apply_update","as_ref","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build_fee_bump","build_tx","calculate_fee","calculate_fee_rate","cancel_tx","chain","chain","checkpoints","clone","clone","clone","clone_into","clone_into","clone_into","coin_selection","commit","confirmed","default","default","default","deref","derivation_index","derivation_of_spk","descriptor_checksum","deserialize","deserialize","eq","eq","eq","error","export","finalize_psbt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","get_balance","get_descriptor_for_keychain","get_psbt_input","get_signers","get_tx","get_utxo","graph","immature","index","indexed_tx_graph","insert_checkpoint","insert_tx","insert_txout","into","into","into","into","into","into","into","into","into","into","is_dust","is_empty","is_mine","keychain","keychains","last_active_indices","latest_checkpoint","list_output","list_unspent","list_unused_addresses","load","local_chain","mark_used","network","network","new","new_no_persist","new_no_persist_with_genesis_hash","new_or_load","new_or_load_with_genesis_hash","new_with_genesis_hash","next_derivation_index","next_unused_address","peek_address","policies","provide","provide","provide","provide","provide","public_descriptor","reveal_addresses_to","reveal_next_address","secp_ctx","sent_and_received","serialize","serialize","sign","signer","spk_index","staged","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","to_string","to_string","to_string","total","transactions","trusted_pending","trusted_spendable","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tx_builder","tx_graph","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unbounded_spk_iter","unmark_used","untrusted_pending","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","wallet_name_from_descriptor","connected_to_hash","expected_hash","tip_height","tx_height","expected","expected","got","got","BnBNoExactMatch","BnBTotalTriesExceeded","BranchAndBoundCoinSelection","Change","CoinSelectionAlgorithm","CoinSelectionResult","DefaultCoinSelectionAlgorithm","Error","Excess","InsufficientFunds","LargestFirstCoinSelection","NoChange","OldestFirstCoinSelection","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","coin_select","coin_select","coin_select","coin_select","decide_change","default","default","default","excess","fee_amount","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","into","into","into","into","into","into","local_selected_amount","new","provide","selected","selected_amount","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","available","needed","amount","change_fee","dust_threshold","fee","remaining_amount","BuildFeeBumpError","ChangePolicyDescriptor","CoinSelection","Conversion","CreateTxError","Descriptor","FeeRateTooLow","FeeRateUnavailable","FeeTooLow","InsufficientFunds","IrreplaceableTransaction","LockTime","MiniscriptPsbt","MiniscriptPsbtError","MissingKeyOrigin","MissingNonWitnessUtxo","NoRecipients","NoUtxosSelected","OutputBelowDustLimit","OutputUpdate","Persist","Policy","Psbt","RbfSequence","RbfSequenceCsv","SpendingPolicyRequired","TransactionConfirmed","TransactionNotFound","UnknownUtxo","UnknownUtxo","UtxoUpdate","Version0","Version1Csv","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","into","into","into","provide","provide","provide","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","available","csv","needed","rbf","requested","required","required","required","FullyNodedExport","WalletExport","blockheight","borrow","borrow_mut","change_descriptor","descriptor","deserialize","export_wallet","fmt","from","from_str","into","label","serialize","to_string","try_from","try_into","type_id","vzip","All","Dummy","Exclude","External","Fingerprint","Include","InputIndexOutOfRange","InputSigner","InvalidKey","InvalidNonWitnessUtxo","InvalidSighash","Legacy","MiniscriptPsbt","MissingHdKeypath","MissingKey","MissingNonWitnessUtxo","MissingWitnessScript","MissingWitnessUtxo","NonStandardSighash","None","PkHash","Segwitv0","SighashError","SignOptions","SignerCommon","SignerContext","SignerError","SignerId","SignerOrdering","SignerWrapper","SignersContainer","Tap","TapLeavesOptions","TransactionSigner","UserCanceled","add_external","allow_all_sighashes","allow_grinding","as_key_map","assume_height","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","default","default","default","default","deref","descriptor_secret_key","descriptor_secret_key","descriptor_secret_key","descriptor_secret_key","eq","eq","eq","eq","find","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","hash","id","id","id","id","ids","into","into","into","into","into","into","into","into","new","new","partial_cmp","partial_cmp","provide","remove","remove_partial_sigs","remove_taproot_extras","sign_input","sign_input","sign_input","sign_input","sign_transaction","sign_transaction","sign_with_tap_internal_key","signers","tap_leaves_options","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","trust_witness_utxo","try_finalize","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","is_internal_key","AddForeignUtxoError","AddUtxoError","AllowShrinkingError","Bip69Lexicographic","BumpFee","ChangeAllowed","ChangeForbidden","ChangeSpendPolicy","CreateTx","InvalidOutpoint","InvalidTxid","MissingScriptPubKey","MissingUtxo","OnlyChange","Shuffle","TxBuilder","TxBuilderContext","TxOrdering","UnknownUtxo","Untouched","add_data","add_foreign_utxo","add_foreign_utxo_with_sequence","add_global_xpubs","add_recipient","add_unspendable","add_utxo","add_utxos","allow_dust","allow_shrinking","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","change_policy","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","coin_selection","current_height","default","default","default","default","do_not_spend_change","drain_to","drain_wallet","enable_rbf","enable_rbf_with_sequence","eq","eq","fee_absolute","fee_rate","finish","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","hash","hash","include_output_redeem_witness_script","into","into","into","into","into","into","into","into","manually_selected_only","nlocktime","only_spend_change","only_witness_utxo","ordering","partial_cmp","partial_cmp","policy_path","provide","provide","provide","set_recipients","sighash","sort_tx","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unspendable","version","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","foreign_utxo","input_txid"],"q":["bdk","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::Utxo","","","bdk::descriptor","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::descriptor::checksum","","bdk::descriptor::error","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::descriptor::policy","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::descriptor::policy::BuildSatisfaction","","","bdk::descriptor::policy::Satisfaction","","","","","","","","","","","bdk::descriptor::policy::SatisfiableItem","","","","","","","","","","bdk::descriptor::template","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::keys","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::psbt","","","","bdk::wallet","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::wallet::ApplyBlockError","","bdk::wallet::InsertTxError","","bdk::wallet::NewOrLoadError","","","","bdk::wallet::coin_selection","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::wallet::coin_selection::Error","","bdk::wallet::coin_selection::Excess","","","","","bdk::wallet::error","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::wallet::error::CreateTxError","","","","","","","","bdk::wallet::export","","","","","","","","","","","","","","","","","","","","bdk::wallet::signer","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::wallet::signer::SignerContext","bdk::wallet::tx_builder","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::wallet::tx_builder::AddForeignUtxoError",""],"d":["External keychain, used for deriving recipient addresses.","A UTXO owned by another wallet.","","Internal keychain, used for deriving change addresses.","Types of keychains","A UTXO owned by the local wallet.","An unspent output owned by a Wallet.","","","An unspent transaction output (UTXO).","","A Utxo with its satisfaction_weight.","Return KeychainKind as a byte","","","","","","","","","","","","","","","","","","","","The confirmation time for transaction containing this utxo","The derivation index for the script pubkey in the wallet","Descriptors","Macro to write full descriptors with code","","","","","","","","","","","Macro to write descriptor fragments with code","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Whether this UTXO is spent or not","Type of keychain","Key formats","Get the location of the UTXO","Reference to a transaction output","","Additional functions on the rust-bitcoin Psbt structure.","The weight of the witness data and scriptSig expressed in …","Get the sequence number if an explicit sequence number has …","","","","","","","","","","","","","","","","","Get the TxOut of the UTXO","Transaction output","","","","","The UTXO","Get the version of BDK at runtime","","","","","Wallet","The location of the output.","The information about the input we require to add it to a …","The nSequence value to set for this input.","A raw scriptpubkey (including pay-to-pubkey) under Legacy …","Alias for a Descriptor that contains extended derived keys","Script descriptor","","The descriptor pubkey, either a single pubkey or an xpub.","Alias for a Descriptor that can contain extended keys …","Trait implemented on Descriptors to add a method to …","Alias for the type of maps that represent derivation paths …","Trait for types which can be converted into an …","The consensus key associated with the type. Must be a …","Legacy ScriptContext To be used as P2SH scripts For …","The top-level miniscript abstract syntax tree (AST).","Multiple extended public keys.","Pay-to-PubKey-Hash","","The ScriptContext for Miniscript. Additional type …","Segwitv0 ScriptContext","Pay-to-ScriptHash(includes nested wsh/wpkh/sorted multi)","Single public key.","Alias for the type of maps that represent taproot key …","Pay-to-Taproot","Pay-to-Witness-PubKey-Hash","Pay-to-Witness-ScriptHash with Segwitv0 context","Extended public key (xpub).","Computes the Bitcoin address of the descriptor, if one …","","","Get a reference to the inner AstElem representing the root …","","Replaces all wildcards (i.e. /*) in the descriptor with a …","","","","","","","","","Enumerates all child nodes of the current AST node (self) …","Attempt to produce a non-malleable witness template given …","Attempt to produce a malleable witness template given the …","","Depending on script Context, some of the Terminals might …","","","Depending on script Context, some of the script resource …","","Check the consensus + policy(if not disabled) rules that …","Consensus rules at the Miniscript satisfaction time. It is …","","","Policy rules at the Miniscript satisfaction time. It is …","","","Check the consensus + policy(if not disabled) rules …","Each context has slightly different rules on what Pks are …","","","Depending on ScriptContext, fragments can be malleable. …","","","Check whether the given satisfaction is valid under the …","","","Descriptor checksum","","","","","","","","","","","","","Whether the given miniscript contains a raw pkh fragment","Deprecated name for Self::at_derivation_index.","Convert all the public keys in the descriptor to …","Convert all the public keys in the descriptor to …","Get the DescriptorType of Descriptor","","","","Encode as a Bitcoin script","","","","","Descriptor errors","Computes the the underlying script before any hashing is …","Additional information helpful for extra analysis.","Check whether the miniscript follows the given Extra …","Extract the spending policy","","","Utility method for deriving the descriptor at each index …","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Add type information(Type and Extdata) to Miniscript based …","Create a new Miniscript from a Terminal node and a Type …","","Parse a Miniscript from string and perform sanity checks …","Attempt to parse an Miniscripts that don’t follow the …","Attempt to parse an insane(scripts don’t clear sanity …","Parse an expression tree into a descriptor.","Parse an expression tree into a Miniscript. As a general …","Returns child node with given index, if any","Returns Option::Some with cloned n’th public key from …","Returns satisfying non-malleable witness and scriptSig to …","Returns a possilbly mallable satisfying non-malleable …","Whether the miniscript contains a combination of timelocks","Whether the miniscript has repeated Pk or Pkh","Whether or not the descriptor has any wildcards i.e. /*.","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Extracts the AstElem representing the root of the …","Get as many descriptors as different paths in this …","Convert to wallet descriptor","","Whether or not the descriptor has any wildcards","Whether this descriptor contains a key that has multiple …","Whether the miniscript is malleable","Creates a new Iter iterator that will iterate over all …","Creates a new PkIter iterator that will iterate over all …","","","Lifting corresponds to conversion of a miniscript into a …","Depending on script context, the size of a satifaction …","","","Maximum size, in bytes, of a satisfying witness. For …","Computes an upper bound on the weight of a satisfying …","Maximum number of witness elements used to satisfy the …","Computes an upper bound on the difference between a …","Local helper function to display error messages with …","","","Create a new bare descriptor from witness script Errors …","Create a new pk descriptor","Create a new PkH descriptor","Create a new sh for a given redeem script Errors when …","Create a new sh sortedmulti descriptor with threshold k …","Create a new sh wrapper for the given wpkh descriptor","Create a new sh wrapper for the given wsh descriptor","Create a new sh wrapped wpkh from Pk. Errors when …","Create a new sh wrapped wsh descriptor with witness script …","Create a new sh wrapped wsh sortedmulti descriptor from …","Create new tr descriptor Errors when miniscript exceeds …","Create a new Wpkh descriptor Will return Err if …","Create a new wsh descriptor from witness script Errors …","Create a new wsh sorted multi descriptor Errors when …","A node in the AST.","Other top level checks that are context specific","Attempt to parse a Script into Miniscript representation.","Parse a descriptor that may contain secret keys","Attempt to parse an insane(scripts don’t clear sanity …","Attempt to parse an miniscript with extra features that …","","","","","Get the len of public key when serialized based on context …","","","Returns a plan if the provided assets are sufficient to …","Returns a plan if the provided assets are sufficient to …","Descriptor policy","Whether all spend paths of miniscript require a signature","Checks whether the descriptor is safe.","Check whether the underlying Miniscript is safe under the …","Attempts to produce a non-malleable satisfying witness and …","Attempt to produce non-malleable satisfying witness for the","Attempt to produce a malleable satisfying witness for the …","Computes the scriptCode of a transaction output.","Computes the scriptpubkey of the descriptor.","Size, in bytes of the script-pubkey. If this Miniscript is …","","","The type of signature required for satisfaction","","","Substitutes raw public keys hashes with the public keys as …","Descriptor templates","","","","","","","Serialize a descriptor to string with its secret keys","Check top level consensus rules.","Check whether the top-level is type B","Converts a descriptor using abstract keys to one using …","Translates a struct from one generic to another where the …","","","","","","","","","The correctness and malleability type information for the …","","","","","Computes the scriptSig that will be in place for an …","","","","","Whether the miniscript can exceed the resource …","Compute the checksum of a descriptor, excludes any …","Compute the checksum bytes of a descriptor, excludes any …","Error during base58 decoding","BIP32 error","Errors related to the parsing and usage of descriptors","The descriptor contains hardened derivation steps on …","Hex decoding error","Invalid byte found in the descriptor checksum","The provided descriptor doesn’t match its checksum","Invalid HD Key path, such as having a wildcard but a …","Error thrown while working with keys","Miniscript error","The descriptor contains multipath keys","Key-related error","Error while extracting and manipulating policies","","","","","","Returns the argument unchanged.","","","","","","","Calls U::from(self).","","","","","","","Absolute timeclock timestamp","Can not add to an item that is Satisfaction::None or …","Can not add to an item that is …","Options to build the satisfaction field in the policy","Can satisfy the policy item","An extra condition that must be satisfied but that is out …","Type for a map of sets of Condition items keyed by each set…","ECDSA Signature for a raw public key","An extended key fingerprint","Type for a map of folded sets of Condition items keyed by …","SHA256 then RIPEMD160 preimage hash","Double SHA256 preimage hash","Incompatible conditions (not currently used)","Index out of range for an item to satisfy a …","Can not merge CSV or timelock values unless both are less …","Multi-signature public keys with threshold count","Cannot satisfy or contribute to the policy item","Don’t generate satisfaction field","Not enough items are selected to satisfy a …","Only a partial satisfaction of some kind of threshold …","Can reach the threshold of some kind of threshold policy","A unique identifier for a key","Descriptor spending policy","Errors that can happen while extracting and manipulating …","Analyze the given PSBT to check for existing signatures","Like Psbt variant and also check for expired timelocks","A legacy public key","Relative timelock locktime","RIPEMD160 preimage hash","Represent if and how much a policy item is satisfied by …","An item that needs to be satisfied","Schnorr Signature for a raw public key","SHA256 preimage hash","Threshold items with threshold count","A x-only public key","","","","","","","","","","","","","","","","","","","","","","","","","","","How the wallet’s descriptor can satisfy this policy node","Optional CheckSequenceVerify condition","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Return the conditions that are set by the spending policy …","","","Returns a unique id for the SatisfiableItem","Identifier for this policy node","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns whether the SatisfiableItem is a leaf item","Returns whether the Satisfaction is a leaf item","Returns true if there are no extra conditions to verify","Type of this policy node","","","Return whether or not a specific path in the policy tree …","How much a given PSBT already satisfies this policy node …","","","","","","Optional timelock condition","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Current blockchain height","The highest confirmation height between the inputs CSV …","Given PSBT","Extra conditions that also need to be satisfied","Extra conditions that also need to be satisfied","Extra conditions that also need to be satisfied","The items that can be satisfied by the descriptor or are …","The items that can be satisfied by the descriptor","Threshold","Threshold","Total number of items","Total number of items","Whether the items are sorted in lexicographic order (used …","Whether the items are sorted in lexicographic order (used …","The digest value","The digest value","The digest value","The digest value","The policy items","The raw public key or extended key fingerprint","The required threshold count","The required threshold count","The timelock value","The timelock value","BIP44 template. Expands to pkh(key/44'/{0,1}'/0'/{0,1}/*)","BIP44 public template. Expands to pkh(key/{0,1}/*)","BIP49 template. Expands to …","BIP49 public template. Expands to sh(wpkh(key/{0,1}/*))","BIP84 template. Expands to wpkh(key/84'/{0,1}'/0'/{0,1}/*)","BIP84 public template. Expands to wpkh(key/{0,1}/*)","BIP86 template. Expands to tr(key/86'/{0,1}'/0'/{0,1}/*)","BIP86 public template. Expands to tr(key/{0,1}/*)","Trait for descriptor templates that can be built into a …","Type alias for the return type of DescriptorTemplate, …","P2PKH template. Expands to a descriptor pkh(key)","P2TR template. Expands to a descriptor tr(key)","P2WPKH template. Expands to a descriptor wpkh(key)","P2WPKH-P2SH template. Expands to a descriptor sh(wpkh(key))","","","","","","","","","","","","","","","","","","","","","","","","","Build the complete descriptor","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","BIP32 error","Trait for keys that can be derived.","Container for public or secret keys","The descriptor pubkey, either a single pubkey or an xpub.","The descriptor secret key, either a single private key or …","Type specifying the amount of entropy required e.g. [u8;32]","Returned error in case of failure","Trait that adds extra useful methods to ScriptContexts","Enum for extended keys that can be either xprv or xpub","A bitcoin public key (compressed or uncompressed).","Trait that allows generating a key with the default options","Trait for keys that can be generated","Output of a GeneratableKey key generation","Trait for objects that can be turned into a public or …","The key has an invalid checksum","The key is not valid for the given network","The key cannot exist in the given script context","The consensus key associated with the type. Must be a …","Errors thrown while working with keys","Alias type for a map of public key to secret key","Legacy scripts","Custom error message","Miniscript error","Multiple extended private keys.","Multiple extended public keys.","Extra options required by the generate_with_entropy","A private extended key, aka an xprv","Options for generating a PrivateKey","A public extended key, aka an xpub","The ScriptContext for Miniscript. Additional type …","Enum representation of the known valid ScriptContexts","Segwitv0 scripts","Single public key.","Single private key.","A descriptor bitcoin::PrivateKey with optional origin …","A descriptor SinglePubKey with optional origin information.","Single public key without any origin or range information.","Contents of a “sortedmulti” descriptor","Taproot scripts","Set of valid networks for a key","An xonly public key.","Extended private key (xpriv).","Extended public key (xpub).","Create a set containing mainnet, testnet, signet, and …","Returns the ScriptContext as a ScriptContextEnum","Replaces any wildcard (i.e. /*) in the key with a …","","","","","","","","","","","","","","","","","","","","","","","","","Attempt to produce a witness template given the assets …","Depending on script Context, some of the Terminals might …","Depending on script Context, some of the script resource …","Check the consensus + policy(if not disabled) rules that …","Consensus rules at the Miniscript satisfaction time. It is …","Policy rules at the Miniscript satisfaction time. It is …","Check the consensus + policy(if not disabled) rules …","Each context has slightly different rules on what Pks are …","Depending on ScriptContext, fragments can be malleable. …","Check whether the given satisfaction is valid under the …","","","","","","","","","","","","","","","","","","","","","","","Whether the generated key should be “compressed” or not","","","Deprecated name for Self::at_derivation_index.","","Encode as a Bitcoin script","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Create an instance given a public key and a set of valid …","Create an instance given a secret key and a set of valid …","","","Parse an expression tree into a SortedMultiVec","Full path, from the master key","Returns a vector containing the full derivation paths from …","Generate a key given the options with a random entropy","Generate a key with the default options and a random …","Generate a key given the extra options and the entropy","Generate a key with the default options and a given entropy","Return whether or not the key contains the private data","Whether or not the key has a wildcard","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","Turn the key into a DescriptorKey within the requested …","Consume self and turn it into a DescriptorKey by adding …","","","","","","Consume self and turn it into an ExtendedKey","","","Consumes self and returns the key","Get as many keys as derivation paths in this key.","Get as many keys as derivation paths in this key.","Transform the ExtendedKey into an Xpriv for the given …","Transform the ExtendedKey into an Xpub for the given …","Whether or not the key has a wildcard","Returns whether the script context is Legacy","Returns whether the script context is …","Whether or not this key has multiple derivation paths.","Whether or not this key has multiple derivation paths.","Returns whether the script context is Segwitv0","Returns whether the script context is …","Returns whether the script context is Tap, aka Taproot or …","Returns whether the script context is …","","","signatures required","The public key.","The private key.","","Create a set only containing mainnet","The fingerprint of the master key associated with this …","Depending on script context, the size of a satifaction …","Maximum size, in bytes, of a satisfying witness. In …","Maximum number of witness elements used to satisfy the …","Compute the intersection of two sets","Local helper function to display error messages with …","Create a new instance of SortedMultiVec given a list of …","","Origin information (fingerprint and derivation path).","Origin information (fingerprint and derivation path).","Other top level checks that are context specific","Override the computed set of valid networks","","","","","Get the len of public key when serialized based on context …","public keys inside sorted Multi","","utility function to sanity a sorted multi vec","Attempt to produce a satisfying witness for the witness …","Size, in bytes of the script-pubkey. If this Miniscript is …","","The type of signature required for satisfaction","Create Terminal::Multi containing sorted pubkeys","Create a set containing testnet and regtest","","","","","","","","","","Returns the public version of this key.","","","","","Check top level consensus rules.","Check whether the top-level is type B","This will panic if fpk returns an uncompressed key when …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Trait to add functions to extract utxos and calculate fees.","The total transaction fee amount, sum of input amounts …","The transaction’s fee rate. This value will only be …","Get the TxOut for the specified input index, if it doesn’…","A derived address and the index it was found at. For …","An error that may occur when applying a block to Wallet.","Balance, differentiated into various categories.","Occurs when the update chain cannot connect with original …","The changes made to a wallet by applying an Update.","The error variant that occurs when the caller attempts to …","There was problem with the passed-in descriptor(s).","There was a problem with the passed-in descriptor(s).","There is a problem with the passed-in descriptor.","An error that may occur when inserting a transaction into …","Trait to check if a value is below the dust limit. We are …","The error type when loading a Wallet from persistence.","The loaded genesis hash does not match what was provided.","The loaded network type does not match what was provided.","Data loaded from persistence is missing genesis hash.","Data loaded from persistence is missing network type.","The error type when constructing a fresh Wallet.","Error type for when we try load a Wallet from persistence …","Database already has data.","Wallet not initialized, persistence backend is empty.","Wallet is not initialized, persistence backend is empty.","We were unable to write the wallet’s data to the …","Loading data from the persistence backend failed.","Either writing to or loading from the persistence backend …","Occurs when the connected_to hash does not match the hash …","An update to Wallet.","A Bitcoin wallet","","Add an external signer","Address","Get unbounded script pubkey iterators for both Internal …","","Introduces a block of height to the wallet, and tries to …","Applies relevant transactions from block of height to the …","Apply relevant unconfirmed transactions to the wallet.","Applies an update to the wallet and stages the changes …","","","","","","","","","","","","","","","","","","","","","","Bump the fee of a transaction previously created with this …","Start building a transaction.","Calculates the fee of a given transaction. Returns 0 if tx …","Calculate the FeeRate for a given transaction.","Informs the wallet that you no longer intend to broadcast …","Update for the wallet’s internal LocalChain.","Changes to the LocalChain.","Get all the checkpoints the wallet is currently storing …","","","","","","","Coin selection","Commits all currently staged changed to the persistence …","Confirmed and immediately spendable balance","","","","","The derivation index of this wallet. It will return None …","Finds how the wallet derived the script pubkey spk.","Return the checksum of the public descriptor associated to …","","","","","","Errors that can be thrown by the Wallet","Wallet export","Finalize a PSBT, i.e., for each input determine if …","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Return the balance, separated into available, …","Returns the descriptor used to create addresses for a …","get the corresponding PSBT Input for a LocalUtxo","Get the signers","Get a single transaction from the wallet as a CanonicalTx …","Returns the utxo owned by this wallet corresponding to …","Update for the wallet’s internal TxGraph.","All coinbase outputs not yet matured","Child index of this address","Changes to IndexedTxGraph.","Add a new checkpoint to the wallet’s internal view of …","Add a transaction to the wallet’s internal view of the …","Inserts a TxOut at OutPoint into the wallet’s …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Check whether or not a value is below dust limit","","Return whether or not a script is part of this wallet …","Type of keychain","Iterator over all keychains in this wallet","Contains the last active derivation indices per keychain (K…","Returns the latest checkpoint.","List all relevant outputs (includes both spent and …","Return the list of unspent outputs of this wallet","List addresses that are revealed but unused.","Load Wallet from the given persistence backend.","Get a reference to the inner LocalChain.","Marks an address used of the given keychain at index.","Get the Bitcoin network the wallet is using.","Stores the network type of the wallet.","Initialize an empty Wallet.","Creates a wallet that does not persist data.","Creates a wallet that does not persist data, with a custom …","Either loads Wallet from persistence, or initializes it if …","Either loads Wallet from persistence, or initializes it if …","Initialize an empty Wallet with a custom genesis hash.","The index of the next address that you would get if you …","Get the next unused address for the given keychain, i.e. …","Peek an address of the given keychain at index without …","Return the spending policies for the wallet’s descriptor","","","","","","Return the “public” version of the wallet’s …","Reveal addresses up to and including the target index and …","Attempt to reveal the next address of the given keychain.","Return the secp256k1 context used for all signing …","Compute the tx’s sent and received amounts (in satoshis).","","","Sign a transaction with all the wallet’s signers, in the …","Generalized signers","Get a reference to the inner KeychainTxOutIndex.","Returns the changes that will be committed with the next …","","","","","","","","","","","Get the whole balance visible to the wallet.","Iterate over the transactions in the wallet.","Unconfirmed UTXOs generated by a wallet tx","Get sum of trusted_pending and confirmed coins.","","","","","","","","","","","","","","","","","","","","","Transaction builder","Get a reference to the inner TxGraph.","","","","","","","","","","","Get an unbounded script pubkey iterator for the given …","Undoes the effect of mark_used and returns whether the …","Unconfirmed UTXOs received from an external wallet","","","","","","","","","","","Deterministically generate a unique name given the …","Block hash of connected_to.","Expected block hash of connected_to, as derived from block.","The internal chain’s tip height.","The introduced transaction’s confirmation height.","The expected genesis block hash.","The expected network type.","The block hash loaded from persistence.","The network type loaded from persistence.","Branch and bound coin selection tries to avoid needing a …","Branch and bound coin selection possible attempts with …","Branch and bound coin selection","It’s possible to create spendable output from excess …","Trait for generalized coin selection algorithms","Result of a successful coin selection","Default coin selection algorithm used by TxBuilder if not …","Errors that can be thrown by the coin_selection module","Remaining amount after performing coin selection","Wallet’s UTXO set is not enough to cover recipient’s …","Simple and dumb coin selection","It’s not possible to create spendable output from excess …","OldestFirstCoinSelection always picks the utxo with the …","","","","","","","","","","","","","","","","","","","Perform the coin selection","","","","Decide if change can be created","","","","Remaining amount after deducing fees and outgoing outputs","Total fee amount for the selected utxos in satoshis","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","The total value of the inputs selected from the local …","Create new instance with target size for change output","","List of outputs selected for use as inputs","The total value of the inputs selected.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Sats available for spending","Sats needed for some transaction","Effective amount available to create change after …","The calculated fee for the drain TxOut with the selected …","Threshold to consider amount as dust for this particular …","The deducted change output fee","Exceeding amount of current selection over outgoing value …","Error returned from Wallet::build_fee_bump","The change_policy was set but the wallet does not have a …","There was an error with coin selection","Descriptor key conversion error","Error returned from TxBuilder::finish","There was a problem with the descriptors passed in","When bumping a tx the fee rate requested is lower than …","Node doesn’t have data to estimate a fee rate","When bumping a tx the absolute fee requested is lower than …","Wallet’s UTXO set is not enough to cover recipient’s …","Trying to replace a tx that has a sequence >= 0xFFFFFFFE","Requested LockTime is less than is required to spend from …","Miniscript PSBT error","Errors returned by miniscript when updating inconsistent …","In order to use the TxBuilder::add_global_xpubs option …","Missing non_witness_utxo on foreign utxo for given OutPoint","Cannot build a tx without recipients","manually_selected_only option is selected but no utxo has …","Output created is under the dust limit, 546 satoshis","Return error type for …","We were unable to load wallet data from or write wallet …","There was a problem while extracting and manipulating …","Partially signed bitcoin transaction error","Cannot enable RBF with a Sequence >= 0xFFFFFFFE","Cannot enable RBF with Sequence given a required OP_CSV","Spending policy is not compatible with this KeychainKind","Happens when trying to bump a transaction that is already …","Thrown when a tx is not found in the internal database","Happens when trying to spend an UTXO that is not in the …","Happens when trying to spend an UTXO that is not in the …","Return error type for PsbtExt::update_input_with_descriptor","Requested invalid transaction version ‘0’","Requested transaction version 1, but at least 2 is needed …","","","","","","","","","","","","","","","Returns the argument unchanged.","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","Sats available for spending","Required OP_CSV Sequence","Sats needed for some transaction","Given RBF Sequence","Requested LockTime","Required LockTime","Required fee absolute value (satoshi)","Required fee rate","Structure that contains the export of a wallet","Alias for FullyNodedExport","Earliest block to rescan when looking for the wallet’s …","","","Return the internal descriptor, if present","Return the external descriptor","","Export a wallet","","Returns the argument unchanged.","","Calls U::from(self).","Arbitrary label for the wallet","","","","","","","The signer will sign all the leaves it has a key for.","Dummy identifier","The signer won’t sign the specified leaves.","To be used only by external libraries implementing …","The fingerprint of a BIP32 extended key","The signer won’t sign leaves other than the ones …","Input index is out of range","PSBT Input signer","The private key in use has the right fingerprint but …","The non_witness_utxo specified is invalid","Invalid SIGHASH for the signing context in use","Legacy context","Miniscript PSBT error","The fingerprint and derivation path are missing from the …","The private key is missing for the required public key","The non_witness_utxo field of the transaction is required …","The witness_script field of the transaction is required to …","The witness_utxo field of the transaction is required to …","The psbt contains a non-SIGHASH_ALL sighash in one of its …","The signer won’t sign any leaf.","Bitcoin HASH160 (RIPEMD160 after SHA256) hash of an ECDSA …","Segwit v0 context (BIP 143)","Error while computing the hash to sign","Options for a software signer","Common signer methods","Signing context","Signing error","Identifier of a signer in the SignersContainers. Used as a …","Defines the order in which signers are called","Wrapper to pair a signer with its context","Container for multiple signers","Taproot context (BIP 340)","Customize which taproot script-path leaves the signer …","PSBT signer","The user canceled the operation","Adds an external signer to the container for the specified …","Whether the signer should use the sighash_type set in the …","Whether we should grind ECDSA signature to ensure signing …","Create a map of public keys to secret keys","Whether the wallet should assume a specific height has …","","","","","","","","","","","","","","","","","Build a new signer container from a KeyMap","","","","","","","","","","","","","","","","","","","","","","Return the secret key for the signer","","","","","","","","Finds the signer with lowest ordering for a given id in …","","","","","","","","","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Return the SignerId for this signer","","","","Returns the list of identifiers of all the signers in the …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Create a wrapped signer from a signer and a context","Default constructor","","","","Removes a signer from the container and returns it","Whether to remove partial signatures from the PSBT inputs …","Whether to remove taproot specific fields from the PSBT on …","Sign a single psbt input","","","","Sign all the inputs of the psbt","","Whether we should try to sign a taproot transaction with …","Returns the list of signers in the container, sorted by …","Specifies which Taproot script-spend leaves we should sign …","","","","","","","","","Whether the signer should trust the witness_utxo, if the …","Whether to try finalizing the PSBT after the inputs are …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Whether the signer can sign for the internal key or not","Error returned from TxBuilder::add_foreign_utxo.","Error returned from TxBuilder::add_utxo and …","Error returned from TxBuilder::allow_shrinking","BIP69 / Lexicographic","Marker type to indicate the TxBuilder is being used to …","Use both change and non-change outputs (default)","Only use non-change outputs (see …","Policy regarding the use of change outputs when creating a …","Marker type to indicate the TxBuilder is being used to …","Requested outpoint doesn’t exist in the tx (vout greater …","Foreign utxo outpoint txid does not match PSBT input txid","Script/PubKey was not in the original transaction","Foreign utxo missing witness_utxo or non_witness_utxo","Only use change outputs (see TxBuilder::only_spend_change)","Randomized (default)","A transaction builder","Context in which the TxBuilder is valid","Ordering of the transaction’s inputs and outputs","Happens when trying to spend an UTXO that is not in the …","Unchanged","Add data as an output, using OP_RETURN","Add a foreign UTXO i.e. a UTXO not owned by this wallet.","Same as add_foreign_utxo but allows to set the nSequence …","Fill-in the PSBT_GLOBAL_XPUB field with the extended keys …","Add a recipient to the internal list","Add a utxo to the internal list of unspendable utxos","Add a utxo to the internal list of utxos that must be spent","Add the list of outpoints to the internal list of UTXOs …","Set whether or not the dust limit is checked.","Explicitly tells the wallet that it is allowed to reduce …","","","","","","","","","","","","","","","","","Set a specific ChangeSpendPolicy. See …","","","","","","","","","","","","","Choose the coin selection algorithm","Set the current blockchain height.","","","","","Do not spend change outputs","Sets the address to drain excess coins to.","Spend all the available inputs. This respects filters like …","Enable signaling RBF","Enable signaling RBF with a specific nSequence value","","","Set an absolute fee The fee_absolute method refers to the …","Set a custom fee rate.","Finish building the transaction.","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Fill-in the psbt::Output::redeem_script and …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Only spend utxos added by add_utxo.","Use a specific nLockTime while creating the transaction","Only spend change outputs","Only Fill-in the psbt::Input::witness_utxo field when …","Choose the ordering for inputs and outputs of the …","","","Set the policy path to use while creating the transaction …","","","","Replace the recipients already added with a new list","Sign with a specific sig hash","Sort transaction inputs and outputs by TxOrdering variant","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Replace the internal list of unspendable utxos with a new …","Build a transaction with a specific version","","","","","","","","","Foreign UTXO outpoint","PSBT input txid"],"i":[1,5,0,1,0,5,0,0,0,0,0,0,1,1,1,3,4,5,1,3,4,5,0,1,3,4,5,1,3,4,5,1,3,3,0,0,1,3,1,3,4,5,1,3,4,5,0,1,3,4,5,1,3,1,3,4,5,3,3,0,5,3,1,0,4,5,1,3,0,0,1,3,4,5,1,3,4,5,1,3,4,5,5,3,1,3,4,5,4,0,1,3,4,5,0,202,202,202,17,0,0,0,0,0,0,0,0,48,0,0,26,17,0,0,0,17,26,0,17,17,17,26,17,35,36,23,23,17,17,35,36,23,17,35,36,23,23,23,23,0,48,35,36,48,36,48,48,35,36,48,35,36,48,48,35,36,48,35,36,48,35,36,0,17,35,36,23,17,35,36,23,17,35,36,23,23,17,17,17,17,17,23,17,23,17,35,36,23,0,17,23,23,203,17,23,17,17,17,35,36,23,23,17,23,17,17,17,17,17,17,17,35,36,23,23,23,17,23,23,23,17,23,23,23,17,17,23,23,17,17,35,36,23,17,35,36,23,23,17,167,62,17,17,23,23,23,17,23,23,48,35,36,23,17,23,17,48,35,36,17,17,17,17,17,17,17,17,17,17,17,17,17,17,23,48,23,17,23,23,17,35,36,23,48,35,36,17,17,0,23,17,23,17,23,23,17,17,23,17,23,48,35,36,23,0,17,35,36,23,17,23,17,48,48,17,23,17,35,36,23,17,35,36,23,23,17,35,36,23,17,17,35,36,23,23,0,0,47,47,0,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,83,80,80,0,84,0,0,83,82,0,83,83,80,80,80,83,84,45,80,84,84,0,0,0,45,45,82,83,83,0,0,83,83,83,82,82,83,84,46,85,80,45,82,83,84,46,85,80,45,82,83,84,46,85,45,82,83,84,46,85,45,46,85,85,82,83,84,46,85,80,82,83,84,46,85,80,80,45,82,83,84,84,46,46,85,80,45,46,82,85,83,46,82,83,84,46,85,80,45,83,84,85,46,85,80,46,46,82,83,84,46,85,85,82,83,84,46,85,45,80,82,83,84,46,85,80,45,82,83,84,46,85,80,45,82,83,84,46,85,80,45,82,83,84,46,85,80,45,204,204,204,205,206,207,206,207,206,207,206,207,206,207,208,209,210,211,212,213,213,212,214,215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,89,90,92,94,95,96,97,98,99,100,101,88,89,90,92,94,95,96,97,98,99,100,101,216,88,89,90,92,94,95,96,97,98,99,100,101,88,89,90,92,94,95,96,97,98,99,100,101,88,89,90,92,94,95,96,97,98,99,100,101,86,88,89,90,92,94,95,96,97,98,99,100,101,88,89,90,92,94,95,96,97,98,99,100,101,88,89,90,92,94,95,96,97,98,99,100,101,88,89,90,92,94,95,96,97,98,99,100,101,88,89,90,92,94,95,96,97,98,99,100,101,76,0,0,0,0,217,217,0,0,110,0,0,0,0,76,76,76,48,0,0,22,76,76,107,26,217,114,0,114,0,0,22,26,107,0,0,0,0,22,0,110,107,26,0,218,26,114,105,112,22,106,76,103,26,107,108,109,110,114,105,112,22,106,76,103,26,107,108,109,110,103,48,48,48,48,48,48,48,48,48,105,22,106,103,26,107,108,109,110,105,22,106,103,26,107,108,109,110,103,26,108,110,106,106,105,26,26,103,22,103,26,107,108,109,110,112,22,106,76,76,103,103,26,26,107,107,108,109,110,103,114,114,114,105,112,22,106,76,76,76,103,26,26,107,108,109,110,112,112,26,107,103,26,26,217,219,217,219,114,26,103,26,108,110,114,105,112,22,106,76,103,26,107,108,109,110,26,87,93,105,105,112,26,107,93,114,105,105,26,107,114,114,26,218,22,26,107,218,22,218,22,26,26,103,108,109,103,0,26,48,103,103,0,48,103,26,108,109,48,112,103,26,108,110,48,103,76,103,103,103,26,48,103,0,105,22,106,103,26,107,108,109,110,107,76,103,26,107,48,48,103,114,105,112,22,106,76,103,26,107,108,109,110,114,105,112,22,106,76,103,26,107,108,109,110,114,105,112,22,106,76,103,26,107,108,109,110,114,105,112,22,106,76,103,26,107,108,109,110,0,220,220,220,0,0,0,154,0,153,150,151,152,0,0,0,152,152,151,151,0,0,150,151,152,150,151,152,154,0,0,122,123,146,123,128,123,123,123,123,123,122,123,134,128,146,150,151,152,153,154,122,123,134,128,146,150,151,152,153,154,123,123,123,123,123,134,128,123,122,134,128,122,134,128,0,123,122,122,134,128,146,123,123,123,122,128,122,128,146,0,0,123,122,122,123,134,128,146,146,150,150,151,151,152,152,153,153,154,154,122,123,134,128,128,128,146,150,151,152,153,154,123,123,123,123,123,123,134,122,146,128,123,123,123,122,123,134,128,146,150,151,152,153,154,221,128,123,146,123,134,123,123,123,123,123,123,123,123,128,123,123,123,123,123,123,123,123,123,123,150,151,152,153,154,123,123,123,123,123,122,128,123,0,123,123,122,134,128,122,146,150,151,152,153,154,122,123,122,122,122,123,134,128,146,150,151,152,153,154,122,123,134,128,146,150,151,152,153,154,0,123,122,123,134,128,146,150,151,152,153,154,123,123,122,122,123,134,128,146,150,151,152,153,154,0,222,222,223,223,224,225,224,225,178,178,0,179,0,0,0,0,0,178,0,179,0,178,179,177,174,175,176,178,179,177,174,175,176,174,175,176,174,175,176,194,174,175,176,0,174,175,176,177,177,178,178,179,177,174,175,176,178,179,177,174,175,176,178,179,177,174,175,176,177,176,178,177,177,174,175,176,178,178,179,177,174,175,176,178,179,177,174,175,176,178,179,177,174,175,176,178,179,177,174,175,176,226,226,227,228,228,227,228,0,161,161,180,0,161,161,140,161,161,140,161,161,0,161,161,161,161,161,180,161,161,161,161,161,161,140,140,161,140,180,161,161,180,161,140,180,161,140,180,180,180,180,161,161,140,140,180,161,161,161,161,161,161,140,180,161,140,180,161,140,180,180,161,140,180,161,140,180,161,140,180,161,140,180,161,140,229,230,229,230,231,231,232,233,0,0,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,188,183,188,149,183,188,149,0,149,149,149,185,149,149,149,149,149,149,149,188,183,185,149,0,0,0,0,0,0,0,0,185,0,0,149,44,148,148,44,148,183,149,185,187,124,44,148,188,183,149,185,187,124,44,148,188,44,183,185,187,124,44,148,188,183,185,187,124,44,148,188,183,124,124,44,148,188,187,234,187,187,187,183,185,124,188,44,183,149,149,185,187,124,44,148,188,183,183,183,149,149,185,187,124,44,148,188,183,234,187,187,187,44,183,149,185,187,124,44,148,188,187,44,183,124,149,44,148,148,235,187,187,187,125,187,148,44,148,183,185,187,124,44,148,188,149,148,148,183,149,185,187,124,44,148,188,183,149,185,187,124,44,148,188,183,149,185,187,124,44,148,188,183,149,185,187,124,44,148,188,236,0,0,0,199,0,198,198,0,0,195,195,197,195,198,199,0,0,0,196,199,139,139,139,139,139,139,139,139,139,139,141,138,139,196,195,197,199,198,141,138,139,196,195,197,199,198,139,141,138,139,199,198,141,138,139,199,198,199,198,139,139,141,138,199,198,139,139,139,139,139,199,198,139,139,139,141,138,139,196,196,195,195,197,197,199,198,141,138,139,196,195,197,199,198,199,198,139,141,138,139,196,195,197,199,198,139,139,139,139,139,199,198,139,196,195,197,139,139,199,141,138,139,199,198,196,195,197,141,138,139,196,195,197,199,198,141,138,139,196,195,197,199,198,141,138,139,196,195,197,199,198,139,139,141,138,139,196,195,197,199,198,237,237],"f":[0,0,0,0,0,0,0,0,0,0,0,0,[1,2],[1],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[1,1],[3,3],[4,4],[5,5],[[]],[[]],[[]],[[]],[[1,1],6],0,0,0,0,[[],[[7,[1]]]],[[],[[7,[3]]]],[[1,1],8],[[3,3],8],[[4,4],8],[[5,5],8],[[1,9],10],[[3,9],10],[[4,9],10],[[5,9],10],0,[[]],[[]],[[]],[[]],[1],[3],[[]],[[]],[[]],[[]],0,0,0,[5,11],0,[[1,1],[[12,[6]]]],0,0,[5,[[12,[13]]]],[1,7],[3,7],0,0,[[]],[[]],[[]],[[]],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[5,14],0,[[],15],[[],15],[[],15],[[],15],0,[[],16],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[17,18],[[7,[[20,[19]],21]]]],[[],22],[[],22],[23,24],[23,[[25,[23]]]],[[[17,[26]],27],[[7,[[17,[28]],29]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[23,[[31,[23,30]]]],[23,[[33,[32]]]],[23,[[33,[32]]]],0,[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[[],[[7,[34]]]],[[],[[7,[34]]]],[[],[[7,[34]]]],[24,[[7,[34]]]],[24,[[7,[34]]]],[24,[[7,[34]]]],[[],[[7,[34]]]],[[],[[7,[34]]]],[[],[[7,[34]]]],0,[17,17],[35,35],[36,36],[23,23],[[]],[[]],[[]],[[]],[[17,17],6],[[35,35],6],[[36,36],6],[[23,23],6],[23,8],[[[17,[26]],27],[[7,[[17,[28]],29]]]],[[[17,[28]],37],[[7,[[17,[38]],29]]]],[[[17,[26]],37,27],[[7,[[17,[38]],29]]]],[17,39],[[],[[7,[17]]]],[[],[[7,[23]]]],[[[17,[26]]],40],[23,41],[[17,17],8],[[35,35],8],[[36,36],8],[[23,23],8],0,[17,[[7,[41,21]]]],0,[[23,42],[[7,[43]]]],[[44,45,37],[[7,[[12,[46]],47]]]],[[[17,[26]],44,45,37],[[7,[[12,[46]],47]]]],[[[23,[26,48]],44,45,37],[[7,[[12,[46]],47]]]],[[[17,[26]],37,49,[50,[27]]],[[7,[12,29]]]],[[17,9],[[7,[51]]]],[[17,9],[[7,[51]]]],[[35,9],[[7,[51]]]],[[36,9],[[7,[51]]]],[[23,9],[[7,[51]]]],[[23,9],[[7,[51]]]],[17,8],[23,8],[52,17],[53,17],[54,17],[55,17],[56,17],[57,17],[[]],[[]],[[]],[[]],[24,[[7,[23,21]]]],[[24,58,59],23],[16,[[7,[17,21]]]],[16,[[7,[23,21]]]],[[16,42],[[7,[23,21]]]],[16,[[7,[23,21]]]],[60,[[7,[17,21]]]],[60,[[7,[23,21]]]],[[23,61],[[12,[23]]]],[[23,61],12],[17,[[7,[21]]]],[17,[[7,[21]]]],[23,8],[23,8],[[[17,[26]]],8],[17],[35],[36],[23],[[]],[[]],[[]],[[]],[23,24],[[[17,[26]]],[[7,[[31,[[17,[26]],30]],21]]]],[[37,18],[[7,[47]]]],[[62,37,18],[[7,[47]]]],[[[17,[26]]],8],[[[17,[26]]],8],[23,8],[23,63],[23,64],[17,[[7,[65,21]]]],[23,[[7,[65,21]]]],[23,[[7,[66]]]],[23,[[12,[61]]]],[23,[[12,[61]]]],[23,[[12,[61]]]],[23,[[7,[61,21]]]],[17,[[7,[61,21]]]],[23,[[7,[61,21]]]],[17,[[7,[61,21]]]],[[],16],[[],16],[[],16],[[[23,[67]]],[[7,[17,21]]]],[[],17],[[],[[7,[17,21]]]],[[[23,[35]]],[[7,[17,21]]]],[[61,[31,[30]]],[[7,[17,21]]]],[55,17],[53,17],[[],[[7,[17,21]]]],[[[23,[36]]],[[7,[17,21]]]],[[61,[31,[30]]],[[7,[17,21]]]],[[[12,[68]]],[[7,[17,21]]]],[[],[[7,[17,21]]]],[[[23,[36]]],[[7,[17,21]]]],[[61,[31,[30]]],[[7,[17,21]]]],0,[23,[[7,[21]]]],[49,[[7,[23,21]]]],[[37,16],[[7,[21]]]],[49,[[7,[23,21]]]],[[49,42],[[7,[23,21]]]],[[17,17],[[12,[6]]]],[[35,35],[[12,[6]]]],[[36,36],[[12,[6]]]],[[23,23],[[12,[6]]]],[[],61],[[],61],[[],61],[[[17,[28]]],[[7,[69,[17,[28]]]]]],[[[17,[28]]],[[7,[69,[17,[28]]]]]],0,[23,8],[17,[[7,[21]]]],[23,[[7,[43]]]],[[17,70],[[7,[21]]]],[23,[[7,[[31,[[31,[2,30]],30]],21]]]],[23,[[7,[[31,[[31,[2,30]],30]],21]]]],[17,[[7,[41,21]]]],[17,41],[23,61],[17,7],[23,7],[[],71],[[],71],[[],71],[[23,72],23],0,[[]],[[]],[[]],[[]],[[],73],[[],73],[[[17,[26]],72],73],[23,[[7,[21]]]],[23,[[7,[21]]]],[17,[[7,[74]]]],[23,[[7,[74]]]],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],0,[[],15],[[],15],[[],15],[[],15],[17,41],[[]],[[]],[[]],[[]],[23,8],[16,[[7,[73,47]]]],[16,[[7,[47]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[47,9],10],[[47,9],10],[75,47],[[]],[76,47],[77,47],[78,47],[79,47],[21,47],[80,47],[[]],[81],[[],73],[[],7],[[],7],[[],15],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[82,82],[83,83],[84,84],[46,46],[85,85],[45,45],[[]],[[]],[[]],[[]],[[]],[[]],0,0,[[],85],[[82,82],8],[[83,83],8],[[84,84],8],[[46,46],8],[[85,85],8],[[80,80],8],[[82,9],10],[[83,9],10],[[84,9],10],[[46,9],10],[[85,9],10],[[80,9],10],[[80,9],10],[[45,9],10],[[]],[[]],[[]],[8,84],[[]],[83,46],[[]],[[]],[[]],[[46,72],[[7,[85,80]]]],[82],[85],[83,73],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[83,8],[84,8],[85,8],0,[[85,85],[[12,[6]]]],[81],[46,8],0,[82,7],[83,7],[84,7],[46,7],[85,7],0,[[]],[[]],[[]],[[]],[[]],[[]],[[],73],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[18,[[7,[86,47]]]],[[[88,[[87,[35]]]],18],[[7,[86,47]]]],[[[89,[[87,[36]]]],18],[[7,[86,47]]]],[[[90,[[87,[36]]]],18],[[7,[86,47]]]],[[[92,[[87,[91]]]],18],[[7,[86,47]]]],[[[94,[[93,[35]]]],18],[[7,[86,47]]]],[[[95,[[93,[35]]]],18],[[7,[86,47]]]],[[[96,[[93,[36]]]],18],[[7,[86,47]]]],[[[97,[[93,[36]]]],18],[[7,[86,47]]]],[[[98,[[93,[36]]]],18],[[7,[86,47]]]],[[[99,[[93,[36]]]],18],[[7,[86,47]]]],[[[100,[[93,[91]]]],18],[[7,[86,47]]]],[[[101,[[93,[91]]]],18],[[7,[86,47]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[86,37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[],102],[[],22],[[26,27],[[7,[28,29]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[103,[[33,[32]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[[],[[7,[34]]]],[24,[[7,[34]]]],[[],[[7,[34]]]],[[[105,[104,48]]],[[105,[104,48]]]],[22,22],[106,106],[103,103],[26,26],[107,107],[108,108],[109,109],[110,110],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[103,103],6],[[26,26],6],[[108,108],6],[[110,110],6],0,[[],106],[[[105,[48]]]],[[26,27],[[7,[28,29]]]],[[],[[7,[26]]]],[103,41],[[22,22],8],[[103,103],8],[[26,26],8],[[107,107],8],[[108,108],8],[[109,109],8],[[110,110],8],[[[112,[[0,[111,48]]]],9],10],[[22,9],10],[[106,9],10],[[76,9],10],[[76,9],10],[[103,9],[[7,[51]]]],[[103,9],[[7,[51]]]],[[26,9],[[7,[51]]]],[[26,9],[[7,[51]]]],[[107,9],[[7,[51]]]],[[107,9],[[7,[51]]]],[[108,9],[[7,[51]]]],[[109,9],[[7,[51]]]],[[110,9],[[7,[51]]]],[103,8],[[]],[113,[[114,[48]]]],[115,[[114,[48]]]],[[]],[[]],[[]],[[]],[77,76],[21,76],[[]],[[]],[28,26],[[]],[[]],[[]],[[]],[[]],[[26,102],[[112,[48]]]],[[107,102],[[112,[48]]]],[16,[[7,[26]]]],[16,[[7,[107]]]],[60,[[7,[103,21]]]],[26,[[12,[116]]]],[26,[[31,[116,30]]]],[[],[[7,[105]]]],[[],[[7,[105]]]],[[],[[7,[105]]]],[[],[[7,[105]]]],[[[114,[48]]],8],[26,8],[103],[26],[108],[110],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[26,117],[[],[[7,[112,76]]]],[[[12,[118]],116],[[7,[112,76]]]],[[105,[12,[118]],116],[[7,[112,76]]]],[105,[[7,[112,76]]]],[[[112,[48]]],[[7,[[112,[48]],76]]]],[26,[[7,[[112,[48]],76]]]],[107,[[7,[[112,[48]],76]]]],[[],[[7,[114,76]]]],[[[114,[48]]],[[7,[[114,[48]],76]]]],[105,[[7,[114,76]]]],[[[105,[48]]]],[26,[[31,[26,30]]]],[107,[[31,[107,30]]]],[[[114,[48]],18],[[12,[113]]]],[[[114,[48]],18,37],115],[26,8],[[],8],[22,8],[26,8],[107,8],[[],8],[22,8],[[],8],[22,8],[26,8],[26,8],0,0,0,[103,[[7,[65,21]]]],[[],102],[26,119],[23,[[12,[61]]]],[103,61],[103,61],[[102,102],102],[[],16],[[61,[31,[30]]],[[7,[103,21]]]],[26,61],0,0,[23,[[7,[21]]]],[[[112,[48]],102],[[112,[48]]]],[[103,103],[[12,[6]]]],[[26,26],[[12,[6]]]],[[108,108],[[12,[6]]]],[[110,110],[[12,[6]]]],[[],61],0,[81],[103,[[7,[21]]]],[103,[[7,[[31,[[31,[2,30]],30]],21]]]],[103,61],[26,7],[[],71],[103,24],[[],102],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[107,37],[[7,[26,120]]]],[[],73],[[],73],[[],73],[[],73],[23,[[7,[21]]]],[23,[[7,[21]]]],[103,[[7,[103,74]]]],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[[],[[12,[40]]]],[[],[[12,[121]]]],[61,[[12,[14]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[122,122],122],[[123,1,124,[126,[125]]]],0,[123,[[72,[1,[0,[127,104]]]]]],[[128,128]],[[123,129,27],[[7,[130]]]],[[123,129,27,131],[[7,[132]]]],[[123,133]],[[123,134],[[7,[130]]]],[123,135],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[123,136],[[7,[[139,[137,138]],140]]]],[123,[[139,[137,141]]]],[[123,142],[[7,[40,143]]]],[[123,142],[[7,[121,143]]]],[[123,142]],0,0,[123,144],[122,122],[134,134],[128,128],[[]],[[]],[[]],0,[123,[[145,[8]]]],0,[[],122],[[],134],[[],128],[146],[[123,1],[[12,[27]]]],[[123,49],12],[[123,1],73],[[],[[7,[122]]]],[[],[[7,[128]]]],[[122,122],8],[[128,128],8],[[146,146],8],0,0,[[123,147,148],[[7,[8,149]]]],[[122,9],[[7,[51]]]],[[122,9],[[7,[51]]]],[[123,9],10],[[134,9],10],[[128,9],10],[[146,9],10],[[146,9],10],[[150,9],10],[[150,9],10],[[151,9],10],[[151,9],10],[[152,9],10],[[152,9],10],[[153,9],10],[[153,9],10],[[154,9],10],[[154,9],10],[[]],[[]],[[]],[155,128],[[[158,[156,[157,[1]]]]],128],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[123,122],[[123,1],62],[[123,3,[12,[159]],8],[[7,[160,161]]]],[[123,1],[[126,[44]]]],[[123,136],[[12,[[162,[[126,[142]],156]]]]]],[[123,11],[[12,[3]]]],0,0,0,0,[[123,131],[[7,[8,163]]]],[[123,142,164],[[7,[8,153]]]],[[123,11,14]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[49,8],[128,8],[[123,49],8],0,[123,72],0,[123,165],[123,127],[123,127],[[123,1],166],[[167,[12,[167]],[0,[[168,[128]],169,170]]],[[7,[123,151]]]],[123,171],[[123,1,27],8],[123,18],0,[[167,[12,[167]],[0,[[168,[128]],169,170]],18],[[7,[123,150]]]],[[167,[12,[167]],18],[[7,[123,47]]]],[[167,[12,[167]],18,172],[[7,[123,47]]]],[[167,[12,[167]],[0,[[168,[128]],169,170]],18],[[7,[123,152]]]],[[167,[12,[167]],[0,[[168,[128]],169,170]],18,172],[[7,[123,152]]]],[[167,[12,[167]],[0,[[168,[128]],169,170]],18,172],[[7,[123,150]]]],[[123,1],27],[[123,1],[[145,[146]]]],[[123,1,27],146],[[123,1],[[7,[[12,[46]],47]]]],[81],[81],[81],[81],[81],[[123,1],[[12,[62]]]],[[123,1,27],[[145,[127]]]],[[123,1],[[145,[146]]]],[123,37],[[123,142]],[122,7],[128,7],[[123,147,148],[[7,[8,149]]]],0,[123,173],[123,128],[[]],[[]],[[]],[[],73],[[],73],[[],73],[[],73],[[],73],[[],73],[[],73],[122,40],[123,127],0,[122,40],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],0,[123,135],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[123,1],[[0,[127,104]]]],[[123,1,27],8],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[12,18,37],[[7,[73,47]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[174,174],[175,175],[176,176],[[]],[[]],[[]],[[[31,[4]],[31,[4]],121,40,49],[[7,[177,178]]]],[[174,[31,[4]],[31,[4]],121,40,49],[[7,[177,178]]]],[[175,[31,[4]],[31,[4]],121,40,49],[[7,[177,178]]]],[[176,[31,[4]],[31,[4]],121,40,49],[[7,[177,178]]]],[[40,121,49],179],[[],174],[[],175],[[],176],0,0,[[178,9],10],[[178,9],10],[[179,9],10],[[177,9],10],[[174,9],10],[[175,9],10],[[176,9],10],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[177,40],[40,176],[81],0,[177,40],[[]],[[]],[[]],[[],73],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[180,180],[[]],[[180,9],10],[[180,9],10],[[161,9],10],[[161,9],10],[[140,9],10],[[140,9],10],[[]],[178,161],[181,161],[180,161],[80,161],[47,161],[[]],[[]],[[]],[[]],[[]],[81],[81],[81],[[]],[[],73],[[],73],[[],73],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],15],[[],15],[[],15],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[182,[[12,[73]]]],[182,73],[[],[[7,[182]]]],[[123,16,8],[[7,[182,16]]]],[[182,9],10],[[]],[16,[[7,[182]]]],[[]],0,[182,7],[182,73],[[],7],[[],7],[[],15],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[44,183,124,[126,[125]]],[[12,[[126,[125]]]]]],0,0,[[44,37],184],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[184,17,37],44],[183,183],[185,185],[[[187,[[0,[104,186,111,104]]]]],[[187,[[0,[104,186,111,104]]]]]],[124,124],[44,44],[148,148],[188,188],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[183,183],6],[[124,124],6],[[],124],[[],44],[[],148],[[],188],[[[187,[[0,[186,111,104]]]]]],[[],[[12,[107]]]],[[[187,[[189,[113]]]]],[[12,[107]]]],[[[187,[[190,[113]]]]],[[12,[107]]]],[[[187,[191]]],[[12,[107]]]],[[183,183],8],[[185,185],8],[[124,124],8],[[188,188],8],[[44,183],[[12,[126]]]],[[183,9],10],[[149,9],10],[[149,9],10],[[185,9],10],[[[187,[[0,[111,186,111,104]]]],9],10],[[124,9],10],[[44,9],10],[[148,9],10],[[188,9],10],[[]],[119,183],[192,183],[193,149],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[183],[37,183],[[[187,[[190,[113]]]],37],183],[[[187,[191]],37],183],[[[187,[[189,[113]]]],37],183],[44,[[31,[183]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[0,[186,111,104]],185],[[187,[[0,[186,111,104]]]]]],[[],44],[[183,183],[[12,[6]]]],[[124,124],[[12,[6]]]],[81],[[44,183,124],[[12,[[126,[125]]]]]],0,0,[[147,61,148,37],[[7,[149]]]],[[[187,[[190,[113]]]],147,61,148,37],[[7,[149]]]],[[[187,[[189,[113]]]],147,61,148,37],[[7,[149]]]],[[[187,[191]],147,61,148,37],[[7,[149]]]],[[147,148,37],[[7,[149]]]],[[147,148,37],[[7,[149]]]],0,[44,[[31,[126]]]],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],73],0,0,[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[[139,[194,141]]],[[139,[194,141]]]],[[139,11,160,61],[[7,[139,195]]]],[[139,11,160,61,13],[[7,[139,195]]]],[139,139],[[[139,[194,141]],41,40],[[139,[194,141]]]],[[139,11],139],[[139,11],[[7,[139,196]]]],[139,[[7,[139,196]]]],[[139,8],139],[[[139,[137,138]],41],[[7,[[139,[137,138]],197]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[139,198],139],[141,141],[138,138],[[[139,[104]]],[[139,[104]]]],[199,199],[198,198],[[]],[[]],[[]],[[]],[[]],[[199,199],6],[[198,198],6],[[139,194],[[139,[194]]]],[[139,27],139],[[],141],[[],138],[[],199],[[],198],[139,139],[[[139,[194,141]],41],[[139,[194,141]]]],[139,139],[139,139],[[139,13],139],[[199,199],8],[[198,198],8],[[139,40],139],[[139,121],139],[[[139,[194]]],[[7,[147,161]]]],[[141,9],10],[[138,9],10],[[[139,[111,111]],9],10],[[196,9],10],[[196,9],10],[[195,9],10],[[195,9],10],[[197,9],10],[[197,9],10],[[199,9],10],[[198,9],10],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[199],[198],[139,139],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[139,139],[[139,200],139],[139,139],[139,139],[[139,199],139],[[199,199],[[12,[6]]]],[[198,198],[[12,[6]]]],[[139,[72,[73,[31,[61]]]],1],139],[81],[81],[81],[[[139,[194,141]],31],[[139,[194,141]]]],[[139,159],139],[[199,142]],[[]],[[]],[[]],[[]],[[]],[[],73],[[],73],[[],73],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[139,[31,[11]]],139],[[139,201],139],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0],"p":[[4,"KeychainKind"],[15,"u8"],[3,"LocalOutput"],[3,"WeightedUtxo"],[4,"Utxo"],[4,"Ordering"],[4,"Result"],[15,"bool"],[3,"Formatter"],[6,"Result"],[3,"OutPoint"],[4,"Option"],[3,"Sequence"],[3,"TxOut"],[3,"TypeId"],[15,"str"],[4,"Descriptor"],[4,"Network"],[4,"NetworkChecked"],[3,"Address"],[4,"Error"],[4,"ScriptContextEnum"],[3,"Miniscript"],[4,"Terminal"],[4,"Tree"],[4,"DescriptorPublicKey"],[15,"u32"],[3,"DefiniteDescriptorKey"],[4,"ConversionError"],[3,"Global"],[3,"Vec"],[4,"Placeholder"],[3,"Satisfaction"],[4,"ScriptContextError"],[4,"Legacy"],[4,"Segwitv0"],[3,"Secp256k1"],[3,"PublicKey"],[4,"DescriptorType"],[15,"u64"],[3,"ScriptBuf"],[3,"ExtParams"],[4,"AnalysisError"],[3,"SignersContainer"],[4,"BuildSatisfaction"],[3,"Policy"],[4,"Error"],[8,"ScriptContext"],[3,"Script"],[3,"Range"],[3,"Error"],[3,"Tr"],[3,"Wsh"],[3,"Sh"],[3,"Wpkh"],[3,"Pkh"],[3,"Bare"],[3,"Type"],[3,"ExtData"],[3,"Tree"],[15,"usize"],[6,"ExtendedDescriptor"],[3,"Iter"],[3,"PkIter"],[4,"Policy"],[4,"LiftError"],[4,"BareCtx"],[4,"TapTree"],[3,"Plan"],[3,"TxIn"],[4,"SigType"],[3,"BTreeMap"],[3,"String"],[4,"TranslateErr"],[4,"HexToBytesError"],[4,"KeyError"],[4,"Error"],[4,"Error"],[4,"Error"],[4,"PolicyError"],[3,"Demand"],[4,"PkOrF"],[4,"SatisfiableItem"],[4,"Satisfaction"],[3,"Condition"],[6,"DescriptorTemplateOut"],[8,"IntoDescriptorKey"],[3,"P2Pkh"],[3,"P2Wpkh_P2Sh"],[3,"P2Wpkh"],[4,"Tap"],[3,"P2TR"],[8,"DerivableKey"],[3,"Bip44"],[3,"Bip44Public"],[3,"Bip49"],[3,"Bip49Public"],[3,"Bip84"],[3,"Bip84Public"],[3,"Bip86"],[3,"Bip86Public"],[6,"ValidNetworks"],[3,"SortedMultiVec"],[8,"Clone"],[3,"GeneratedKey"],[3,"PrivateKeyGenerateOptions"],[4,"DescriptorSecretKey"],[3,"SinglePub"],[3,"SinglePriv"],[4,"SinglePubKey"],[8,"Debug"],[4,"DescriptorKey"],[3,"Xpriv"],[4,"ExtendedKey"],[3,"Xpub"],[3,"DerivationPath"],[3,"Assets"],[6,"KeySource"],[3,"Fingerprint"],[3,"DescriptorKeyParseError"],[3,"FeeRate"],[3,"Balance"],[3,"Wallet"],[3,"SignerOrdering"],[8,"TransactionSigner"],[3,"Arc"],[8,"Iterator"],[3,"ChangeSet"],[3,"Block"],[3,"CannotConnectError"],[3,"BlockId"],[4,"ApplyHeaderError"],[8,"IntoIterator"],[3,"Update"],[3,"TxGraph"],[3,"Txid"],[6,"DefaultCoinSelectionAlgorithm"],[3,"BumpFee"],[3,"TxBuilder"],[4,"BuildFeeBumpError"],[3,"CreateTx"],[3,"Transaction"],[4,"CalculateFeeError"],[3,"CheckPointIter"],[6,"Result"],[3,"AddressInfo"],[3,"Psbt"],[3,"SignOptions"],[4,"SignerError"],[4,"NewError"],[4,"LoadError"],[4,"NewOrLoadError"],[4,"InsertTxError"],[4,"ApplyBlockError"],[6,"ChangeSet"],[3,"ConfirmationTimeHeightAnchor"],[3,"ChangeSet"],[3,"ChangeSet"],[3,"PsbtSighashType"],[3,"Input"],[4,"CreateTxError"],[3,"CanonicalTx"],[3,"AlterCheckPointError"],[4,"ConfirmationTime"],[3,"CheckPoint"],[8,"DoubleEndedIterator"],[8,"IntoWalletDescriptor"],[8,"PersistBackend"],[8,"Send"],[8,"Sync"],[3,"LocalChain"],[3,"BlockHash"],[3,"KeychainTxOutIndex"],[3,"LargestFirstCoinSelection"],[3,"OldestFirstCoinSelection"],[3,"BranchAndBoundCoinSelection"],[3,"CoinSelectionResult"],[4,"Error"],[4,"Excess"],[4,"MiniscriptPsbtError"],[4,"Error"],[3,"FullyNodedExport"],[4,"SignerId"],[6,"KeyMap"],[4,"SignerContext"],[8,"Sized"],[3,"SignerWrapper"],[4,"TapLeavesOptions"],[3,"DescriptorXKey"],[3,"DescriptorMultiXKey"],[3,"PrivateKey"],[3,"Hash"],[4,"Error"],[8,"CoinSelectionAlgorithm"],[4,"AddForeignUtxoError"],[4,"AddUtxoError"],[4,"AllowShrinkingError"],[4,"ChangeSpendPolicy"],[4,"TxOrdering"],[4,"LockTime"],[15,"i32"],[13,"Foreign"],[8,"ExtractPolicy"],[13,"PsbtTimelocks"],[13,"Complete"],[13,"Partial"],[13,"PartialComplete"],[13,"Sha256Preimage"],[13,"Hash256Preimage"],[13,"Ripemd160Preimage"],[13,"Hash160Preimage"],[13,"Thresh"],[13,"Multisig"],[13,"AbsoluteTimelock"],[13,"RelativeTimelock"],[8,"DescriptorTemplate"],[8,"GeneratableKey"],[8,"ExtScriptContext"],[8,"GeneratableDefaultOptions"],[8,"PsbtUtils"],[8,"IsDust"],[13,"UnexpectedConnectedToHash"],[13,"ConfirmationHeightCannotBeGreaterThanTip"],[13,"LoadedGenesisDoesNotMatch"],[13,"LoadedNetworkDoesNotMatch"],[13,"InsufficientFunds"],[13,"Change"],[13,"NoChange"],[13,"InsufficientFunds"],[13,"RbfSequenceCsv"],[13,"LockTime"],[13,"FeeTooLow"],[13,"FeeRateTooLow"],[8,"SignerCommon"],[8,"InputSigner"],[13,"Tap"],[13,"InvalidTxid"]]},\ +"bdk":{"doc":"bdk","t":[13,13,2,13,4,13,3,2,2,4,2,3,11,11,11,11,11,11,11,11,11,11,2,11,11,11,11,11,11,11,11,11,12,12,0,14,11,11,11,11,11,11,11,11,11,11,14,11,11,11,11,11,11,11,11,11,11,12,12,0,11,12,11,0,12,11,11,11,2,2,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,12,5,11,11,11,11,0,12,12,12,13,6,4,2,4,6,8,6,8,16,4,3,13,13,2,8,4,13,13,6,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,2,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,10,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,12,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,10,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,5,5,13,13,4,13,13,13,13,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,13,13,13,4,13,3,6,13,13,6,13,13,13,13,13,13,13,13,13,13,13,4,3,4,13,13,13,13,13,4,4,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,12,11,11,11,12,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,3,3,3,3,3,3,3,3,8,6,3,3,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,13,8,4,4,4,16,16,8,4,13,8,8,3,8,13,13,13,16,4,6,13,13,13,13,13,16,13,3,13,8,4,13,13,13,3,3,4,3,13,6,13,13,13,5,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,11,5,11,10,11,11,5,10,11,11,12,12,11,11,11,11,11,11,10,12,11,11,11,11,11,10,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,8,10,10,10,3,4,3,13,3,13,13,13,13,4,8,4,13,13,13,13,4,4,13,13,13,13,13,13,13,3,3,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,0,11,12,11,11,11,11,11,11,11,11,11,11,11,11,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,12,11,12,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,5,12,12,12,12,12,12,12,12,13,13,3,13,8,3,6,4,4,13,3,13,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,5,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,4,13,13,13,4,13,13,13,13,13,13,13,13,4,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,3,6,12,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,13,13,13,13,13,13,13,8,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,3,8,4,4,4,3,3,3,13,4,8,13,11,12,12,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,10,11,11,11,10,11,12,11,12,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,4,4,4,13,3,13,13,4,3,13,13,13,13,13,13,3,8,4,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12],"n":["External","Foreign","HdKeyPaths","Internal","KeychainKind","Local","LocalOutput","SignOptions","TxBuilder","Utxo","Wallet","WeightedUtxo","as_byte","as_ref","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","chain","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","confirmation_time","derivation_index","descriptor","descriptor","deserialize","deserialize","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fragment","from","from","from","from","hash","hash","into","into","into","into","is_spent","keychain","keys","outpoint","outpoint","partial_cmp","psbt","satisfaction_weight","sequence","serialize","serialize","signer","template","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","txout","txout","type_id","type_id","type_id","type_id","utxo","version","vzip","vzip","vzip","vzip","wallet","outpoint","psbt_input","sequence","Bare","DerivedDescriptor","Descriptor","DescriptorError","DescriptorPublicKey","ExtendedDescriptor","ExtractPolicy","HdKeyPaths","IntoWalletDescriptor","Key","Legacy","Miniscript","MultiXPub","Pkh","Policy","ScriptContext","Segwitv0","Sh","Single","TapKeyOrigins","Tr","Wpkh","Wsh","XPub","address","as_enum","as_enum","as_inner","as_node","at_derivation_index","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","branches","build_template","build_template_mall","calc_checksum","check_global_consensus_validity","check_global_consensus_validity","check_global_consensus_validity","check_global_policy_validity","check_global_policy_validity","check_global_validity","check_local_consensus_validity","check_local_consensus_validity","check_local_consensus_validity","check_local_policy_validity","check_local_policy_validity","check_local_policy_validity","check_local_validity","check_pk","check_pk","check_pk","check_terminal_non_malleable","check_terminal_non_malleable","check_terminal_non_malleable","check_witness","check_witness","check_witness","checksum","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","contains_raw_pkh","derive","derived_descriptor","derived_descriptor","desc_type","deserialize","deserialize","dust_value","encode","eq","eq","eq","eq","error","explicit_script","ext","ext_check","extract_policy","extract_policy","extract_policy","find_derivation_index_for_spk","fmt","fmt","fmt","fmt","fmt","fmt","for_each_key","for_each_key","from","from","from","from","from","from","from","from","from","from","from_ast","from_components_unchecked","from_str","from_str","from_str_ext","from_str_insane","from_tree","from_tree","get_nth_child","get_nth_pk","get_satisfaction","get_satisfaction_mall","has_mixed_timelocks","has_repeated_keys","has_wildcard","hash","hash","hash","hash","into","into","into","into","into_inner","into_single_descriptors","into_wallet_descriptor","into_wallet_descriptor","is_deriveable","is_multipath","is_non_malleable","iter","iter_pk","lift","lift","lift_check","max_satisfaction_size","max_satisfaction_size","max_satisfaction_size","max_satisfaction_size","max_satisfaction_weight","max_satisfaction_witness_elements","max_weight_to_satisfy","name_str","name_str","name_str","new_bare","new_pk","new_pkh","new_sh","new_sh_sortedmulti","new_sh_with_wpkh","new_sh_with_wsh","new_sh_wpkh","new_sh_wsh","new_sh_wsh_sortedmulti","new_tr","new_wpkh","new_wsh","new_wsh_sortedmulti","node","other_top_level_checks","parse","parse_descriptor","parse_insane","parse_with_ext","partial_cmp","partial_cmp","partial_cmp","partial_cmp","pk_len","pk_len","pk_len","plan","plan_mall","policy","requires_sig","sanity_check","sanity_check","satisfy","satisfy","satisfy_malleable","script_code","script_pubkey","script_size","serialize","serialize","sig_type","sig_type","sig_type","substitute_raw_pkh","template","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string_with_secret","top_level_checks","top_level_type_check","translate_pk","translate_pk","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","ty","type_id","type_id","type_id","type_id","unsigned_script_sig","vzip","vzip","vzip","vzip","within_resource_limits","calc_checksum","calc_checksum_bytes","Base58","Bip32","Error","HardenedDerivationXpub","Hex","InvalidDescriptorCharacter","InvalidDescriptorChecksum","InvalidHdKeyPath","Key","Miniscript","MultiPath","Pk","Policy","borrow","borrow_mut","fmt","fmt","from","from","from","from","from","from","from","from","into","provide","to_string","try_from","try_into","type_id","vzip","AbsoluteTimelock","AddOnLeaf","AddOnPartialComplete","BuildSatisfaction","Complete","Condition","ConditionMap","EcdsaSignature","Fingerprint","FoldedConditionMap","Hash160Preimage","Hash256Preimage","IncompatibleConditions","IndexOutOfRange","MixedTimelockUnits","Multisig","None","None","NotEnoughItemsSelected","Partial","PartialComplete","PkOrF","Policy","PolicyError","Psbt","PsbtTimelocks","Pubkey","RelativeTimelock","Ripemd160Preimage","Satisfaction","SatisfiableItem","SchnorrSignature","Sha256Preimage","Thresh","XOnlyPubkey","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","contribution","csv","default","eq","eq","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","get_condition","hash","hash","id","id","into","into","into","into","into","into","into","is_leaf","is_leaf","is_null","item","partial_cmp","provide","requires_path","satisfaction","serialize","serialize","serialize","serialize","serialize","timelock","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","current_height","input_max_height","psbt","condition","conditions","conditions","items","items","m","m","n","n","sorted","sorted","hash","hash","hash","hash","items","keys","threshold","threshold","value","value","Bip44","Bip44Public","Bip49","Bip49Public","Bip84","Bip84Public","Bip86","Bip86Public","DescriptorTemplate","DescriptorTemplateOut","P2Pkh","P2TR","P2Wpkh","P2Wpkh_P2Sh","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","build","build","build","build","build","build","build","build","build","build","build","build","from","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","into","into","into","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","Bip32","DerivableKey","DescriptorKey","DescriptorPublicKey","DescriptorSecretKey","Entropy","Error","ExtScriptContext","ExtendedKey","FullKey","GeneratableDefaultOptions","GeneratableKey","GeneratedKey","IntoDescriptorKey","InvalidChecksum","InvalidNetwork","InvalidScriptContext","Key","KeyError","KeyMap","Legacy","Message","Miniscript","MultiXPrv","MultiXPub","Options","Private","PrivateKeyGenerateOptions","Public","ScriptContext","ScriptContextEnum","Segwitv0","Single","Single","SinglePriv","SinglePub","SinglePubKey","SortedMultiVec","Tap","ValidNetworks","XOnly","XPrv","XPub","any_network","as_enum","at_derivation_index","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build_template","check_global_consensus_validity","check_global_policy_validity","check_global_validity","check_local_consensus_validity","check_local_policy_validity","check_local_validity","check_pk","check_terminal_non_malleable","check_witness","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","compressed","default","deref","derive","deserialize","encode","eq","eq","eq","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","for_each_key","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_public","from_secret","from_str","from_str","from_tree","full_derivation_path","full_derivation_paths","generate","generate_default","generate_with_entropy","generate_with_entropy_default","has_secret","has_wildcard","hash","hash","hash","hash","into","into","into","into","into","into","into","into","into","into","into","into","into_assets","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_extended_key","into_extended_key","into_extended_key","into_key","into_single_keys","into_single_keys","into_xprv","into_xpub","is_deriveable","is_legacy","is_legacy","is_multipath","is_multipath","is_segwit_v0","is_segwit_v0","is_taproot","is_taproot","is_uncompressed","is_x_only_key","k","key","key","lift","mainnet_network","master_fingerprint","max_satisfaction_size","max_satisfaction_size","max_satisfaction_witness_elements","merge_networks","name_str","new","num_der_paths","origin","origin","other_top_level_checks","override_valid_networks","partial_cmp","partial_cmp","partial_cmp","partial_cmp","pk_len","pks","provide","sanity_check","satisfy","script_size","serialize","sig_type","sorted_node","test_networks","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_public","to_string","to_string","to_string","to_string","top_level_checks","top_level_type_check","translate_pk","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","PsbtUtils","fee_amount","fee_rate","get_utxo_for","AddressInfo","ApplyBlockError","Balance","CannotConnect","ChangeSet","ConfirmationHeightCannotBeGreaterThanTip","Descriptor","Descriptor","Descriptor","InsertTxError","IsDust","LoadError","LoadedGenesisDoesNotMatch","LoadedNetworkDoesNotMatch","MissingGenesis","MissingNetwork","NewError","NewOrLoadError","NonEmptyDatabase","NotInitialized","NotInitialized","Persist","Persist","Persist","UnexpectedConnectedToHash","Update","Wallet","add","add_signer","address","all_unbounded_spk_iters","append","apply_block","apply_block_connected_to","apply_unconfirmed_txs","apply_update","as_ref","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build_fee_bump","build_tx","calculate_fee","calculate_fee_rate","cancel_tx","chain","chain","checkpoints","clone","clone","clone","clone_into","clone_into","clone_into","coin_selection","commit","confirmed","default","default","default","deref","derivation_index","derivation_of_spk","descriptor_checksum","deserialize","deserialize","eq","eq","eq","error","export","finalize_psbt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","get_balance","get_descriptor_for_keychain","get_psbt_input","get_signers","get_tx","get_utxo","graph","immature","index","indexed_tx_graph","insert_checkpoint","insert_tx","insert_txout","into","into","into","into","into","into","into","into","into","into","is_dust","is_empty","is_mine","keychain","keychains","last_active_indices","latest_checkpoint","list_output","list_unspent","list_unused_addresses","load","local_chain","mark_used","network","network","new","new_no_persist","new_no_persist_with_genesis_hash","new_or_load","new_or_load_with_genesis_hash","new_with_genesis_hash","next_derivation_index","next_unused_address","peek_address","policies","provide","provide","provide","provide","provide","public_descriptor","reveal_addresses_to","reveal_next_address","secp_ctx","sent_and_received","serialize","serialize","sign","signer","spk_index","staged","start_full_scan","start_sync_with_revealed_spks","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","to_string","to_string","to_string","total","transactions","trusted_pending","trusted_spendable","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tx_builder","tx_graph","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unbounded_spk_iter","unmark_used","untrusted_pending","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","wallet_name_from_descriptor","connected_to_hash","expected_hash","tip_height","tx_height","expected","expected","got","got","BnBNoExactMatch","BnBTotalTriesExceeded","BranchAndBoundCoinSelection","Change","CoinSelectionAlgorithm","CoinSelectionResult","DefaultCoinSelectionAlgorithm","Error","Excess","InsufficientFunds","LargestFirstCoinSelection","NoChange","OldestFirstCoinSelection","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","coin_select","coin_select","coin_select","coin_select","decide_change","default","default","default","excess","fee_amount","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","into","into","into","into","into","into","local_selected_amount","new","provide","selected","selected_amount","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","available","needed","amount","change_fee","dust_threshold","fee","remaining_amount","BuildFeeBumpError","ChangePolicyDescriptor","CoinSelection","Conversion","CreateTxError","Descriptor","FeeRateTooLow","FeeRateUnavailable","FeeTooLow","InsufficientFunds","IrreplaceableTransaction","LockTime","MiniscriptPsbt","MiniscriptPsbtError","MissingKeyOrigin","MissingNonWitnessUtxo","NoRecipients","NoUtxosSelected","OutputBelowDustLimit","OutputUpdate","Persist","Policy","Psbt","RbfSequence","RbfSequenceCsv","SpendingPolicyRequired","TransactionConfirmed","TransactionNotFound","UnknownUtxo","UnknownUtxo","UtxoUpdate","Version0","Version1Csv","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","into","into","into","provide","provide","provide","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","available","csv","needed","rbf","requested","required","required","required","FullyNodedExport","WalletExport","blockheight","borrow","borrow_mut","change_descriptor","descriptor","deserialize","export_wallet","fmt","from","from_str","into","label","serialize","to_string","try_from","try_into","type_id","vzip","All","Dummy","Exclude","External","Fingerprint","Include","InputIndexOutOfRange","InputSigner","InvalidKey","InvalidNonWitnessUtxo","InvalidSighash","Legacy","MiniscriptPsbt","MissingHdKeypath","MissingKey","MissingNonWitnessUtxo","MissingWitnessScript","MissingWitnessUtxo","NonStandardSighash","None","PkHash","Segwitv0","SighashError","SignOptions","SignerCommon","SignerContext","SignerError","SignerId","SignerOrdering","SignerWrapper","SignersContainer","Tap","TapLeavesOptions","TransactionSigner","UserCanceled","add_external","allow_all_sighashes","allow_grinding","as_key_map","assume_height","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","default","default","default","default","deref","descriptor_secret_key","descriptor_secret_key","descriptor_secret_key","descriptor_secret_key","eq","eq","eq","eq","find","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","hash","id","id","id","id","ids","into","into","into","into","into","into","into","into","new","new","partial_cmp","partial_cmp","provide","remove","remove_partial_sigs","remove_taproot_extras","sign_input","sign_input","sign_input","sign_input","sign_transaction","sign_transaction","sign_with_tap_internal_key","signers","tap_leaves_options","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","trust_witness_utxo","try_finalize","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","is_internal_key","AddForeignUtxoError","AddUtxoError","AllowShrinkingError","Bip69Lexicographic","BumpFee","ChangeAllowed","ChangeForbidden","ChangeSpendPolicy","CreateTx","InvalidOutpoint","InvalidTxid","MissingScriptPubKey","MissingUtxo","OnlyChange","Shuffle","TxBuilder","TxBuilderContext","TxOrdering","UnknownUtxo","Untouched","add_data","add_foreign_utxo","add_foreign_utxo_with_sequence","add_global_xpubs","add_recipient","add_unspendable","add_utxo","add_utxos","allow_dust","allow_shrinking","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","change_policy","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","coin_selection","current_height","default","default","default","default","do_not_spend_change","drain_to","drain_wallet","enable_rbf","enable_rbf_with_sequence","eq","eq","fee_absolute","fee_rate","finish","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","hash","hash","include_output_redeem_witness_script","into","into","into","into","into","into","into","into","manually_selected_only","nlocktime","only_spend_change","only_witness_utxo","ordering","partial_cmp","partial_cmp","policy_path","provide","provide","provide","set_recipients","sighash","sort_tx","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unspendable","version","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","foreign_utxo","input_txid"],"q":["bdk","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::Utxo","","","bdk::descriptor","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::descriptor::checksum","","bdk::descriptor::error","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::descriptor::policy","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::descriptor::policy::BuildSatisfaction","","","bdk::descriptor::policy::Satisfaction","","","","","","","","","","","bdk::descriptor::policy::SatisfiableItem","","","","","","","","","","bdk::descriptor::template","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::keys","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::psbt","","","","bdk::wallet","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::wallet::ApplyBlockError","","bdk::wallet::InsertTxError","","bdk::wallet::NewOrLoadError","","","","bdk::wallet::coin_selection","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::wallet::coin_selection::Error","","bdk::wallet::coin_selection::Excess","","","","","bdk::wallet::error","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::wallet::error::CreateTxError","","","","","","","","bdk::wallet::export","","","","","","","","","","","","","","","","","","","","bdk::wallet::signer","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::wallet::signer::SignerContext","bdk::wallet::tx_builder","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk::wallet::tx_builder::AddForeignUtxoError",""],"d":["External keychain, used for deriving recipient addresses.","A UTXO owned by another wallet.","","Internal keychain, used for deriving change addresses.","Types of keychains","A UTXO owned by the local wallet.","An unspent output owned by a Wallet.","","","An unspent transaction output (UTXO).","","A Utxo with its satisfaction_weight.","Return KeychainKind as a byte","","","","","","","","","","","","","","","","","","","","The confirmation time for transaction containing this utxo","The derivation index for the script pubkey in the wallet","Descriptors","Macro to write full descriptors with code","","","","","","","","","","","Macro to write descriptor fragments with code","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Whether this UTXO is spent or not","Type of keychain","Key formats","Get the location of the UTXO","Reference to a transaction output","","Additional functions on the rust-bitcoin Psbt structure.","The weight of the witness data and scriptSig expressed in …","Get the sequence number if an explicit sequence number has …","","","","","","","","","","","","","","","","","Get the TxOut of the UTXO","Transaction output","","","","","The UTXO","Get the version of BDK at runtime","","","","","Wallet","The location of the output.","The information about the input we require to add it to a …","The nSequence value to set for this input.","A raw scriptpubkey (including pay-to-pubkey) under Legacy …","Alias for a Descriptor that contains extended derived keys","Script descriptor","","The descriptor pubkey, either a single pubkey or an xpub.","Alias for a Descriptor that can contain extended keys …","Trait implemented on Descriptors to add a method to …","Alias for the type of maps that represent derivation paths …","Trait for types which can be converted into an …","The consensus key associated with the type. Must be a …","Legacy ScriptContext To be used as P2SH scripts For …","The top-level miniscript abstract syntax tree (AST).","Multiple extended public keys.","Pay-to-PubKey-Hash","","The ScriptContext for Miniscript. Additional type …","Segwitv0 ScriptContext","Pay-to-ScriptHash(includes nested wsh/wpkh/sorted multi)","Single public key.","Alias for the type of maps that represent taproot key …","Pay-to-Taproot","Pay-to-Witness-PubKey-Hash","Pay-to-Witness-ScriptHash with Segwitv0 context","Extended public key (xpub).","Computes the Bitcoin address of the descriptor, if one …","","","Get a reference to the inner AstElem representing the root …","","Replaces all wildcards (i.e. /*) in the descriptor with a …","","","","","","","","","Enumerates all child nodes of the current AST node (self) …","Attempt to produce a non-malleable witness template given …","Attempt to produce a malleable witness template given the …","","Depending on script Context, some of the Terminals might …","","","Depending on script Context, some of the script resource …","","Check the consensus + policy(if not disabled) rules that …","Consensus rules at the Miniscript satisfaction time. It is …","","","Policy rules at the Miniscript satisfaction time. It is …","","","Check the consensus + policy(if not disabled) rules …","Each context has slightly different rules on what Pks are …","","","Depending on ScriptContext, fragments can be malleable. …","","","Check whether the given satisfaction is valid under the …","","","Descriptor checksum","","","","","","","","","","","","","Whether the given miniscript contains a raw pkh fragment","Deprecated name for Self::at_derivation_index.","Convert all the public keys in the descriptor to …","Convert all the public keys in the descriptor to …","Get the DescriptorType of Descriptor","","","","Encode as a Bitcoin script","","","","","Descriptor errors","Computes the the underlying script before any hashing is …","Additional information helpful for extra analysis.","Check whether the miniscript follows the given Extra …","Extract the spending policy","","","Utility method for deriving the descriptor at each index …","","","","","","","","","","","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Add type information(Type and Extdata) to Miniscript based …","Create a new Miniscript from a Terminal node and a Type …","","Parse a Miniscript from string and perform sanity checks …","Attempt to parse an Miniscripts that don’t follow the …","Attempt to parse an insane(scripts don’t clear sanity …","Parse an expression tree into a descriptor.","Parse an expression tree into a Miniscript. As a general …","Returns child node with given index, if any","Returns Option::Some with cloned n’th public key from …","Returns satisfying non-malleable witness and scriptSig to …","Returns a possilbly mallable satisfying non-malleable …","Whether the miniscript contains a combination of timelocks","Whether the miniscript has repeated Pk or Pkh","Whether or not the descriptor has any wildcards i.e. /*.","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Extracts the AstElem representing the root of the …","Get as many descriptors as different paths in this …","Convert to wallet descriptor","","Whether or not the descriptor has any wildcards","Whether this descriptor contains a key that has multiple …","Whether the miniscript is malleable","Creates a new Iter iterator that will iterate over all …","Creates a new PkIter iterator that will iterate over all …","","","Lifting corresponds to conversion of a miniscript into a …","Depending on script context, the size of a satifaction …","","","Maximum size, in bytes, of a satisfying witness. For …","Computes an upper bound on the weight of a satisfying …","Maximum number of witness elements used to satisfy the …","Computes an upper bound on the difference between a …","Local helper function to display error messages with …","","","Create a new bare descriptor from witness script Errors …","Create a new pk descriptor","Create a new PkH descriptor","Create a new sh for a given redeem script Errors when …","Create a new sh sortedmulti descriptor with threshold k …","Create a new sh wrapper for the given wpkh descriptor","Create a new sh wrapper for the given wsh descriptor","Create a new sh wrapped wpkh from Pk. Errors when …","Create a new sh wrapped wsh descriptor with witness script …","Create a new sh wrapped wsh sortedmulti descriptor from …","Create new tr descriptor Errors when miniscript exceeds …","Create a new Wpkh descriptor Will return Err if …","Create a new wsh descriptor from witness script Errors …","Create a new wsh sorted multi descriptor Errors when …","A node in the AST.","Other top level checks that are context specific","Attempt to parse a Script into Miniscript representation.","Parse a descriptor that may contain secret keys","Attempt to parse an insane(scripts don’t clear sanity …","Attempt to parse an miniscript with extra features that …","","","","","Get the len of public key when serialized based on context …","","","Returns a plan if the provided assets are sufficient to …","Returns a plan if the provided assets are sufficient to …","Descriptor policy","Whether all spend paths of miniscript require a signature","Checks whether the descriptor is safe.","Check whether the underlying Miniscript is safe under the …","Attempts to produce a non-malleable satisfying witness and …","Attempt to produce non-malleable satisfying witness for the","Attempt to produce a malleable satisfying witness for the …","Computes the scriptCode of a transaction output.","Computes the scriptpubkey of the descriptor.","Size, in bytes of the script-pubkey. If this Miniscript is …","","","The type of signature required for satisfaction","","","Substitutes raw public keys hashes with the public keys as …","Descriptor templates","","","","","","","Serialize a descriptor to string with its secret keys","Check top level consensus rules.","Check whether the top-level is type B","Converts a descriptor using abstract keys to one using …","Translates a struct from one generic to another where the …","","","","","","","","","The correctness and malleability type information for the …","","","","","Computes the scriptSig that will be in place for an …","","","","","Whether the miniscript can exceed the resource …","Compute the checksum of a descriptor, excludes any …","Compute the checksum bytes of a descriptor, excludes any …","Error during base58 decoding","BIP32 error","Errors related to the parsing and usage of descriptors","The descriptor contains hardened derivation steps on …","Hex decoding error","Invalid byte found in the descriptor checksum","The provided descriptor doesn’t match its checksum","Invalid HD Key path, such as having a wildcard but a …","Error thrown while working with keys","Miniscript error","The descriptor contains multipath keys","Key-related error","Error while extracting and manipulating policies","","","","","","Returns the argument unchanged.","","","","","","","Calls U::from(self).","","","","","","","Absolute timeclock timestamp","Can not add to an item that is Satisfaction::None or …","Can not add to an item that is …","Options to build the satisfaction field in the policy","Can satisfy the policy item","An extra condition that must be satisfied but that is out …","Type for a map of sets of Condition items keyed by each set…","ECDSA Signature for a raw public key","An extended key fingerprint","Type for a map of folded sets of Condition items keyed by …","SHA256 then RIPEMD160 preimage hash","Double SHA256 preimage hash","Incompatible conditions (not currently used)","Index out of range for an item to satisfy a …","Can not merge CSV or timelock values unless both are less …","Multi-signature public keys with threshold count","Cannot satisfy or contribute to the policy item","Don’t generate satisfaction field","Not enough items are selected to satisfy a …","Only a partial satisfaction of some kind of threshold …","Can reach the threshold of some kind of threshold policy","A unique identifier for a key","Descriptor spending policy","Errors that can happen while extracting and manipulating …","Analyze the given PSBT to check for existing signatures","Like Psbt variant and also check for expired timelocks","A legacy public key","Relative timelock locktime","RIPEMD160 preimage hash","Represent if and how much a policy item is satisfied by …","An item that needs to be satisfied","Schnorr Signature for a raw public key","SHA256 preimage hash","Threshold items with threshold count","A x-only public key","","","","","","","","","","","","","","","","","","","","","","","","","","","How the wallet’s descriptor can satisfy this policy node","Optional CheckSequenceVerify condition","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Return the conditions that are set by the spending policy …","","","Returns a unique id for the SatisfiableItem","Identifier for this policy node","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns whether the SatisfiableItem is a leaf item","Returns whether the Satisfaction is a leaf item","Returns true if there are no extra conditions to verify","Type of this policy node","","","Return whether or not a specific path in the policy tree …","How much a given PSBT already satisfies this policy node …","","","","","","Optional timelock condition","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Current blockchain height","The highest confirmation height between the inputs CSV …","Given PSBT","Extra conditions that also need to be satisfied","Extra conditions that also need to be satisfied","Extra conditions that also need to be satisfied","The items that can be satisfied by the descriptor or are …","The items that can be satisfied by the descriptor","Threshold","Threshold","Total number of items","Total number of items","Whether the items are sorted in lexicographic order (used …","Whether the items are sorted in lexicographic order (used …","The digest value","The digest value","The digest value","The digest value","The policy items","The raw public key or extended key fingerprint","The required threshold count","The required threshold count","The timelock value","The timelock value","BIP44 template. Expands to pkh(key/44'/{0,1}'/0'/{0,1}/*)","BIP44 public template. Expands to pkh(key/{0,1}/*)","BIP49 template. Expands to …","BIP49 public template. Expands to sh(wpkh(key/{0,1}/*))","BIP84 template. Expands to wpkh(key/84'/{0,1}'/0'/{0,1}/*)","BIP84 public template. Expands to wpkh(key/{0,1}/*)","BIP86 template. Expands to tr(key/86'/{0,1}'/0'/{0,1}/*)","BIP86 public template. Expands to tr(key/{0,1}/*)","Trait for descriptor templates that can be built into a …","Type alias for the return type of DescriptorTemplate, …","P2PKH template. Expands to a descriptor pkh(key)","P2TR template. Expands to a descriptor tr(key)","P2WPKH template. Expands to a descriptor wpkh(key)","P2WPKH-P2SH template. Expands to a descriptor sh(wpkh(key))","","","","","","","","","","","","","","","","","","","","","","","","","Build the complete descriptor","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","BIP32 error","Trait for keys that can be derived.","Container for public or secret keys","The descriptor pubkey, either a single pubkey or an xpub.","The descriptor secret key, either a single private key or …","Type specifying the amount of entropy required e.g. [u8;32]","Returned error in case of failure","Trait that adds extra useful methods to ScriptContexts","Enum for extended keys that can be either xprv or xpub","A bitcoin public key (compressed or uncompressed).","Trait that allows generating a key with the default options","Trait for keys that can be generated","Output of a GeneratableKey key generation","Trait for objects that can be turned into a public or …","The key has an invalid checksum","The key is not valid for the given network","The key cannot exist in the given script context","The consensus key associated with the type. Must be a …","Errors thrown while working with keys","Alias type for a map of public key to secret key","Legacy scripts","Custom error message","Miniscript error","Multiple extended private keys.","Multiple extended public keys.","Extra options required by the generate_with_entropy","A private extended key, aka an xprv","Options for generating a PrivateKey","A public extended key, aka an xpub","The ScriptContext for Miniscript. Additional type …","Enum representation of the known valid ScriptContexts","Segwitv0 scripts","Single public key.","Single private key.","A descriptor bitcoin::PrivateKey with optional origin …","A descriptor SinglePubKey with optional origin information.","Single public key without any origin or range information.","Contents of a “sortedmulti” descriptor","Taproot scripts","Set of valid networks for a key","An xonly public key.","Extended private key (xpriv).","Extended public key (xpub).","Create a set containing mainnet, testnet, signet, and …","Returns the ScriptContext as a ScriptContextEnum","Replaces any wildcard (i.e. /*) in the key with a …","","","","","","","","","","","","","","","","","","","","","","","","","Attempt to produce a witness template given the assets …","Depending on script Context, some of the Terminals might …","Depending on script Context, some of the script resource …","Check the consensus + policy(if not disabled) rules that …","Consensus rules at the Miniscript satisfaction time. It is …","Policy rules at the Miniscript satisfaction time. It is …","Check the consensus + policy(if not disabled) rules …","Each context has slightly different rules on what Pks are …","Depending on ScriptContext, fragments can be malleable. …","Check whether the given satisfaction is valid under the …","","","","","","","","","","","","","","","","","","","","","","","Whether the generated key should be “compressed” or not","","","Deprecated name for Self::at_derivation_index.","","Encode as a Bitcoin script","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Create an instance given a public key and a set of valid …","Create an instance given a secret key and a set of valid …","","","Parse an expression tree into a SortedMultiVec","Full path, from the master key","Returns a vector containing the full derivation paths from …","Generate a key given the options with a random entropy","Generate a key with the default options and a random …","Generate a key given the extra options and the entropy","Generate a key with the default options and a given entropy","Return whether or not the key contains the private data","Whether or not the key has a wildcard","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","Turn the key into a DescriptorKey within the requested …","Consume self and turn it into a DescriptorKey by adding …","","","","","","Consume self and turn it into an ExtendedKey","","","Consumes self and returns the key","Get as many keys as derivation paths in this key.","Get as many keys as derivation paths in this key.","Transform the ExtendedKey into an Xpriv for the given …","Transform the ExtendedKey into an Xpub for the given …","Whether or not the key has a wildcard","Returns whether the script context is Legacy","Returns whether the script context is …","Whether or not this key has multiple derivation paths.","Whether or not this key has multiple derivation paths.","Returns whether the script context is Segwitv0","Returns whether the script context is …","Returns whether the script context is Tap, aka Taproot or …","Returns whether the script context is …","","","signatures required","The public key.","The private key.","","Create a set only containing mainnet","The fingerprint of the master key associated with this …","Depending on script context, the size of a satifaction …","Maximum size, in bytes, of a satisfying witness. In …","Maximum number of witness elements used to satisfy the …","Compute the intersection of two sets","Local helper function to display error messages with …","Create a new instance of SortedMultiVec given a list of …","","Origin information (fingerprint and derivation path).","Origin information (fingerprint and derivation path).","Other top level checks that are context specific","Override the computed set of valid networks","","","","","Get the len of public key when serialized based on context …","public keys inside sorted Multi","","utility function to sanity a sorted multi vec","Attempt to produce a satisfying witness for the witness …","Size, in bytes of the script-pubkey. If this Miniscript is …","","The type of signature required for satisfaction","Create Terminal::Multi containing sorted pubkeys","Create a set containing testnet and regtest","","","","","","","","","","Returns the public version of this key.","","","","","Check top level consensus rules.","Check whether the top-level is type B","This will panic if fpk returns an uncompressed key when …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Trait to add functions to extract utxos and calculate fees.","The total transaction fee amount, sum of input amounts …","The transaction’s fee rate. This value will only be …","Get the TxOut for the specified input index, if it doesn’…","A derived address and the index it was found at. For …","An error that may occur when applying a block to Wallet.","Balance, differentiated into various categories.","Occurs when the update chain cannot connect with original …","The changes made to a wallet by applying an Update.","The error variant that occurs when the caller attempts to …","There was problem with the passed-in descriptor(s).","There was a problem with the passed-in descriptor(s).","There is a problem with the passed-in descriptor.","An error that may occur when inserting a transaction into …","Trait to check if a value is below the dust limit. We are …","The error type when loading a Wallet from persistence.","The loaded genesis hash does not match what was provided.","The loaded network type does not match what was provided.","Data loaded from persistence is missing genesis hash.","Data loaded from persistence is missing network type.","The error type when constructing a fresh Wallet.","Error type for when we try load a Wallet from persistence …","Database already has data.","Wallet not initialized, persistence backend is empty.","Wallet is not initialized, persistence backend is empty.","We were unable to write the wallet’s data to the …","Loading data from the persistence backend failed.","Either writing to or loading from the persistence backend …","Occurs when the connected_to hash does not match the hash …","An update to Wallet.","A Bitcoin wallet","","Add an external signer","Address","Get unbounded script pubkey iterators for both Internal …","","Introduces a block of height to the wallet, and tries to …","Applies relevant transactions from block of height to the …","Apply relevant unconfirmed transactions to the wallet.","Applies an update to the wallet and stages the changes …","","","","","","","","","","","","","","","","","","","","","","Bump the fee of a transaction previously created with this …","Start building a transaction.","Calculates the fee of a given transaction. Returns 0 if tx …","Calculate the FeeRate for a given transaction.","Informs the wallet that you no longer intend to broadcast …","Update for the wallet’s internal LocalChain.","Changes to the LocalChain.","Get all the checkpoints the wallet is currently storing …","","","","","","","Coin selection","Commits all currently staged changed to the persistence …","Confirmed and immediately spendable balance","","","","","The derivation index of this wallet. It will return None …","Finds how the wallet derived the script pubkey spk.","Return the checksum of the public descriptor associated to …","","","","","","Errors that can be thrown by the Wallet","Wallet export","Finalize a PSBT, i.e., for each input determine if …","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Return the balance, separated into available, …","Returns the descriptor used to create addresses for a …","get the corresponding PSBT Input for a LocalUtxo","Get the signers","Get a single transaction from the wallet as a CanonicalTx …","Returns the utxo owned by this wallet corresponding to …","Update for the wallet’s internal TxGraph.","All coinbase outputs not yet matured","Child index of this address","Changes to IndexedTxGraph.","Add a new checkpoint to the wallet’s internal view of …","Add a transaction to the wallet’s internal view of the …","Inserts a TxOut at OutPoint into the wallet’s …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Check whether or not a value is below dust limit","","Return whether or not a script is part of this wallet …","Type of keychain","Iterator over all keychains in this wallet","Contains the last active derivation indices per keychain (K…","Returns the latest checkpoint.","List all relevant outputs (includes both spent and …","Return the list of unspent outputs of this wallet","List addresses that are revealed but unused.","Load Wallet from the given persistence backend.","Get a reference to the inner LocalChain.","Marks an address used of the given keychain at index.","Get the Bitcoin network the wallet is using.","Stores the network type of the wallet.","Initialize an empty Wallet.","Creates a wallet that does not persist data.","Creates a wallet that does not persist data, with a custom …","Either loads Wallet from persistence, or initializes it if …","Either loads Wallet from persistence, or initializes it if …","Initialize an empty Wallet with a custom genesis hash.","The index of the next address that you would get if you …","Get the next unused address for the given keychain, i.e. …","Peek an address of the given keychain at index without …","Return the spending policies for the wallet’s descriptor","","","","","","Return the “public” version of the wallet’s …","Reveal addresses up to and including the target index and …","Attempt to reveal the next address of the given keychain.","Return the secp256k1 context used for all signing …","Compute the tx’s sent and received amounts (in satoshis).","","","Sign a transaction with all the wallet’s signers, in the …","Generalized signers","Get a reference to the inner KeychainTxOutIndex.","Returns the changes that will be committed with the next …","Create a `FullScanRequest for this wallet.","Create a partial SyncRequest for this wallet for all …","","","","","","","","","","","Get the whole balance visible to the wallet.","Iterate over the transactions in the wallet.","Unconfirmed UTXOs generated by a wallet tx","Get sum of trusted_pending and confirmed coins.","","","","","","","","","","","","","","","","","","","","","Transaction builder","Get a reference to the inner TxGraph.","","","","","","","","","","","Get an unbounded script pubkey iterator for the given …","Undoes the effect of mark_used and returns whether the …","Unconfirmed UTXOs received from an external wallet","","","","","","","","","","","Deterministically generate a unique name given the …","Block hash of connected_to.","Expected block hash of connected_to, as derived from block.","The internal chain’s tip height.","The introduced transaction’s confirmation height.","The expected genesis block hash.","The expected network type.","The block hash loaded from persistence.","The network type loaded from persistence.","Branch and bound coin selection tries to avoid needing a …","Branch and bound coin selection possible attempts with …","Branch and bound coin selection","It’s possible to create spendable output from excess …","Trait for generalized coin selection algorithms","Result of a successful coin selection","Default coin selection algorithm used by TxBuilder if not …","Errors that can be thrown by the coin_selection module","Remaining amount after performing coin selection","Wallet’s UTXO set is not enough to cover recipient’s …","Simple and dumb coin selection","It’s not possible to create spendable output from excess …","OldestFirstCoinSelection always picks the utxo with the …","","","","","","","","","","","","","","","","","","","Perform the coin selection","","","","Decide if change can be created","","","","Remaining amount after deducing fees and outgoing outputs","Total fee amount for the selected utxos in satoshis","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","The total value of the inputs selected from the local …","Create new instance with target size for change output","","List of outputs selected for use as inputs","The total value of the inputs selected.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Sats available for spending","Sats needed for some transaction","Effective amount available to create change after …","The calculated fee for the drain TxOut with the selected …","Threshold to consider amount as dust for this particular …","The deducted change output fee","Exceeding amount of current selection over outgoing value …","Error returned from Wallet::build_fee_bump","The change_policy was set but the wallet does not have a …","There was an error with coin selection","Descriptor key conversion error","Error returned from TxBuilder::finish","There was a problem with the descriptors passed in","When bumping a tx the fee rate requested is lower than …","Node doesn’t have data to estimate a fee rate","When bumping a tx the absolute fee requested is lower than …","Wallet’s UTXO set is not enough to cover recipient’s …","Trying to replace a tx that has a sequence >= 0xFFFFFFFE","Requested LockTime is less than is required to spend from …","Miniscript PSBT error","Errors returned by miniscript when updating inconsistent …","In order to use the TxBuilder::add_global_xpubs option …","Missing non_witness_utxo on foreign utxo for given OutPoint","Cannot build a tx without recipients","manually_selected_only option is selected but no utxo has …","Output created is under the dust limit, 546 satoshis","Return error type for …","We were unable to load wallet data from or write wallet …","There was a problem while extracting and manipulating …","Partially signed bitcoin transaction error","Cannot enable RBF with a Sequence >= 0xFFFFFFFE","Cannot enable RBF with Sequence given a required OP_CSV","Spending policy is not compatible with this KeychainKind","Happens when trying to bump a transaction that is already …","Thrown when a tx is not found in the internal database","Happens when trying to spend an UTXO that is not in the …","Happens when trying to spend an UTXO that is not in the …","Return error type for PsbtExt::update_input_with_descriptor","Requested invalid transaction version ‘0’","Requested transaction version 1, but at least 2 is needed …","","","","","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","Sats available for spending","Required OP_CSV Sequence","Sats needed for some transaction","Given RBF Sequence","Requested LockTime","Required LockTime","Required fee absolute value (satoshi)","Required fee rate","Structure that contains the export of a wallet","Alias for FullyNodedExport","Earliest block to rescan when looking for the wallet’s …","","","Return the internal descriptor, if present","Return the external descriptor","","Export a wallet","","Returns the argument unchanged.","","Calls U::from(self).","Arbitrary label for the wallet","","","","","","","The signer will sign all the leaves it has a key for.","Dummy identifier","The signer won’t sign the specified leaves.","To be used only by external libraries implementing …","The fingerprint of a BIP32 extended key","The signer won’t sign leaves other than the ones …","Input index is out of range","PSBT Input signer","The private key in use has the right fingerprint but …","The non_witness_utxo specified is invalid","Invalid SIGHASH for the signing context in use","Legacy context","Miniscript PSBT error","The fingerprint and derivation path are missing from the …","The private key is missing for the required public key","The non_witness_utxo field of the transaction is required …","The witness_script field of the transaction is required to …","The witness_utxo field of the transaction is required to …","The psbt contains a non-SIGHASH_ALL sighash in one of its …","The signer won’t sign any leaf.","Bitcoin HASH160 (RIPEMD160 after SHA256) hash of an ECDSA …","Segwit v0 context (BIP 143)","Error while computing the hash to sign","Options for a software signer","Common signer methods","Signing context","Signing error","Identifier of a signer in the SignersContainers. Used as a …","Defines the order in which signers are called","Wrapper to pair a signer with its context","Container for multiple signers","Taproot context (BIP 340)","Customize which taproot script-path leaves the signer …","PSBT signer","The user canceled the operation","Adds an external signer to the container for the specified …","Whether the signer should use the sighash_type set in the …","Whether we should grind ECDSA signature to ensure signing …","Create a map of public keys to secret keys","Whether the wallet should assume a specific height has …","","","","","","","","","","","","","","","","","Build a new signer container from a KeyMap","","","","","","","","","","","","","","","","","","","","","","Return the secret key for the signer","","","","","","","","Finds the signer with lowest ordering for a given id in …","","","","","","","","","","Returns the argument unchanged.","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Return the SignerId for this signer","","","","Returns the list of identifiers of all the signers in the …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Create a wrapped signer from a signer and a context","Default constructor","","","","Removes a signer from the container and returns it","Whether to remove partial signatures from the PSBT inputs …","Whether to remove taproot specific fields from the PSBT on …","Sign a single psbt input","","","","Sign all the inputs of the psbt","","Whether we should try to sign a taproot transaction with …","Returns the list of signers in the container, sorted by …","Specifies which Taproot script-spend leaves we should sign …","","","","","","","","","Whether the signer should trust the witness_utxo, if the …","Whether to try finalizing the PSBT after the inputs are …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Whether the signer can sign for the internal key or not","Error returned from TxBuilder::add_foreign_utxo.","Error returned from TxBuilder::add_utxo and …","Error returned from TxBuilder::allow_shrinking","BIP69 / Lexicographic","Marker type to indicate the TxBuilder is being used to …","Use both change and non-change outputs (default)","Only use non-change outputs (see …","Policy regarding the use of change outputs when creating a …","Marker type to indicate the TxBuilder is being used to …","Requested outpoint doesn’t exist in the tx (vout greater …","Foreign utxo outpoint txid does not match PSBT input txid","Script/PubKey was not in the original transaction","Foreign utxo missing witness_utxo or non_witness_utxo","Only use change outputs (see TxBuilder::only_spend_change)","Randomized (default)","A transaction builder","Context in which the TxBuilder is valid","Ordering of the transaction’s inputs and outputs","Happens when trying to spend an UTXO that is not in the …","Unchanged","Add data as an output, using OP_RETURN","Add a foreign UTXO i.e. a UTXO not owned by this wallet.","Same as add_foreign_utxo but allows to set the nSequence …","Fill-in the PSBT_GLOBAL_XPUB field with the extended keys …","Add a recipient to the internal list","Add a utxo to the internal list of unspendable utxos","Add a utxo to the internal list of utxos that must be spent","Add the list of outpoints to the internal list of UTXOs …","Set whether or not the dust limit is checked.","Explicitly tells the wallet that it is allowed to reduce …","","","","","","","","","","","","","","","","","Set a specific ChangeSpendPolicy. See …","","","","","","","","","","","","","Choose the coin selection algorithm","Set the current blockchain height.","","","","","Do not spend change outputs","Sets the address to drain excess coins to.","Spend all the available inputs. This respects filters like …","Enable signaling RBF","Enable signaling RBF with a specific nSequence value","","","Set an absolute fee The fee_absolute method refers to the …","Set a custom fee rate.","Finish building the transaction.","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Fill-in the psbt::Output::redeem_script and …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Only spend utxos added by add_utxo.","Use a specific nLockTime while creating the transaction","Only spend change outputs","Only Fill-in the psbt::Input::witness_utxo field when …","Choose the ordering for inputs and outputs of the …","","","Set the policy path to use while creating the transaction …","","","","Replace the recipients already added with a new list","Sign with a specific sig hash","Sort transaction inputs and outputs by TxOrdering variant","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Replace the internal list of unspendable utxos with a new …","Build a transaction with a specific version","","","","","","","","","Foreign UTXO outpoint","PSBT input txid"],"i":[1,5,0,1,0,5,0,0,0,0,0,0,1,1,1,3,4,5,1,3,4,5,0,1,3,4,5,1,3,4,5,1,3,3,0,0,1,3,1,3,4,5,1,3,4,5,0,1,3,4,5,1,3,1,3,4,5,3,3,0,5,3,1,0,4,5,1,3,0,0,1,3,4,5,1,3,4,5,1,3,4,5,5,3,1,3,4,5,4,0,1,3,4,5,0,207,207,207,17,0,0,0,0,0,0,0,0,48,0,0,26,17,0,0,0,17,26,0,17,17,17,26,17,35,36,23,23,17,17,35,36,23,17,35,36,23,23,23,23,0,48,35,36,48,36,48,48,35,36,48,35,36,48,48,35,36,48,35,36,48,35,36,0,17,35,36,23,17,35,36,23,17,35,36,23,23,17,17,17,17,17,23,17,23,17,35,36,23,0,17,23,23,208,17,23,17,17,17,35,36,23,23,17,23,17,17,17,17,17,17,17,35,36,23,23,23,17,23,23,23,17,23,23,23,17,17,23,23,17,17,35,36,23,17,35,36,23,23,17,170,62,17,17,23,23,23,17,23,23,48,35,36,23,17,23,17,48,35,36,17,17,17,17,17,17,17,17,17,17,17,17,17,17,23,48,23,17,23,23,17,35,36,23,48,35,36,17,17,0,23,17,23,17,23,23,17,17,23,17,23,48,35,36,23,0,17,35,36,23,17,23,17,48,48,17,23,17,35,36,23,17,35,36,23,23,17,35,36,23,17,17,35,36,23,23,0,0,47,47,0,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,83,76,76,0,84,0,0,83,82,0,83,83,76,76,76,83,84,45,76,84,84,0,0,0,45,45,82,83,83,0,0,83,83,83,82,82,83,84,46,85,76,45,82,83,84,46,85,76,45,82,83,84,46,85,45,82,83,84,46,85,45,46,85,85,82,83,84,46,85,76,82,83,84,46,85,76,76,45,82,83,84,84,46,46,85,76,45,46,82,85,83,46,82,83,84,46,85,76,45,83,84,85,46,85,76,46,46,82,83,84,46,85,85,82,83,84,46,85,45,76,82,83,84,46,85,76,45,82,83,84,46,85,76,45,82,83,84,46,85,76,45,82,83,84,46,85,76,45,209,209,209,210,211,212,211,212,211,212,211,212,211,212,213,214,215,216,217,218,218,217,219,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,89,90,92,94,95,96,97,98,99,100,101,88,89,90,92,94,95,96,97,98,99,100,101,221,88,89,90,92,94,95,96,97,98,99,100,101,88,89,90,92,94,95,96,97,98,99,100,101,88,89,90,92,94,95,96,97,98,99,100,101,86,88,89,90,92,94,95,96,97,98,99,100,101,88,89,90,92,94,95,96,97,98,99,100,101,88,89,90,92,94,95,96,97,98,99,100,101,88,89,90,92,94,95,96,97,98,99,100,101,88,89,90,92,94,95,96,97,98,99,100,101,80,0,0,0,0,222,222,0,0,110,0,0,0,0,80,80,80,48,0,0,22,80,80,107,26,222,114,0,114,0,0,22,26,107,0,0,0,0,22,0,110,107,26,0,223,26,114,105,112,22,106,80,103,26,107,108,109,110,114,105,112,22,106,80,103,26,107,108,109,110,103,48,48,48,48,48,48,48,48,48,105,22,106,103,26,107,108,109,110,105,22,106,103,26,107,108,109,110,103,26,108,110,106,106,105,26,26,103,22,103,26,107,108,109,110,112,22,106,80,80,103,103,26,26,107,107,108,109,110,103,114,114,114,105,112,22,106,80,80,80,103,26,26,107,108,109,110,112,112,26,107,103,26,26,222,224,222,224,114,26,103,26,108,110,114,105,112,22,106,80,103,26,107,108,109,110,26,87,93,105,105,112,26,107,93,114,105,105,26,107,114,114,26,223,22,26,107,223,22,223,22,26,26,103,108,109,103,0,26,48,103,103,0,48,103,26,108,109,48,112,103,26,108,110,48,103,80,103,103,103,26,48,103,0,105,22,106,103,26,107,108,109,110,107,80,103,26,107,48,48,103,114,105,112,22,106,80,103,26,107,108,109,110,114,105,112,22,106,80,103,26,107,108,109,110,114,105,112,22,106,80,103,26,107,108,109,110,114,105,112,22,106,80,103,26,107,108,109,110,0,225,225,225,0,0,0,155,0,154,151,152,153,0,0,0,153,153,152,152,0,0,151,152,153,151,152,153,155,0,0,122,123,147,123,128,123,123,123,123,123,122,123,134,128,147,151,152,153,154,155,122,123,134,128,147,151,152,153,154,155,123,123,123,123,123,134,128,123,122,134,128,122,134,128,0,123,122,122,134,128,147,123,123,123,122,128,122,128,147,0,0,123,122,122,123,134,128,147,147,151,151,152,152,153,153,154,154,155,155,122,123,134,134,134,128,128,128,147,151,152,153,154,155,123,123,123,123,123,123,134,122,147,128,123,123,123,122,123,134,128,147,151,152,153,154,155,226,128,123,147,123,134,123,123,123,123,123,123,123,123,128,123,123,123,123,123,123,123,123,123,123,151,152,153,154,155,123,123,123,123,123,122,128,123,0,123,123,123,123,122,134,128,122,147,151,152,153,154,155,122,123,122,122,122,123,134,128,147,151,152,153,154,155,122,123,134,128,147,151,152,153,154,155,0,123,122,123,134,128,147,151,152,153,154,155,123,123,122,122,123,134,128,147,151,152,153,154,155,0,227,227,228,228,229,230,229,230,183,183,0,184,0,0,0,0,0,183,0,184,0,183,184,182,179,180,181,183,184,182,179,180,181,179,180,181,179,180,181,199,179,180,181,0,179,180,181,182,182,183,183,184,182,179,180,181,183,184,182,179,180,181,183,184,182,179,180,181,182,181,183,182,182,179,180,181,183,183,184,182,179,180,181,183,184,182,179,180,181,183,184,182,179,180,181,183,184,182,179,180,181,231,231,232,233,233,232,233,0,164,164,185,0,164,164,141,164,164,141,164,164,0,164,164,164,164,164,185,164,164,164,164,164,164,141,141,164,141,185,164,164,185,164,141,185,164,141,185,185,185,185,164,164,141,141,185,164,164,164,164,164,164,141,185,164,141,185,164,141,185,185,164,141,185,164,141,185,164,141,185,164,141,185,164,141,234,235,234,235,236,236,237,238,0,0,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,193,188,193,150,188,193,150,0,150,150,150,190,150,150,150,150,150,150,150,193,188,190,150,0,0,0,0,0,0,0,0,190,0,0,150,44,149,149,44,149,188,150,190,192,124,44,149,193,188,150,190,192,124,44,149,193,44,188,190,192,124,44,149,193,188,190,192,124,44,149,193,188,124,124,44,149,193,192,239,192,192,192,188,190,124,193,44,188,150,150,190,192,124,44,149,193,188,188,188,150,150,190,192,124,44,149,193,188,239,192,192,192,44,188,150,190,192,124,44,149,193,192,44,188,124,150,44,149,149,240,192,192,192,125,192,149,44,149,188,190,192,124,44,149,193,150,149,149,188,150,190,192,124,44,149,193,188,150,190,192,124,44,149,193,188,150,190,192,124,44,149,193,188,150,190,192,124,44,149,193,241,0,0,0,204,0,203,203,0,0,200,200,202,200,203,204,0,0,0,201,204,140,140,140,140,140,140,140,140,140,140,142,139,140,201,200,202,204,203,142,139,140,201,200,202,204,203,140,142,139,140,204,203,142,139,140,204,203,204,203,140,140,142,139,204,203,140,140,140,140,140,204,203,140,140,140,142,139,140,201,201,200,200,202,202,204,203,142,139,140,201,200,202,204,203,204,203,140,142,139,140,201,200,202,204,203,140,140,140,140,140,204,203,140,201,200,202,140,140,204,142,139,140,204,203,201,200,202,142,139,140,201,200,202,204,203,142,139,140,201,200,202,204,203,142,139,140,201,200,202,204,203,140,140,142,139,140,201,200,202,204,203,242,242],"f":[0,0,0,0,0,0,0,0,0,0,0,0,[1,2],[1],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[1,1],[3,3],[4,4],[5,5],[[]],[[]],[[]],[[]],[[1,1],6],0,0,0,0,[[],[[7,[1]]]],[[],[[7,[3]]]],[[1,1],8],[[3,3],8],[[4,4],8],[[5,5],8],[[1,9],10],[[3,9],10],[[4,9],10],[[5,9],10],0,[[]],[[]],[[]],[[]],[1],[3],[[]],[[]],[[]],[[]],0,0,0,[5,11],0,[[1,1],[[12,[6]]]],0,0,[5,[[12,[13]]]],[1,7],[3,7],0,0,[[]],[[]],[[]],[[]],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[5,14],0,[[],15],[[],15],[[],15],[[],15],0,[[],16],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[17,18],[[7,[[20,[19]],21]]]],[[],22],[[],22],[23,24],[23,[[25,[23]]]],[[[17,[26]],27],[[7,[[17,[28]],29]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[23,[[31,[23,30]]]],[23,[[33,[32]]]],[23,[[33,[32]]]],0,[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[[],[[7,[34]]]],[[],[[7,[34]]]],[[],[[7,[34]]]],[24,[[7,[34]]]],[24,[[7,[34]]]],[24,[[7,[34]]]],[[],[[7,[34]]]],[[],[[7,[34]]]],[[],[[7,[34]]]],0,[17,17],[35,35],[36,36],[23,23],[[]],[[]],[[]],[[]],[[17,17],6],[[35,35],6],[[36,36],6],[[23,23],6],[23,8],[[[17,[26]],27],[[7,[[17,[28]],29]]]],[[[17,[26]],37,27],[[7,[[17,[38]],29]]]],[[[17,[28]],37],[[7,[[17,[38]],29]]]],[17,39],[[],[[7,[17]]]],[[],[[7,[23]]]],[[[17,[26]]],40],[23,41],[[17,17],8],[[35,35],8],[[36,36],8],[[23,23],8],0,[17,[[7,[41,21]]]],0,[[23,42],[[7,[43]]]],[[44,45,37],[[7,[[12,[46]],47]]]],[[[17,[26]],44,45,37],[[7,[[12,[46]],47]]]],[[[23,[26,48]],44,45,37],[[7,[[12,[46]],47]]]],[[[17,[26]],37,49,[50,[27]]],[[7,[12,29]]]],[[17,9],[[7,[51]]]],[[17,9],[[7,[51]]]],[[35,9],[[7,[51]]]],[[36,9],[[7,[51]]]],[[23,9],[[7,[51]]]],[[23,9],[[7,[51]]]],[17,8],[23,8],[52,17],[53,17],[54,17],[[]],[55,17],[56,17],[57,17],[[]],[[]],[[]],[24,[[7,[23,21]]]],[[24,58,59],23],[16,[[7,[17,21]]]],[16,[[7,[23,21]]]],[[16,42],[[7,[23,21]]]],[16,[[7,[23,21]]]],[60,[[7,[17,21]]]],[60,[[7,[23,21]]]],[[23,61],[[12,[23]]]],[[23,61],12],[17,[[7,[21]]]],[17,[[7,[21]]]],[23,8],[23,8],[[[17,[26]]],8],[17],[35],[36],[23],[[]],[[]],[[]],[[]],[23,24],[[[17,[26]]],[[7,[[31,[[17,[26]],30]],21]]]],[[37,18],[[7,[47]]]],[[62,37,18],[[7,[47]]]],[[[17,[26]]],8],[[[17,[26]]],8],[23,8],[23,63],[23,64],[17,[[7,[65,21]]]],[23,[[7,[65,21]]]],[23,[[7,[66]]]],[23,[[12,[61]]]],[23,[[12,[61]]]],[23,[[12,[61]]]],[23,[[7,[61,21]]]],[17,[[7,[61,21]]]],[23,[[7,[61,21]]]],[17,[[7,[61,21]]]],[[],16],[[],16],[[],16],[[[23,[67]]],[[7,[17,21]]]],[[],17],[[],[[7,[17,21]]]],[[[23,[35]]],[[7,[17,21]]]],[[61,[31,[30]]],[[7,[17,21]]]],[55,17],[56,17],[[],[[7,[17,21]]]],[[[23,[36]]],[[7,[17,21]]]],[[61,[31,[30]]],[[7,[17,21]]]],[[[12,[68]]],[[7,[17,21]]]],[[],[[7,[17,21]]]],[[[23,[36]]],[[7,[17,21]]]],[[61,[31,[30]]],[[7,[17,21]]]],0,[23,[[7,[21]]]],[49,[[7,[23,21]]]],[[37,16],[[7,[21]]]],[49,[[7,[23,21]]]],[[49,42],[[7,[23,21]]]],[[17,17],[[12,[6]]]],[[35,35],[[12,[6]]]],[[36,36],[[12,[6]]]],[[23,23],[[12,[6]]]],[[],61],[[],61],[[],61],[[[17,[28]]],[[7,[69,[17,[28]]]]]],[[[17,[28]]],[[7,[69,[17,[28]]]]]],0,[23,8],[17,[[7,[21]]]],[23,[[7,[43]]]],[[17,70],[[7,[21]]]],[23,[[7,[[31,[[31,[2,30]],30]],21]]]],[23,[[7,[[31,[[31,[2,30]],30]],21]]]],[17,[[7,[41,21]]]],[17,41],[23,61],[17,7],[23,7],[[],71],[[],71],[[],71],[[23,72],23],0,[[]],[[]],[[]],[[]],[[],73],[[],73],[[[17,[26]],72],73],[23,[[7,[21]]]],[23,[[7,[21]]]],[17,[[7,[74]]]],[23,[[7,[74]]]],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],0,[[],15],[[],15],[[],15],[[],15],[17,41],[[]],[[]],[[]],[[]],[23,8],[16,[[7,[73,47]]]],[16,[[7,[47]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[47,9],10],[[47,9],10],[75,47],[[]],[76,47],[21,47],[77,47],[78,47],[79,47],[80,47],[[]],[81],[[],73],[[],7],[[],7],[[],15],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[82,82],[83,83],[84,84],[46,46],[85,85],[45,45],[[]],[[]],[[]],[[]],[[]],[[]],0,0,[[],85],[[82,82],8],[[83,83],8],[[84,84],8],[[46,46],8],[[85,85],8],[[76,76],8],[[82,9],10],[[83,9],10],[[84,9],10],[[46,9],10],[[85,9],10],[[76,9],10],[[76,9],10],[[45,9],10],[[]],[[]],[[]],[8,84],[[]],[83,46],[[]],[[]],[[]],[[46,72],[[7,[85,76]]]],[82],[85],[83,73],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[83,8],[84,8],[85,8],0,[[85,85],[[12,[6]]]],[81],[46,8],0,[82,7],[83,7],[84,7],[46,7],[85,7],0,[[]],[[]],[[]],[[]],[[]],[[]],[[],73],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[18,[[7,[86,47]]]],[[[88,[[87,[35]]]],18],[[7,[86,47]]]],[[[89,[[87,[36]]]],18],[[7,[86,47]]]],[[[90,[[87,[36]]]],18],[[7,[86,47]]]],[[[92,[[87,[91]]]],18],[[7,[86,47]]]],[[[94,[[93,[35]]]],18],[[7,[86,47]]]],[[[95,[[93,[35]]]],18],[[7,[86,47]]]],[[[96,[[93,[36]]]],18],[[7,[86,47]]]],[[[97,[[93,[36]]]],18],[[7,[86,47]]]],[[[98,[[93,[36]]]],18],[[7,[86,47]]]],[[[99,[[93,[36]]]],18],[[7,[86,47]]]],[[[100,[[93,[91]]]],18],[[7,[86,47]]]],[[[101,[[93,[91]]]],18],[[7,[86,47]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[86,37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[37,18],[[7,[47]]]],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[],102],[[],22],[[26,27],[[7,[28,29]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[103,[[33,[32]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[23,[[7,[34]]]],[[],[[7,[34]]]],[24,[[7,[34]]]],[[],[[7,[34]]]],[[[105,[104,48]]],[[105,[104,48]]]],[22,22],[106,106],[103,103],[26,26],[107,107],[108,108],[109,109],[110,110],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[103,103],6],[[26,26],6],[[108,108],6],[[110,110],6],0,[[],106],[[[105,[48]]]],[[26,27],[[7,[28,29]]]],[[],[[7,[26]]]],[103,41],[[22,22],8],[[103,103],8],[[26,26],8],[[107,107],8],[[108,108],8],[[109,109],8],[[110,110],8],[[[112,[[0,[111,48]]]],9],10],[[22,9],10],[[106,9],10],[[80,9],10],[[80,9],10],[[103,9],[[7,[51]]]],[[103,9],[[7,[51]]]],[[26,9],[[7,[51]]]],[[26,9],[[7,[51]]]],[[107,9],[[7,[51]]]],[[107,9],[[7,[51]]]],[[108,9],[[7,[51]]]],[[109,9],[[7,[51]]]],[[110,9],[[7,[51]]]],[103,8],[113,[[114,[48]]]],[115,[[114,[48]]]],[[]],[[]],[[]],[[]],[[]],[79,80],[[]],[21,80],[[]],[[]],[28,26],[[]],[[]],[[]],[[]],[[26,102],[[112,[48]]]],[[107,102],[[112,[48]]]],[16,[[7,[26]]]],[16,[[7,[107]]]],[60,[[7,[103,21]]]],[26,[[12,[116]]]],[26,[[31,[116,30]]]],[[],[[7,[105]]]],[[],[[7,[105]]]],[[],[[7,[105]]]],[[],[[7,[105]]]],[[[114,[48]]],8],[26,8],[103],[26],[108],[110],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[26,117],[[],[[7,[112,80]]]],[[[12,[118]],116],[[7,[112,80]]]],[[105,[12,[118]],116],[[7,[112,80]]]],[105,[[7,[112,80]]]],[[[112,[48]]],[[7,[[112,[48]],80]]]],[26,[[7,[[112,[48]],80]]]],[107,[[7,[[112,[48]],80]]]],[[],[[7,[114,80]]]],[[[114,[48]]],[[7,[[114,[48]],80]]]],[105,[[7,[114,80]]]],[[[105,[48]]]],[26,[[31,[26,30]]]],[107,[[31,[107,30]]]],[[[114,[48]],18],[[12,[113]]]],[[[114,[48]],18,37],115],[26,8],[[],8],[22,8],[26,8],[107,8],[[],8],[22,8],[[],8],[22,8],[26,8],[26,8],0,0,0,[103,[[7,[65,21]]]],[[],102],[26,119],[23,[[12,[61]]]],[103,61],[103,61],[[102,102],102],[[],16],[[61,[31,[30]]],[[7,[103,21]]]],[26,61],0,0,[23,[[7,[21]]]],[[[112,[48]],102],[[112,[48]]]],[[103,103],[[12,[6]]]],[[26,26],[[12,[6]]]],[[108,108],[[12,[6]]]],[[110,110],[[12,[6]]]],[[],61],0,[81],[103,[[7,[21]]]],[103,[[7,[[31,[[31,[2,30]],30]],21]]]],[103,61],[26,7],[[],71],[103,24],[[],102],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[107,37],[[7,[26,120]]]],[[],73],[[],73],[[],73],[[],73],[23,[[7,[21]]]],[23,[[7,[21]]]],[103,[[7,[103,74]]]],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[[],[[12,[40]]]],[[],[[12,[121]]]],[61,[[12,[14]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[122,122],122],[[123,1,124,[126,[125]]]],0,[123,[[72,[1,[0,[127,104]]]]]],[[128,128]],[[123,129,27],[[7,[130]]]],[[123,129,27,131],[[7,[132]]]],[[123,133]],[[123,[135,[134]]],[[7,[130]]]],[123,136],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[123,137],[[7,[[140,[138,139]],141]]]],[123,[[140,[138,142]]]],[[123,143],[[7,[40,144]]]],[[123,143],[[7,[121,144]]]],[[123,143]],0,0,[123,145],[122,122],[134,134],[128,128],[[]],[[]],[[]],0,[123,[[146,[8]]]],0,[[],122],[[],134],[[],128],[147],[[123,1],[[12,[27]]]],[[123,49],12],[[123,1],73],[[],[[7,[122]]]],[[],[[7,[128]]]],[[122,122],8],[[128,128],8],[[147,147],8],0,0,[[123,148,149],[[7,[8,150]]]],[[122,9],[[7,[51]]]],[[122,9],[[7,[51]]]],[[123,9],10],[[134,9],10],[[128,9],10],[[147,9],10],[[147,9],10],[[151,9],10],[[151,9],10],[[152,9],10],[[152,9],10],[[153,9],10],[[153,9],10],[[154,9],10],[[154,9],10],[[155,9],10],[[155,9],10],[[]],[[]],[156,134],[[[157,[1]]],134],[[]],[[[160,[158,[159,[1]]]]],128],[161,128],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[123,122],[[123,1],62],[[123,3,[12,[162]],8],[[7,[163,164]]]],[[123,1],[[126,[44]]]],[[123,137],[[12,[[165,[[126,[143]],158]]]]]],[[123,11],[[12,[3]]]],0,0,0,0,[[123,131],[[7,[8,166]]]],[[123,143,167],[[7,[8,154]]]],[[123,11,14]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[49,8],[128,8],[[123,49],8],0,[123,72],0,[123,168],[123,127],[123,127],[[123,1],169],[[170,[12,[170]],[0,[[171,[128]],172,173]]],[[7,[123,152]]]],[123,174],[[123,1,27],8],[123,18],0,[[170,[12,[170]],[0,[[171,[128]],172,173]],18],[[7,[123,151]]]],[[170,[12,[170]],18],[[7,[123,47]]]],[[170,[12,[170]],18,175],[[7,[123,47]]]],[[170,[12,[170]],[0,[[171,[128]],172,173]],18],[[7,[123,153]]]],[[170,[12,[170]],[0,[[171,[128]],172,173]],18,175],[[7,[123,153]]]],[[170,[12,[170]],[0,[[171,[128]],172,173]],18,175],[[7,[123,151]]]],[[123,1],27],[[123,1],[[146,[147]]]],[[123,1,27],147],[[123,1],[[7,[[12,[46]],47]]]],[81],[81],[81],[81],[81],[[123,1],[[12,[62]]]],[[123,1,27],[[146,[127]]]],[[123,1],[[146,[147]]]],[123,37],[[123,143]],[122,7],[128,7],[[123,148,149],[[7,[8,150]]]],0,[123,176],[123,128],[123,[[177,[1]]]],[123,178],[[]],[[]],[[]],[[],73],[[],73],[[],73],[[],73],[[],73],[[],73],[[],73],[122,40],[123,127],0,[122,40],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],0,[123,136],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[123,1],[[0,[127,104]]]],[[123,1,27],8],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[12,18,37],[[7,[73,47]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[179,179],[180,180],[181,181],[[]],[[]],[[]],[[[31,[4]],[31,[4]],121,40,49],[[7,[182,183]]]],[[179,[31,[4]],[31,[4]],121,40,49],[[7,[182,183]]]],[[180,[31,[4]],[31,[4]],121,40,49],[[7,[182,183]]]],[[181,[31,[4]],[31,[4]],121,40,49],[[7,[182,183]]]],[[40,121,49],184],[[],179],[[],180],[[],181],0,0,[[183,9],10],[[183,9],10],[[184,9],10],[[182,9],10],[[179,9],10],[[180,9],10],[[181,9],10],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[182,40],[40,181],[81],0,[182,40],[[]],[[]],[[]],[[],73],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[185,185],[[]],[[185,9],10],[[185,9],10],[[164,9],10],[[164,9],10],[[141,9],10],[[141,9],10],[[]],[76,164],[[]],[185,164],[186,164],[183,164],[47,164],[[]],[[]],[[]],[[]],[81],[81],[81],[[]],[[],73],[[],73],[[],73],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],15],[[],15],[[],15],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[187,[[12,[73]]]],[187,73],[[],[[7,[187]]]],[[123,16,8],[[7,[187,16]]]],[[187,9],10],[[]],[16,[[7,[187]]]],[[]],0,[187,7],[187,73],[[],7],[[],7],[[],15],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[44,188,124,[126,[125]]],[[12,[[126,[125]]]]]],0,0,[[44,37],189],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[189,17,37],44],[188,188],[190,190],[[[192,[[0,[104,191,111,104]]]]],[[192,[[0,[104,191,111,104]]]]]],[124,124],[44,44],[149,149],[193,193],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[188,188],6],[[124,124],6],[[],124],[[],44],[[],149],[[],193],[[[192,[[0,[191,111,104]]]]]],[[],[[12,[107]]]],[[[192,[[194,[113]]]]],[[12,[107]]]],[[[192,[[195,[113]]]]],[[12,[107]]]],[[[192,[196]]],[[12,[107]]]],[[188,188],8],[[190,190],8],[[124,124],8],[[193,193],8],[[44,188],[[12,[126]]]],[[188,9],10],[[150,9],10],[[150,9],10],[[190,9],10],[[[192,[[0,[111,191,111,104]]]],9],10],[[124,9],10],[[44,9],10],[[149,9],10],[[193,9],10],[[]],[197,188],[119,188],[[]],[198,150],[[]],[[]],[[]],[[]],[[]],[[]],[188],[37,188],[[[192,[[194,[113]]]],37],188],[[[192,[196]],37],188],[[[192,[[195,[113]]]],37],188],[44,[[31,[188]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[0,[191,111,104]],190],[[192,[[0,[191,111,104]]]]]],[[],44],[[188,188],[[12,[6]]]],[[124,124],[[12,[6]]]],[81],[[44,188,124],[[12,[[126,[125]]]]]],0,0,[[148,61,149,37],[[7,[150]]]],[[[192,[[195,[113]]]],148,61,149,37],[[7,[150]]]],[[[192,[[194,[113]]]],148,61,149,37],[[7,[150]]]],[[[192,[196]],148,61,149,37],[[7,[150]]]],[[148,149,37],[[7,[150]]]],[[148,149,37],[[7,[150]]]],0,[44,[[31,[126]]]],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],73],0,0,[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[[140,[199,142]]],[[140,[199,142]]]],[[140,11,163,61],[[7,[140,200]]]],[[140,11,163,61,13],[[7,[140,200]]]],[140,140],[[[140,[199,142]],41,40],[[140,[199,142]]]],[[140,11],140],[[140,11],[[7,[140,201]]]],[140,[[7,[140,201]]]],[[140,8],140],[[[140,[138,139]],41],[[7,[[140,[138,139]],202]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[140,203],140],[142,142],[139,139],[[[140,[104]]],[[140,[104]]]],[204,204],[203,203],[[]],[[]],[[]],[[]],[[]],[[204,204],6],[[203,203],6],[[140,199],[[140,[199]]]],[[140,27],140],[[],142],[[],139],[[],204],[[],203],[140,140],[[[140,[199,142]],41],[[140,[199,142]]]],[140,140],[140,140],[[140,13],140],[[204,204],8],[[203,203],8],[[140,40],140],[[140,121],140],[[[140,[199]]],[[7,[148,164]]]],[[142,9],10],[[139,9],10],[[[140,[111,111]],9],10],[[201,9],10],[[201,9],10],[[200,9],10],[[200,9],10],[[202,9],10],[[202,9],10],[[204,9],10],[[203,9],10],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[204],[203],[140,140],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[140,140],[[140,205],140],[140,140],[140,140],[[140,204],140],[[204,204],[[12,[6]]]],[[203,203],[[12,[6]]]],[[140,[72,[73,[31,[61]]]],1],140],[81],[81],[81],[[[140,[199,142]],31],[[140,[199,142]]]],[[140,162],140],[[204,143]],[[]],[[]],[[]],[[]],[[]],[[],73],[[],73],[[],73],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[140,[31,[11]]],140],[[140,206],140],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0],"p":[[4,"KeychainKind"],[15,"u8"],[3,"LocalOutput"],[3,"WeightedUtxo"],[4,"Utxo"],[4,"Ordering"],[4,"Result"],[15,"bool"],[3,"Formatter"],[6,"Result"],[3,"OutPoint"],[4,"Option"],[3,"Sequence"],[3,"TxOut"],[3,"TypeId"],[15,"str"],[4,"Descriptor"],[4,"Network"],[4,"NetworkChecked"],[3,"Address"],[4,"Error"],[4,"ScriptContextEnum"],[3,"Miniscript"],[4,"Terminal"],[4,"Tree"],[4,"DescriptorPublicKey"],[15,"u32"],[3,"DefiniteDescriptorKey"],[4,"ConversionError"],[3,"Global"],[3,"Vec"],[4,"Placeholder"],[3,"Satisfaction"],[4,"ScriptContextError"],[4,"Legacy"],[4,"Segwitv0"],[3,"Secp256k1"],[3,"PublicKey"],[4,"DescriptorType"],[15,"u64"],[3,"ScriptBuf"],[3,"ExtParams"],[4,"AnalysisError"],[3,"SignersContainer"],[4,"BuildSatisfaction"],[3,"Policy"],[4,"Error"],[8,"ScriptContext"],[3,"Script"],[3,"Range"],[3,"Error"],[3,"Sh"],[3,"Tr"],[3,"Pkh"],[3,"Wpkh"],[3,"Wsh"],[3,"Bare"],[3,"Type"],[3,"ExtData"],[3,"Tree"],[15,"usize"],[6,"ExtendedDescriptor"],[3,"Iter"],[3,"PkIter"],[4,"Policy"],[4,"LiftError"],[4,"BareCtx"],[4,"TapTree"],[3,"Plan"],[3,"TxIn"],[4,"SigType"],[3,"BTreeMap"],[3,"String"],[4,"TranslateErr"],[4,"HexToBytesError"],[4,"PolicyError"],[4,"Error"],[4,"Error"],[4,"Error"],[4,"KeyError"],[3,"Demand"],[4,"PkOrF"],[4,"SatisfiableItem"],[4,"Satisfaction"],[3,"Condition"],[6,"DescriptorTemplateOut"],[8,"IntoDescriptorKey"],[3,"P2Pkh"],[3,"P2Wpkh_P2Sh"],[3,"P2Wpkh"],[4,"Tap"],[3,"P2TR"],[8,"DerivableKey"],[3,"Bip44"],[3,"Bip44Public"],[3,"Bip49"],[3,"Bip49Public"],[3,"Bip84"],[3,"Bip84Public"],[3,"Bip86"],[3,"Bip86Public"],[6,"ValidNetworks"],[3,"SortedMultiVec"],[8,"Clone"],[3,"GeneratedKey"],[3,"PrivateKeyGenerateOptions"],[4,"DescriptorSecretKey"],[3,"SinglePub"],[3,"SinglePriv"],[4,"SinglePubKey"],[8,"Debug"],[4,"DescriptorKey"],[3,"Xpriv"],[4,"ExtendedKey"],[3,"Xpub"],[3,"DerivationPath"],[3,"Assets"],[6,"KeySource"],[3,"Fingerprint"],[3,"DescriptorKeyParseError"],[3,"FeeRate"],[3,"Balance"],[3,"Wallet"],[3,"SignerOrdering"],[8,"TransactionSigner"],[3,"Arc"],[8,"Iterator"],[3,"ChangeSet"],[3,"Block"],[3,"CannotConnectError"],[3,"BlockId"],[4,"ApplyHeaderError"],[8,"IntoIterator"],[3,"Update"],[8,"Into"],[3,"TxGraph"],[3,"Txid"],[6,"DefaultCoinSelectionAlgorithm"],[3,"BumpFee"],[3,"TxBuilder"],[4,"BuildFeeBumpError"],[3,"CreateTx"],[3,"Transaction"],[4,"CalculateFeeError"],[3,"CheckPointIter"],[6,"Result"],[3,"AddressInfo"],[3,"Psbt"],[3,"SignOptions"],[4,"SignerError"],[4,"NewError"],[4,"LoadError"],[4,"NewOrLoadError"],[4,"InsertTxError"],[4,"ApplyBlockError"],[3,"SyncResult"],[3,"FullScanResult"],[3,"ConfirmationTimeHeightAnchor"],[3,"ChangeSet"],[3,"ChangeSet"],[6,"ChangeSet"],[3,"PsbtSighashType"],[3,"Input"],[4,"CreateTxError"],[3,"CanonicalTx"],[3,"AlterCheckPointError"],[4,"ConfirmationTime"],[3,"CheckPoint"],[8,"DoubleEndedIterator"],[8,"IntoWalletDescriptor"],[8,"PersistBackend"],[8,"Send"],[8,"Sync"],[3,"LocalChain"],[3,"BlockHash"],[3,"KeychainTxOutIndex"],[3,"FullScanRequest"],[3,"SyncRequest"],[3,"LargestFirstCoinSelection"],[3,"OldestFirstCoinSelection"],[3,"BranchAndBoundCoinSelection"],[3,"CoinSelectionResult"],[4,"Error"],[4,"Excess"],[4,"MiniscriptPsbtError"],[4,"Error"],[3,"FullyNodedExport"],[4,"SignerId"],[6,"KeyMap"],[4,"SignerContext"],[8,"Sized"],[3,"SignerWrapper"],[4,"TapLeavesOptions"],[3,"DescriptorXKey"],[3,"DescriptorMultiXKey"],[3,"PrivateKey"],[3,"Hash"],[4,"Error"],[8,"CoinSelectionAlgorithm"],[4,"AddForeignUtxoError"],[4,"AddUtxoError"],[4,"AllowShrinkingError"],[4,"ChangeSpendPolicy"],[4,"TxOrdering"],[4,"LockTime"],[15,"i32"],[13,"Foreign"],[8,"ExtractPolicy"],[13,"PsbtTimelocks"],[13,"Complete"],[13,"Partial"],[13,"PartialComplete"],[13,"Sha256Preimage"],[13,"Hash256Preimage"],[13,"Ripemd160Preimage"],[13,"Hash160Preimage"],[13,"Thresh"],[13,"Multisig"],[13,"AbsoluteTimelock"],[13,"RelativeTimelock"],[8,"DescriptorTemplate"],[8,"GeneratableKey"],[8,"ExtScriptContext"],[8,"GeneratableDefaultOptions"],[8,"PsbtUtils"],[8,"IsDust"],[13,"UnexpectedConnectedToHash"],[13,"ConfirmationHeightCannotBeGreaterThanTip"],[13,"LoadedGenesisDoesNotMatch"],[13,"LoadedNetworkDoesNotMatch"],[13,"InsufficientFunds"],[13,"Change"],[13,"NoChange"],[13,"InsufficientFunds"],[13,"RbfSequenceCsv"],[13,"LockTime"],[13,"FeeTooLow"],[13,"FeeRateTooLow"],[8,"SignerCommon"],[8,"InputSigner"],[13,"Tap"],[13,"InvalidTxid"]]},\ "bdk_bitcoind_rpc":{"doc":"This crate is used for emitting blockchain data from the …","t":[8,3,3,2,12,11,11,11,11,11,11,12,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11],"n":["BitcoindRpcErrorExt","BlockEvent","Emitter","bitcoincore_rpc","block","block_hash","block_height","borrow","borrow","borrow_mut","borrow_mut","checkpoint","connected_to","fmt","from","from","into","into","is_not_found_error","mempool","new","next_block","next_header","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip"],"q":["bdk_bitcoind_rpc","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Extends bitcoincore_rpc::Error.","A newly emitted block from Emitter.","The Emitter is used to emit data sourced from …","","Either a full Block or Header of the new block.","The block hash of this new block.","The block height of this new block.","","","","","The checkpoint of the new block.","The BlockId of a previous block that this block connects …","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Returns whether the error is a “not found” error.","Emit mempool transactions, alongside their first-seen unix …","Construct a new Emitter.","Emit the next block height and block (if any).","Emit the next block height and header (if any).","","","","","","","",""],"i":[0,0,0,0,1,1,1,10,1,10,1,1,1,1,10,1,10,1,19,10,10,10,10,10,1,10,1,10,1,10,1],"f":[0,0,0,0,0,[1,2],[1,3],[[]],[[]],[[]],[[]],0,[1,4],[[[1,[5]],6],7],[[]],[[]],[[]],[[]],[[],8],[[[10,[9]]],[[13,[11,12]]]],[[14,3],[[10,[9]]]],[[[10,[9]]],[[13,[[16,[[1,[15]]]],12]]]],[[[10,[9]]],[[13,[[16,[[1,[17]]]],12]]]],[[],13],[[],13],[[],13],[[],13],[[],18],[[],18],[[]],[[]]],"p":[[3,"BlockEvent"],[3,"BlockHash"],[15,"u32"],[3,"BlockId"],[8,"Debug"],[3,"Formatter"],[6,"Result"],[15,"bool"],[8,"RpcApi"],[3,"Emitter"],[3,"Vec"],[4,"Error"],[4,"Result"],[3,"CheckPoint"],[3,"Block"],[4,"Option"],[3,"Header"],[3,"TypeId"],[8,"BitcoindRpcErrorExt"]]},\ -"bdk_chain":{"doc":"This crate is a collection of core structures for Bitcoin …","t":[8,8,8,17,3,17,8,4,3,4,3,13,13,8,16,3,2,3,3,2,13,13,11,10,11,11,11,12,12,10,11,2,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,10,11,11,11,11,11,12,12,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,10,11,12,11,11,11,0,0,11,2,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,3,16,3,8,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,10,10,12,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,3,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,3,4,13,3,6,3,3,13,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,4,3,3,13,13,3,3,3,3,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,12,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["Anchor","AnchorFromBlockPosition","Append","BIP32_MAX_INDEX","BlockId","COINBASE_MATURITY","ChainOracle","ChainPosition","ConfirmationHeightAnchor","ConfirmationTime","ConfirmationTimeHeightAnchor","Confirmed","Confirmed","DescriptorExt","Error","FullTxOut","IndexedTxGraph","SpkIterator","SpkTxOutIndex","TxGraph","Unconfirmed","Unconfirmed","all_spks","anchor_block","anchor_block","anchor_block","anchor_block","anchor_block","anchor_block","append","apply_changeset","bitcoin","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","chain_position","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cloned","cmp","cmp","cmp","cmp","cmp","cmp","confirmation_height","confirmation_height","confirmation_height_upper_bound","confirmation_height_upper_bound","confirmation_height_upper_bound","confirmation_height_upper_bound","confirmation_height_upper_bound","confirmation_time","default","default","default","default","descriptor","deserialize","deserialize","deserialize","deserialize","dust_value","eq","eq","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from_block_position","from_block_position","from_block_position","from_block_position","get_chain_tip","hash","hash","hash","hash","hash","hash","height","index_of_spk","index_tx","index_txout","indexed_tx_graph","initial_changeset","insert_spk","into","into","into","into","into","into","into","into","into_iter","is_block_in_chain","is_confirmed","is_confirmed","is_confirmed_and_spendable","is_empty","is_mature","is_on_coinbase","is_relevant","is_tx_relevant","is_used","keychain","local_chain","mark_used","miniscript","net_value","new","new_with_range","next","nth","outpoint","outpoints","outputs_in_range","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","scan","scan_txout","sent_and_received","serialize","serialize","serialize","serialize","spent_by","spk_at_index","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tx_graph","txout","txout","txouts","txouts_in_tx","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unconfirmed","unmark_used","unused_spks","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","height","last_seen","time","ChangeSet","ChangeSet","IndexedTxGraph","Indexer","append","apply_block","apply_block_relevant","apply_changeset","apply_changeset","apply_update","batch_insert_relevant","batch_insert_relevant_unconfirmed","batch_insert_unconfirmed","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","default","default","deserialize","eq","fmt","fmt","from","from","from","from","graph","graph","index","index_tx","index_txout","indexer","initial_changeset","initial_changeset","insert_anchor","insert_seen_at","insert_tx","insert_txout","into","into","is_empty","is_tx_relevant","new","serialize","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","Balance","ChangeSet","KeychainTxOutIndex","add","add_keychain","all_unbounded_spk_iters","append","apply_changeset","apply_changeset","as_inner","as_ref","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","confirmed","default","default","default","deserialize","deserialize","eq","eq","fmt","fmt","fmt","fmt","from","from","from","immature","index_of_spk","index_tx","index_txout","initial_changeset","inner","into","into","into","is_empty","is_tx_relevant","is_used","keychain_outpoints","keychain_outpoints_in_range","keychains","last_revealed_index","last_revealed_indices","last_used_index","last_used_indices","lookahead","lookahead_to_target","mark_used","net_value","new","next_index","next_unused_spk","outpoints","reveal_next_spk","reveal_to_target","reveal_to_target_multi","revealed_keychain_spks","revealed_spks","sent_and_received","serialize","serialize","spk_at_index","to_owned","to_owned","to_owned","to_string","total","trusted_pending","trusted_spendable","try_from","try_from","try_from","try_into","try_into","try_into","txout","txouts","txouts_in_tx","type_id","type_id","type_id","unbounded_spk_iter","unmark_used","untrusted_pending","unused_keychain_spks","unused_spks","vzip","vzip","vzip","AlterCheckPointError","ApplyHeaderError","CannotConnect","CannotConnectError","ChangeSet","CheckPoint","CheckPointIter","InconsistentBlocks","LocalChain","MissingGenesisError","apply_changeset","apply_header","apply_header_connected_to","apply_update","block_id","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","disconnect_from","eq","eq","eq","eq","eq","eq","extend","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from_block_ids","from_blocks","from_changeset","from_genesis_hash","from_header","from_tip","genesis_hash","get","get","get_chain_tip","hash","height","height","initial_changeset","insert","insert_block","into","into","into","into","into","into","into","into_iter","into_iter","is_block_in_chain","iter","iter_checkpoints","new","next","original_hash","prev","provide","provide","provide","provide","push","range","range","tip","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_include_height","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","update_hash","vzip","vzip","vzip","vzip","vzip","vzip","vzip","CalculateFeeError","CanonicalTx","ChangeSet","MissingTxOut","NegativeFee","TxAncestors","TxDescendants","TxGraph","TxNode","all_anchors","all_txouts","anchor_heights","anchors","anchors","append","apply_changeset","apply_update","as_ref","balance","batch_insert_unconfirmed","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","calculate_fee","chain_position","checked_sum","checked_sum","checked_sum","checked_sum","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","cmp","default","default","deref","deserialize","direct_conflicts","eq","eq","eq","eq","eq","filter_chain_txouts","filter_chain_unspents","floating_txouts","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","full_txs","get_chain_position","get_chain_spend","get_tx","get_tx_node","get_txout","initial_changeset","insert_anchor","insert_seen_at","insert_tx","insert_txout","into","into","into","into","into","into","into","into_iter","into_iter","is_empty","is_empty","last_seen","last_seen_unconfirmed","list_chain_txs","map_anchors","map_anchors","new","next","next","outspends","partial_cmp","partial_cmp","provide","serialize","to_owned","to_owned","to_owned","to_owned","to_string","try_balance","try_filter_chain_txouts","try_filter_chain_unspents","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_get_chain_position","try_get_chain_spend","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_list_chain_txs","tx","tx_node","tx_outputs","tx_spends","txid","txouts","txouts","txs","type_id","type_id","type_id","type_id","type_id","type_id","type_id","update_last_seen_unconfirmed","vzip","vzip","vzip","vzip","vzip","vzip","vzip","walk_ancestors","walk_conflicts","walk_descendants"],"q":["bdk_chain","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk_chain::ConfirmationTime","","","bdk_chain::indexed_tx_graph","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk_chain::keychain","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk_chain::local_chain","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk_chain::tx_graph","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Trait that “anchors” blockchain data to a specific …","An Anchor that can be constructed from a given block, …","Trait that makes an object appendable.","Maximum BIP32 derivation index.","A reference to a block in the canonical chain.","How many confirmations are needed f or a coinbase output …","Represents a service that tracks the blockchain.","Represents the observed position of some chain data.","An Anchor implementation that also records the exact …","Block height and timestamp at which a transaction is …","An Anchor implementation that also records the exact …","The chain data is seen as confirmed, and in anchored by A.","The transaction is confirmed","A trait to extend the functionality of a miniscript …","Error type.","A TxOut with as much data as we can retrieve about it","","An iterator for derived script pubkeys.","An index storing TxOuts that have a script pubkey that …","","The chain data is not confirmed and last seen in the …","The transaction is unconfirmed","The script pubkeys that are being tracked by the index.","Returns the BlockId that the associated blockchain data is …","","","","The anchor block.","The anchor block.","Append another object of the same type onto self.","","","","","","","","","","","","","","","","","","","The position of the transaction in outpoint in the overall …","","","","","","","","","","","","","","","","","Maps a ChainPosition<&A> into a ChainPosition<A> by …","","","","","","","The exact confirmation height of the transaction.","The confirmation height of the transaction being anchored.","Get the upper bound of the chain data’s confirmation …","Get the upper bound of the chain data’s confirmation …","Determines the upper bound of the confirmation height.","","","The confirmation time of the transaction being anchored.","","","","","Get a reference to the internal descriptor.","","","","","Returns the minimum value (in satoshis) at which an output …","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Construct the anchor from a given block, block height and …","","","","Get the best chain’s chain tip.","","","","","","The hash of the block.","The height of the block.","Returns the index associated with the script pubkey.","","","Contains the IndexedTxGraph and associated types. Refer to …","","Adds a script pubkey to scan for. Returns false and does …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","Determines whether block of BlockId exists as an ancestor …","Returns whether ChainPosition is confirmed or not.","Returns whether ConfirmationTime is the confirmed variant.","Whether the utxo is/was/will be spendable with chain tip.","Returns whether the structure is considered empty.","Whether the txout is considered mature.","Whether this output is on a coinbase transaction.","Whether any of the inputs of this transaction spend a …","","Returns whether the script pubkey at index has been used …","Module for keychain related structures.","The LocalChain is a local implementation of ChainOracle.","Marks the script pubkey at index as used even though it …","","Computes the net value transfer effect of tx on the script …","Create a new script pubkey iterator from descriptor.","Create a new script pubkey iterator from descriptor and a …","","","The location of the TxOut.","Get a reference to the set of indexed outpoints.","Iterates over all the outputs with script pubkeys in an …","","","","","","","Scans a transaction’s outputs for matching script …","Scan a single TxOut for a matching script pubkey and …","Computes the total value transfer effect tx has on the …","","","","","The txid and chain position of the transaction (if any) …","Returns the script that has been inserted at the index.","","","","","","","","","","","","","","","","","","","","","","","","","Module for structures that store and traverse transactions.","Returns the txout and script pubkey index of the TxOut at …","The TxOut.","Iterate over all known txouts that spend to tracked script …","Finds all txouts on a transaction that has previously been …","","","","","","","","","Construct an unconfirmed variant using the given last_seen …","Undoes the effect of mark_used. Returns whether the index …","Iterates over all unused script pubkeys in an index range.","","","","","","","","","Confirmation height.","The last-seen timestamp in unix seconds.","Confirmation time in unix seconds.","Represents changes to an IndexedTxGraph.","The resultant “changeset” when new transaction data is …","The IndexedTxGraph combines a TxGraph and an Indexer …","Utilities for indexing transaction data.","","Batch insert all transactions of the given block of height.","Batch insert all transactions of the given block of height…","Apply changeset to itself.","Applies the ChangeSet to the IndexedTxGraph.","Apply an update directly.","Batch insert transactions, filtering out those that are …","Batch insert unconfirmed transactions, filtering out those …","Batch insert unconfirmed transactions.","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Get a reference of the internal transaction graph.","TxGraph changeset.","Transaction index.","Scans a transaction for relevant outpoints, which are …","Scan and index the given outpoint and txout.","Indexer changeset.","Determines the ChangeSet between self and an empty Indexer.","Determines the ChangeSet between self and an empty …","Insert an anchor for a given transaction.","Insert a unix timestamp of when a transaction is seen in …","Insert and index a transaction into the graph.","Insert a floating txout of given outpoint.","Calls U::from(self).","Calls U::from(self).","","Determines whether the transaction should be included in …","Construct a new IndexedTxGraph with a given index.","","","","","","","","","","","Balance, differentiated into various categories.","Represents updates to the derivation index of a …","KeychainTxOutIndex controls how script pubkeys are …","","Add a keychain to the tracker’s txout_index with a …","Get unbounded spk iterators for all keychains.","Append another ChangeSet into self.","","Applies the derivation changeset to the KeychainTxOutIndex…","Get the inner map of the keychain to its new derivation …","","","","","","","","","","","","","","Confirmed and immediately spendable balance","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","All coinbase outputs not yet matured","Returns the keychain and keychain index associated with …","","","","Return a reference to the internal SpkTxOutIndex.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns whether the changeset are empty.","","Returns whether the spk under the keychain’s index has …","Iterate over all OutPoints that have TxOuts with script …","Iterate over OutPoints that have script pubkeys derived …","Return a reference to the internal map of keychain to …","Get the last derivation index revealed for keychain.","Get the last derivation index that is revealed for each …","Returns the highest derivation index of the keychain where …","Returns the highest derivation index of each keychain that …","Get the lookahead setting.","Store lookahead scripts until target_index (inclusive).","Marks the script pubkey at index as used even though the …","Computes the net value that this transaction gives to the …","Construct a KeychainTxOutIndex with the given lookahead.","Get the next derivation index for keychain. The next index …","Gets the next unused script pubkey in the keychain. I.e., …","Get a reference to the set of indexed outpoints.","Attempts to reveal the next script pubkey for keychain.","Reveals script pubkeys of the keychain’s descriptor up …","Convenience method to call Self::reveal_to_target on …","Iterate over revealed spks of the given keychain.","Iterate over revealed spks of keychains in range","Computes the total value transfer effect tx has on the …","","","Return the script that exists under the given keychain’s …","","","","","Get the whole balance visible to the wallet.","Unconfirmed UTXOs generated by a wallet tx","Get sum of trusted_pending and confirmed coins.","","","","","","","Return the TxOut of outpoint if it has been indexed.","Iterate over known txouts that spend to tracked script …","Finds all txouts on a transaction that has previously been …","","","","Get an unbounded spk iterator over a given keychain.","Undoes the effect of mark_used. Returns whether the index …","Unconfirmed UTXOs received from an external wallet","Iterate over revealed, but unused, spks of the given …","Iterate over revealed, but unused, spks of all keychains.","","","","Represents a failure when trying to insert/remove a …","The error type for LocalChain::apply_header_connected_to.","Occurs when the update cannot connect with the original …","Occurs when an update does not have a common checkpoint …","The ChangeSet represents changes to LocalChain.","A LocalChain checkpoint is used to find the agreement …","Iterates over checkpoints backwards.","Occurs when connected_to block conflicts with either the …","This is a local implementation of ChainOracle.","An error which occurs when a LocalChain is constructed …","Apply the given changeset.","Update the chain with a given Header connecting it with …","Update the chain with a given Header at height which you …","Applies the given update to the chain.","Get the BlockId of the checkpoint.","","","","","","","","","","","","","","","","","","","","","","","","","","","Removes blocks from (and inclusive of) the given block_id.","","","","","","","Extends the checkpoint linked list by a iterator of block …","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Construct a checkpoint from a list of BlockIds in …","Constructs a LocalChain from a BTreeMap of height to …","Construct a LocalChain from an initial changeset.","Construct LocalChain from genesis hash.","Construct a checkpoint from the given header and block …","Construct a LocalChain from a given checkpoint tip.","Get the genesis hash.","Get checkpoint at height.","Get checkpoint at given height (if it exists).","","Get the block hash of the checkpoint.","Get the height of the checkpoint.","The checkpoint’s height.","Derives an initial ChangeSet, meaning that it can be …","Inserts block_id at its height within the chain.","Insert a BlockId.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","Iterate from this checkpoint in descending height.","Iterate over checkpoints in descending height order.","Construct a new base block at the front of a linked list.","","The original checkpoint’s block hash which cannot be …","Get the previous checkpoint in the chain","","","","","Puts another checkpoint onto the linked list representing …","Iterate checkpoints over a height range.","Iterate checkpoints over a height range.","Get the highest checkpoint.","","","","","","","","","","","","","","","","","","The suggested checkpoint to include to connect the two …","","","","","","","","","","","","","","","The attempted update to the original_block hash.","","","","","","","","Errors returned by TxGraph::calculate_fee.","A transaction that is included in the chain, or is still …","The ChangeSet represents changes to a TxGraph.","Missing TxOut for one or more of the inputs of the tx","When the transaction is invalid according to the graph it …","An iterator that traverses ancestors of a given root …","An iterator that traverses transaction descendants.","A graph of transactions and spends.","A transaction node in the TxGraph.","Get all transaction anchors known by TxGraph.","Iterate over all tx outputs known by TxGraph.","Iterates over the heights of that the new transaction …","The blocks that the transaction is “anchored” in.","Added anchors.","","Applies ChangeSet to TxGraph.","Extends this graph with another so that self becomes the …","","Get the total balance of outpoints that are in chain of …","Batch insert unconfirmed transactions.","","","","","","","","","","","","","","","Calculates the fee of a given transaction. Returns 0 if tx …","How the transaction is observed as (confirmed or …","","","","","","","","","","","","","","","","","","","Given a transaction, return an iterator of txids that …","","","","","","Get a filtered list of outputs from the given outpoints …","Get a filtered list of unspent outputs (UTXOs) from the …","Iterate over floating txouts known by TxGraph.","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Iterate over all full transactions in the graph.","Get the position of the transaction in chain with tip …","Get the txid of the spending transaction and where the …","Get a transaction by txid. This only returns Some for full …","Get a transaction node by txid. This only returns Some for …","Obtains a single tx output (if any) at the specified …","Determines the ChangeSet between self and an empty TxGraph.","Inserts the given anchor into TxGraph.","Inserts the given seen_at for txid into TxGraph.","Inserts the given transaction into TxGraph.","Inserts the given TxOut at OutPoint.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","Whether the graph has any transactions or outputs in it.","","Added last-seen unix timestamps of transactions.","The last-seen unix timestamp of the transaction as …","List graph transactions that are in chain with chain_tip.","Transform the TxGraph to have Anchors of another type.","Transform the ChangeSet to have Anchors of another type.","Construct a new TxGraph from a list of transactions.","","","The transactions spending from this output.","","","","","","","","","","Get the total balance of outpoints that are in chain of …","Get a filtered list of outputs from the given outpoints …","Get a filtered list of unspent outputs (UTXOs) from the …","","","","","","","","Get the position of the transaction in chain with tip …","Get the txid of the spending transaction and where the …","","","","","","","","List graph transactions that are in chain with chain_tip.","A partial or full representation of the transaction.","The transaction node (as part of the graph).","Returns known outputs of a given txid.","Iterates over the transactions spending from txid.","Txid of the transaction.","Iterates over all outpoints contained within ChangeSet.","Added txouts.","Added transactions.","","","","","","","","Update the last seen time for all unconfirmed transactions.","","","","","","","","Creates an iterator that filters and maps ancestor …","Creates an iterator that both filters and maps conflicting …","Creates an iterator that filters and maps descendants from …"],"i":[0,0,0,0,0,0,0,0,0,0,0,8,9,0,75,0,0,0,0,0,8,9,3,14,5,6,7,6,7,39,3,0,3,8,9,5,6,7,10,11,3,8,9,5,6,7,10,11,10,3,8,9,5,6,7,10,11,3,8,9,5,6,7,10,11,8,8,9,5,6,7,10,6,7,14,14,8,6,7,7,3,5,6,7,11,9,5,6,7,76,8,9,5,6,7,10,3,8,9,5,6,7,10,3,8,9,9,5,5,5,6,7,10,11,77,5,6,7,75,8,9,5,6,7,5,5,3,3,3,0,3,3,3,8,9,5,6,7,10,11,11,75,8,9,10,39,10,10,3,3,3,0,0,3,0,3,11,11,11,11,10,3,3,8,9,5,6,7,10,3,3,3,9,5,6,7,10,3,3,8,9,5,6,7,10,11,3,8,9,5,6,7,10,11,3,8,9,5,6,7,10,11,0,3,10,3,3,3,8,9,5,6,7,10,11,9,3,3,3,8,9,5,6,7,10,11,78,79,78,0,41,0,0,40,42,42,41,42,42,42,42,42,42,40,42,40,40,40,42,40,40,40,42,40,42,40,40,40,42,40,42,41,41,40,41,42,42,42,42,42,42,40,40,41,42,40,40,42,40,42,40,42,40,42,40,0,0,0,48,49,49,46,49,49,46,46,49,46,48,49,46,48,49,46,48,49,46,48,48,49,46,48,46,48,46,48,49,46,48,48,49,46,48,48,49,49,49,49,49,49,46,48,46,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,46,48,49,49,46,48,48,48,48,48,49,46,48,49,46,48,49,49,49,49,46,48,49,49,48,49,49,49,46,48,0,0,58,0,0,0,0,58,0,0,53,53,53,53,59,62,59,53,55,60,57,58,62,59,53,55,60,57,58,59,53,55,60,57,58,59,53,55,60,57,58,53,59,53,55,60,57,58,59,59,53,55,55,60,60,57,57,58,58,62,59,53,55,60,57,58,59,53,53,53,59,53,53,59,53,53,59,59,60,53,59,53,62,59,53,55,60,57,58,62,59,53,59,53,59,62,60,59,55,60,57,58,59,59,53,53,59,53,55,60,57,58,55,60,57,58,62,59,53,55,60,57,58,57,62,59,53,55,60,57,58,62,59,53,55,60,57,58,60,62,59,53,55,60,57,58,0,0,0,66,66,0,0,0,0,43,43,47,69,47,47,43,43,43,43,43,72,73,43,69,70,66,47,72,73,43,69,70,66,47,43,70,72,72,73,73,43,69,70,47,43,69,70,47,69,70,43,47,69,47,43,43,69,70,66,47,43,43,43,43,69,70,66,66,47,72,73,43,69,70,66,47,43,43,43,43,43,43,43,43,43,43,43,72,73,43,69,70,66,47,72,73,43,47,47,69,43,43,47,43,72,73,43,69,70,66,47,43,69,70,47,66,43,43,43,72,73,43,69,70,66,47,43,43,72,73,43,69,70,66,47,43,69,70,43,43,69,47,47,47,72,73,43,69,70,66,47,43,72,73,43,69,70,66,47,43,43,43],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[[3,[[0,[1,2]]]]],4],[[],5],[5,5],[6,5],[7,5],0,0,[[]],[[[3,[[0,[1,2]]]]]],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[[[3,[1]]],[[3,[1]]]],[[[8,[1]]],[[8,[1]]]],[9,9],[5,5],[6,6],[7,7],[[[10,[1]]],[[10,[1]]]],[[[11,[1]]],[[11,[1]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[8,[[8,[1]]]],[[[8,[2]],8],12],[[9,9],12],[[5,5],12],[[6,6],12],[[7,7],12],[[[10,[2]],10],12],0,0,[[],13],[[],13],[[[8,[14]]],[[15,[13]]]],[6,13],[7,13],0,[[],3],[[],5],[[],6],[[],7],[11],[[],[[16,[9]]]],[[],[[16,[5]]]],[[],[[16,[6]]]],[[],[[16,[7]]]],[[],17],[[[8,[18]],8],19],[[9,9],19],[[5,5],19],[[6,6],19],[[7,7],19],[[[10,[18]],10],19],[[[3,[20]],21],22],[[[8,[20]],21],22],[[9,21],22],[[5,21],22],[[6,21],22],[[7,21],22],[[[10,[20]],21],22],[[]],[[]],[[]],[[[8,[7]]],9],[[]],[[],5],[[],5],[[]],[[]],[[]],[[]],[[23,5,24]],[[23,5,24],5],[[23,5,24],6],[[23,5,24],7],[[],[[16,[5]]]],[[[8,[25]]]],[9],[5],[6],[7],0,0,[[[3,[[0,[1,2]]]],26],15],[[[3,[[0,[1,2]]]],27]],[[[3,[[0,[1,2]]]],28,29]],0,[[[3,[[0,[1,2]]]]]],[[[3,[[0,[1,2]]]],[0,[1,2]],30],19],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[5,5],[[16,[[15,[19]]]]]],[8,19],[9,19],[[[10,[14]],13],19],[[],19],[[[10,[14]],13],19],0,[[[3,[[0,[1,2]]]],27],19],[[[3,[[0,[1,2]]]],27],19],[[[3,[[0,[1,2]]]]],19],0,0,[[[3,[[0,[1,2]]]]],19],0,[[[3,[[0,[1,2]]]],27,[31,[[0,[1,2]]]]],32],[[],11],[[],11],[11,15],[[11,24],15],0,[[[3,[[0,[1,2]]]]],33],[[[3,[[0,[1,2]]]],[31,[[0,[1,2]]]]],34],[[[8,[35]],8],[[15,[12]]]],[[9,9],[[15,[12]]]],[[5,5],[[15,[12]]]],[[6,6],[[15,[12]]]],[[7,7],[[15,[12]]]],[[[10,[35]],10],[[15,[12]]]],[[[3,[[0,[1,2]]]],27],[[33,[[0,[1,2]]]]]],[[[3,[[0,[1,2]]]],28,29],15],[[[3,[[0,[1,2]]]],27,[31,[[0,[1,2]]]]]],[9,16],[5,16],[6,16],[7,16],0,[[[3,[[0,[1,2]]]]],[[15,[26]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],0,[[[3,[[0,[1,2]]]],28],15],0,[[[3,[[0,[1,2]]]]],[[0,[34,36]]]],[[[3,[[0,[1,2]]]],37],34],[[],38],[[],38],[[],38],[[],38],[[],38],[[],38],[[],38],[[],38],[17,9],[[[3,[[0,[1,2]]]]],19],[[[3,[[0,[1,2]]]]],[[0,[34,1]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,[[[40,[14,39]],[40,[14,39]]]],[[[42,[41]],23,13],40],[[[42,[41]],23,13],40],[[]],[[[42,[14,41]],[40,[14]]]],[[[42,[14,41]],[43,[14]]],[[40,[14]]]],[[[42,[14,41]],44],[[40,[14]]]],[[[42,[14,41]],44],[[40,[14]]]],[[[42,[14,41]],44],[[40,[14]]]],[[]],[[]],[[]],[[]],[[[40,[1,1]]],[[40,[1,1]]]],[[]],[[],[[42,[45]]]],[[],[[40,[45]]]],[[],[[16,[40]]]],[[[40,[18,18]],40],19],[[[42,[20,20]],21],22],[[[40,[20,20]],21],22],[[]],[[]],[46,[[40,[46]]]],[47,[[40,[45]]]],[42,43],0,0,[27],[[28,29]],0,[[]],[[[42,[14,41]]],[[40,[14]]]],[[[42,[14,41]],37,14],[[40,[14]]]],[[[42,[14,41]],37,17],[[40,[14]]]],[[[42,[14,41]],27],[[40,[14]]]],[[[42,[14,41]],28,29],[[40,[14]]]],[[]],[[]],[[[40,[14,39]]],19],[27,19],[[],42],[40,16],[[]],[[],16],[[],16],[[],16],[[],16],[[],38],[[],38],[[]],[[]],0,0,0,[[48,48],48],[[[49,[[0,[1,2,20]]]],[0,[1,2,20]],[51,[50]]]],[[[49,[[0,[1,2,20]]]]],[[4,[[0,[1,2,20]],[11,[[51,[50]]]]]]]],[[[46,[2]],[46,[2]]]],[[[49,[[0,[1,2,20]]]]]],[[[49,[[0,[1,2,20]]]],[46,[[0,[1,2,20]]]]]],[46,4],[46,4],[[]],[[]],[[]],[[]],[[]],[[]],[[[49,[1]]],[[49,[1]]]],[[[46,[1]]],[[46,[1]]]],[48,48],[[]],[[]],[[]],0,[[],49],[[],46],[[],48],[[],[[16,[46]]]],[[],[[16,[48]]]],[[[46,[18]],46],19],[[48,48],19],[[[49,[20]],21],22],[[[46,[20]],21],22],[[48,21],22],[[48,21],22],[[]],[[]],[[]],0,[[[49,[[0,[1,2,20]]]],26],15],[[[49,[[0,[1,2,20]]]],27]],[[[49,[[0,[1,2,20]]]],28,29]],[[[49,[[0,[1,2,20]]]]]],[[[49,[[0,[1,2,20]]]]],3],[[]],[[]],[[]],[[[46,[2]]],19],[[[49,[[0,[1,2,20]]]],27],19],[[[49,[[0,[1,2,20]]]],[0,[1,2,20]],13],19],[[[49,[[0,[1,2,20]]]]],34],[[[49,[[0,[1,2,20]]]],[31,[[0,[1,2,20]]]]],34],[[[49,[[0,[1,2,20]]]]],4],[[[49,[[0,[1,2,20]]]]],[[15,[13]]]],[[[49,[[0,[1,2,20]]]]],4],[[[49,[[0,[1,2,20]]]]],[[15,[13]]]],[[[49,[[0,[1,2,20]]]]],[[4,[[0,[1,2,20]],13]]]],[[[49,[[0,[1,2,20]]]]],13],[[[49,[[0,[1,2,20]]]],13]],[[[49,[[0,[1,2,20]]]],[0,[1,2,20]],13],19],[[[49,[[0,[1,2,20]]]],27,[31,[[0,[1,2,20]]]]],32],[13,49],[[[49,[[0,[1,2,20]]]]]],[[[49,[[0,[1,2,20]]]]]],[[[49,[[0,[1,2,20]]]]],33],[[[49,[[0,[1,2,20]]]]]],[[[49,[[0,[1,2,20]]]],13]],[[[49,[[0,[1,2,20]]]],4]],[[[49,[[0,[1,2,20]]]]],34],[[[49,[[0,[1,2,20]]]],[31,[[0,[1,2,20]]]]],[[0,[34,1]]]],[[[49,[[0,[1,2,20]]]],27,[31,[[0,[1,2,20]]]]]],[46,16],[48,16],[[[49,[[0,[1,2,20]]]],[0,[1,2,20]],13],[[15,[26]]]],[[]],[[]],[[]],[[],52],[48,17],0,[48,17],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[[49,[[0,[1,2,20]]]],28],15],[[[49,[[0,[1,2,20]]]]],[[0,[34,36]]]],[[[49,[[0,[1,2,20]]]],37],34],[[],38],[[],38],[[],38],[[[49,[[0,[1,2,20]]]]],[[11,[[51,[50]]]]]],[[[49,[[0,[1,2,20]]]],[0,[1,2,20]],13],19],0,[[[49,[[0,[1,2,20]]]]],[[0,[34,1]]]],[[[49,[[0,[1,2,20]]]]],[[0,[34,1]]]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,[[53,54],[[16,[55]]]],[[53,56,13],[[16,[54,57]]]],[[53,56,13,5],[[16,[54,58]]]],[[53,59],[[16,[54,57]]]],[59,5],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[59,59],[53,53],[55,55],[60,60],[57,57],[58,58],[[]],[[]],[[]],[[]],[[]],[[]],[[53,5],[[16,[54,55]]]],[[59,59],19],[[53,53],19],[[55,55],19],[[60,60],19],[[57,57],19],[[58,58],19],[[59,44],[[16,[59,59]]]],[[59,21],22],[[53,21],22],[[55,21],22],[[55,21],22],[[60,21],22],[[60,21],22],[[57,21],22],[[57,21],22],[[58,21],22],[[58,21],22],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[44,[[16,[59,[15,[59]]]]]],[[[4,[13,61]]],[[16,[53,55]]]],[54,[[16,[53,55]]]],[61],[[56,13],59],[59,[[16,[53,55]]]],[53,61],[[59,13],[[15,[59]]]],[[53,13],[[15,[59]]]],[53,[[16,[5]]]],[59,61],[59,13],0,[53,54],[[59,5],59],[[53,5],[[16,[54,60]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[59],[[53,5,5],[[16,[[15,[19]]]]]],[59,62],[53,62],[5,59],[62,15],0,[59,[[15,[59]]]],[63],[63],[63],[63],[[59,5],[[16,[59,59]]]],[59,64],[53,64],[53,59],[[]],[[]],[[]],[[]],[[]],[[]],[[],52],[[],52],[[],52],[[],52],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],0,[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],38],[[],38],[[],38],[[],38],[[],38],[[],38],[[],38],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,[43,33],[43,64],[47,64],0,0,[[[47,[2]],[47,[2]]]],[[[43,[[0,[1,2]]]],[47,[[0,[1,2]]]]]],[[[43,[[0,[1,2]]]],[43,[[0,[1,2]]]]],[[47,[[0,[1,2]]]]]],[43,43],[[[43,[14]],5,44,65],48],[[[43,[[0,[1,2]]]],44],[[47,[[0,[1,2]]]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[43,27],[[16,[17,66]]]],0,[[],[[15,[67]]]],[[],[[15,[68]]]],[[],[[15,[67]]]],[[],[[15,[68]]]],[[[43,[1]]],[[43,[1]]]],[[[69,[1,1]]],[[69,[1,1]]]],[[[70,[1,1]]],[[70,[1,1]]]],[[[47,[1]]],[[47,[1]]]],[[]],[[]],[[]],[[]],[[[69,[2,2]],69],12],[[[70,[2,2]],70],12],[[],43],[[],47],[69],[[],[[16,[47]]]],[[43,27],64],[[[43,[18]],43],19],[[[69,[18,18]],69],19],[[[70,[18,18]],70],19],[[66,66],19],[[[47,[18]],47],19],[[[43,[14]],5,44],64],[[[43,[14]],5,44],64],[43,64],[[[43,[20]],21],22],[[[69,[20,20]],21],22],[[[70,[20,20]],21],22],[[66,21],22],[[66,21],22],[[[47,[20]],21],22],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[43,64],[[[43,[14]],5,37],[[15,[8]]]],[[[43,[14]],5,28],15],[[43,37],[[15,[[71,[27]]]]]],[[43,37],[[15,[[69,[[71,[27]]]]]]]],[[43,28],[[15,[29]]]],[[[43,[[0,[1,2]]]]],[[47,[[0,[1,2]]]]]],[[[43,[[0,[1,2]]]],37,[0,[1,2]]],[[47,[[0,[1,2]]]]]],[[[43,[[0,[1,2]]]],37,17],[[47,[[0,[1,2]]]]]],[[[43,[[0,[1,2]]]],27],[[47,[[0,[1,2]]]]]],[[[43,[[0,[1,2]]]],28,29],[[47,[[0,[1,2]]]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[43,19],[[[47,[2]]],19],0,0,[[[43,[14]],5],64],[[[43,[[0,[1,2]]]]],[[43,[[0,[1,2]]]]]],[[[47,[2]]],[[47,[2]]]],[44,[[43,[[0,[1,2]]]]]],[72,15],[73,15],[[43,28],74],[[[69,[35,35]],69],[[15,[12]]]],[[[70,[35,35]],70],[[15,[12]]]],[63],[47,16],[[]],[[]],[[]],[[]],[[],52],[[[43,[14]],5,44,65],[[16,[48]]]],[[[43,[14]],5,44],64],[[[43,[14]],5,44],64],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[[43,[14]],5,37],[[16,[[15,[8]]]]]],[[[43,[14]],5,28],[[16,[15]]]],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[[43,[14]],5],64],0,0,[[43,37],[[15,[[4,[13,29]]]]]],[[43,37],34],0,[47,64],0,0,[[],38],[[],38],[[],38],[[],38],[[],38],[[],38],[[],38],[[[43,[[0,[1,2]]]],17],[[47,[[0,[1,2]]]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[43,[[0,[1,2]]]]],[[72,[[0,[1,2]]]]]],[[43,27],73],[[[43,[[0,[1,2]]]],37],[[73,[[0,[1,2]]]]]]],"p":[[8,"Clone"],[8,"Ord"],[3,"SpkTxOutIndex"],[3,"BTreeMap"],[3,"BlockId"],[3,"ConfirmationHeightAnchor"],[3,"ConfirmationTimeHeightAnchor"],[4,"ChainPosition"],[4,"ConfirmationTime"],[3,"FullTxOut"],[3,"SpkIterator"],[4,"Ordering"],[15,"u32"],[8,"Anchor"],[4,"Option"],[4,"Result"],[15,"u64"],[8,"PartialEq"],[15,"bool"],[8,"Debug"],[3,"Formatter"],[6,"Result"],[3,"Block"],[15,"usize"],[8,"Hash"],[3,"Script"],[3,"Transaction"],[3,"OutPoint"],[3,"TxOut"],[3,"ScriptBuf"],[8,"RangeBounds"],[15,"i64"],[3,"BTreeSet"],[8,"DoubleEndedIterator"],[8,"PartialOrd"],[8,"ExactSizeIterator"],[3,"Txid"],[3,"TypeId"],[8,"Append"],[3,"ChangeSet"],[8,"Indexer"],[3,"IndexedTxGraph"],[3,"TxGraph"],[8,"IntoIterator"],[8,"Default"],[3,"ChangeSet"],[3,"ChangeSet"],[3,"Balance"],[3,"KeychainTxOutIndex"],[4,"DescriptorPublicKey"],[4,"Descriptor"],[3,"String"],[3,"LocalChain"],[6,"ChangeSet"],[3,"MissingGenesisError"],[3,"Header"],[3,"CannotConnectError"],[4,"ApplyHeaderError"],[3,"CheckPoint"],[3,"AlterCheckPointError"],[3,"BlockHash"],[3,"CheckPointIter"],[3,"Demand"],[8,"Iterator"],[8,"FnMut"],[4,"CalculateFeeError"],[3,"Amount"],[3,"SignedAmount"],[3,"TxNode"],[3,"CanonicalTx"],[3,"Arc"],[3,"TxAncestors"],[3,"TxDescendants"],[3,"HashSet"],[8,"ChainOracle"],[8,"DescriptorExt"],[8,"AnchorFromBlockPosition"],[13,"Confirmed"],[13,"Unconfirmed"]]},\ +"bdk_chain":{"doc":"This crate is a collection of core structures for Bitcoin …","t":[8,8,8,17,3,17,8,4,3,4,3,13,13,8,16,3,2,3,3,2,13,13,11,10,11,11,11,12,12,10,11,2,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,10,11,11,11,11,11,12,12,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,10,11,12,11,11,11,0,0,11,2,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,3,16,3,8,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,10,10,12,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,3,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,3,4,13,3,6,3,3,13,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,3,3,3,3,11,11,11,11,11,11,11,11,11,11,11,12,12,11,12,12,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,4,3,3,13,13,3,3,3,3,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,12,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["Anchor","AnchorFromBlockPosition","Append","BIP32_MAX_INDEX","BlockId","COINBASE_MATURITY","ChainOracle","ChainPosition","ConfirmationHeightAnchor","ConfirmationTime","ConfirmationTimeHeightAnchor","Confirmed","Confirmed","DescriptorExt","Error","FullTxOut","IndexedTxGraph","SpkIterator","SpkTxOutIndex","TxGraph","Unconfirmed","Unconfirmed","all_spks","anchor_block","anchor_block","anchor_block","anchor_block","anchor_block","anchor_block","append","apply_changeset","bitcoin","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","chain_position","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cloned","cmp","cmp","cmp","cmp","cmp","cmp","confirmation_height","confirmation_height","confirmation_height_upper_bound","confirmation_height_upper_bound","confirmation_height_upper_bound","confirmation_height_upper_bound","confirmation_height_upper_bound","confirmation_time","default","default","default","default","descriptor","deserialize","deserialize","deserialize","deserialize","dust_value","eq","eq","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from_block_position","from_block_position","from_block_position","from_block_position","get_chain_tip","hash","hash","hash","hash","hash","hash","height","index_of_spk","index_tx","index_txout","indexed_tx_graph","initial_changeset","insert_spk","into","into","into","into","into","into","into","into","into_iter","is_block_in_chain","is_confirmed","is_confirmed","is_confirmed_and_spendable","is_empty","is_mature","is_on_coinbase","is_relevant","is_tx_relevant","is_used","keychain","local_chain","mark_used","miniscript","net_value","new","new_with_range","next","nth","outpoint","outpoints","outputs_in_range","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","scan","scan_txout","sent_and_received","serialize","serialize","serialize","serialize","spent_by","spk_at_index","spk_client","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tx_graph","txout","txout","txouts","txouts_in_tx","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unconfirmed","unmark_used","unused_spks","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","height","last_seen","time","ChangeSet","ChangeSet","IndexedTxGraph","Indexer","append","apply_block","apply_block_relevant","apply_changeset","apply_changeset","apply_update","batch_insert_relevant","batch_insert_relevant_unconfirmed","batch_insert_unconfirmed","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","default","default","deserialize","eq","fmt","fmt","from","from","from","from","graph","graph","index","index_tx","index_txout","indexer","initial_changeset","initial_changeset","insert_anchor","insert_seen_at","insert_tx","insert_txout","into","into","is_empty","is_tx_relevant","new","serialize","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","Balance","ChangeSet","KeychainTxOutIndex","add","add_keychain","all_unbounded_spk_iters","append","apply_changeset","apply_changeset","as_inner","as_ref","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","confirmed","default","default","default","deserialize","deserialize","eq","eq","fmt","fmt","fmt","fmt","from","from","from","immature","index_of_spk","index_tx","index_txout","initial_changeset","inner","into","into","into","is_empty","is_tx_relevant","is_used","keychain_outpoints","keychain_outpoints_in_range","keychains","last_revealed_index","last_revealed_indices","last_used_index","last_used_indices","lookahead","lookahead_to_target","mark_used","net_value","new","next_index","next_unused_spk","outpoints","reveal_next_spk","reveal_to_target","reveal_to_target_multi","revealed_keychain_spks","revealed_spks","sent_and_received","serialize","serialize","spk_at_index","to_owned","to_owned","to_owned","to_string","total","trusted_pending","trusted_spendable","try_from","try_from","try_from","try_into","try_into","try_into","txout","txouts","txouts_in_tx","type_id","type_id","type_id","unbounded_spk_iter","unmark_used","untrusted_pending","unused_keychain_spks","unused_spks","vzip","vzip","vzip","AlterCheckPointError","ApplyHeaderError","CannotConnect","CannotConnectError","ChangeSet","CheckPoint","CheckPointIter","InconsistentBlocks","LocalChain","MissingGenesisError","apply_changeset","apply_header","apply_header_connected_to","apply_update","block_id","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","disconnect_from","eq","eq","eq","eq","eq","eq","extend","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from_block_ids","from_blocks","from_changeset","from_genesis_hash","from_header","from_tip","genesis_hash","get","get","get_chain_tip","hash","height","height","initial_changeset","insert","insert_block","into","into","into","into","into","into","into","into_iter","into_iter","is_block_in_chain","iter","iter_checkpoints","new","next","original_hash","prev","provide","provide","provide","provide","push","range","range","tip","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_include_height","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","update_hash","vzip","vzip","vzip","vzip","vzip","vzip","vzip","FullScanRequest","FullScanResult","SyncRequest","SyncResult","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","chain_outpoints","chain_spks","chain_spks_for_keychain","chain_tip","chain_tip","chain_txids","chain_update","chain_update","from","from","from","from","from_chain_tip","from_chain_tip","from_keychain_txout_index","graph_update","graph_update","inspect_outpoints","inspect_spks","inspect_spks_for_all_keychains","inspect_spks_for_keychain","inspect_txids","into","into","into","into","last_active_indices","outpoints","populate_with_revealed_spks","set_outpoints","set_spks","set_spks_for_keychain","set_txids","spks","spks_by_keychain","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","txids","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","CalculateFeeError","CanonicalTx","ChangeSet","MissingTxOut","NegativeFee","TxAncestors","TxDescendants","TxGraph","TxNode","all_anchors","all_txouts","anchor_heights","anchors","anchors","append","apply_changeset","apply_update","as_ref","balance","batch_insert_unconfirmed","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","calculate_fee","chain_position","checked_sum","checked_sum","checked_sum","checked_sum","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","cmp","default","default","deref","deserialize","direct_conflicts","eq","eq","eq","eq","eq","filter_chain_txouts","filter_chain_unspents","floating_txouts","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","full_txs","get_chain_position","get_chain_spend","get_tx","get_tx_node","get_txout","initial_changeset","insert_anchor","insert_seen_at","insert_tx","insert_txout","into","into","into","into","into","into","into","into_iter","into_iter","is_empty","is_empty","last_seen","last_seen_unconfirmed","list_chain_txs","map_anchors","map_anchors","new","next","next","outspends","partial_cmp","partial_cmp","provide","serialize","to_owned","to_owned","to_owned","to_owned","to_string","try_balance","try_filter_chain_txouts","try_filter_chain_unspents","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_get_chain_position","try_get_chain_spend","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_list_chain_txs","tx","tx_node","tx_outputs","tx_spends","txid","txouts","txouts","txs","type_id","type_id","type_id","type_id","type_id","type_id","type_id","update_last_seen_unconfirmed","vzip","vzip","vzip","vzip","vzip","vzip","vzip","walk_ancestors","walk_conflicts","walk_descendants"],"q":["bdk_chain","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk_chain::ConfirmationTime","","","bdk_chain::indexed_tx_graph","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk_chain::keychain","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk_chain::local_chain","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk_chain::spk_client","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk_chain::tx_graph","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Trait that “anchors” blockchain data to a specific …","An Anchor that can be constructed from a given block, …","Trait that makes an object appendable.","Maximum BIP32 derivation index.","A reference to a block in the canonical chain.","How many confirmations are needed f or a coinbase output …","Represents a service that tracks the blockchain.","Represents the observed position of some chain data.","An Anchor implementation that also records the exact …","Block height and timestamp at which a transaction is …","An Anchor implementation that also records the exact …","The chain data is seen as confirmed, and in anchored by A.","The transaction is confirmed","A trait to extend the functionality of a miniscript …","Error type.","A TxOut with as much data as we can retrieve about it","","An iterator for derived script pubkeys.","An index storing TxOuts that have a script pubkey that …","","The chain data is not confirmed and last seen in the …","The transaction is unconfirmed","The script pubkeys that are being tracked by the index.","Returns the BlockId that the associated blockchain data is …","","","","The anchor block.","The anchor block.","Append another object of the same type onto self.","","","","","","","","","","","","","","","","","","","The position of the transaction in outpoint in the overall …","","","","","","","","","","","","","","","","","Maps a ChainPosition<&A> into a ChainPosition<A> by …","","","","","","","The exact confirmation height of the transaction.","The confirmation height of the transaction being anchored.","Get the upper bound of the chain data’s confirmation …","Get the upper bound of the chain data’s confirmation …","Determines the upper bound of the confirmation height.","","","The confirmation time of the transaction being anchored.","","","","","Get a reference to the internal descriptor.","","","","","Returns the minimum value (in satoshis) at which an output …","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Construct the anchor from a given block, block height and …","","","","Get the best chain’s chain tip.","","","","","","The hash of the block.","The height of the block.","Returns the index associated with the script pubkey.","","","Contains the IndexedTxGraph and associated types. Refer to …","","Adds a script pubkey to scan for. Returns false and does …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","Determines whether block of BlockId exists as an ancestor …","Returns whether ChainPosition is confirmed or not.","Returns whether ConfirmationTime is the confirmed variant.","Whether the utxo is/was/will be spendable with chain tip.","Returns whether the structure is considered empty.","Whether the txout is considered mature.","Whether this output is on a coinbase transaction.","Whether any of the inputs of this transaction spend a …","","Returns whether the script pubkey at index has been used …","Module for keychain related structures.","The LocalChain is a local implementation of ChainOracle.","Marks the script pubkey at index as used even though it …","","Computes the net value transfer effect of tx on the script …","Create a new script pubkey iterator from descriptor.","Create a new script pubkey iterator from descriptor and a …","","","The location of the TxOut.","Get a reference to the set of indexed outpoints.","Iterates over all the outputs with script pubkeys in an …","","","","","","","Scans a transaction’s outputs for matching script …","Scan a single TxOut for a matching script pubkey and …","Computes the total value transfer effect tx has on the …","","","","","The txid and chain position of the transaction (if any) …","Returns the script that has been inserted at the index.","Helper types for spk-based blockchain clients.","","","","","","","","","","","","","","","","","","","","","","","","","Module for structures that store and traverse transactions.","Returns the txout and script pubkey index of the TxOut at …","The TxOut.","Iterate over all known txouts that spend to tracked script …","Finds all txouts on a transaction that has previously been …","","","","","","","","","Construct an unconfirmed variant using the given last_seen …","Undoes the effect of mark_used. Returns whether the index …","Iterates over all unused script pubkeys in an index range.","","","","","","","","","Confirmation height.","The last-seen timestamp in unix seconds.","Confirmation time in unix seconds.","Represents changes to an IndexedTxGraph.","The resultant “changeset” when new transaction data is …","The IndexedTxGraph combines a TxGraph and an Indexer …","Utilities for indexing transaction data.","","Batch insert all transactions of the given block of height.","Batch insert all transactions of the given block of height…","Apply changeset to itself.","Applies the ChangeSet to the IndexedTxGraph.","Apply an update directly.","Batch insert transactions, filtering out those that are …","Batch insert unconfirmed transactions, filtering out those …","Batch insert unconfirmed transactions.","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Get a reference of the internal transaction graph.","TxGraph changeset.","Transaction index.","Scans a transaction for relevant outpoints, which are …","Scan and index the given outpoint and txout.","Indexer changeset.","Determines the ChangeSet between self and an empty Indexer.","Determines the ChangeSet between self and an empty …","Insert an anchor for a given transaction.","Insert a unix timestamp of when a transaction is seen in …","Insert and index a transaction into the graph.","Insert a floating txout of given outpoint.","Calls U::from(self).","Calls U::from(self).","","Determines whether the transaction should be included in …","Construct a new IndexedTxGraph with a given index.","","","","","","","","","","","Balance, differentiated into various categories.","Represents updates to the derivation index of a …","KeychainTxOutIndex controls how script pubkeys are …","","Add a keychain to the tracker’s txout_index with a …","Get unbounded spk iterators for all keychains.","Append another ChangeSet into self.","Applies the derivation changeset to the KeychainTxOutIndex…","","Get the inner map of the keychain to its new derivation …","","","","","","","","","","","","","","Confirmed and immediately spendable balance","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","All coinbase outputs not yet matured","Returns the keychain and keychain index associated with …","","","","Return a reference to the internal SpkTxOutIndex.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns whether the changeset are empty.","","Returns whether the spk under the keychain’s index has …","Iterate over all OutPoints that have TxOuts with script …","Iterate over OutPoints that have script pubkeys derived …","Return a reference to the internal map of keychain to …","Get the last derivation index revealed for keychain.","Get the last derivation index that is revealed for each …","Returns the highest derivation index of the keychain where …","Returns the highest derivation index of each keychain that …","Get the lookahead setting.","Store lookahead scripts until target_index (inclusive).","Marks the script pubkey at index as used even though the …","Computes the net value that this transaction gives to the …","Construct a KeychainTxOutIndex with the given lookahead.","Get the next derivation index for keychain. The next index …","Gets the next unused script pubkey in the keychain. I.e., …","Get a reference to the set of indexed outpoints.","Attempts to reveal the next script pubkey for keychain.","Reveals script pubkeys of the keychain’s descriptor up …","Convenience method to call Self::reveal_to_target on …","Iterate over revealed spks of the given keychain.","Iterate over revealed spks of keychains in range","Computes the total value transfer effect tx has on the …","","","Return the script that exists under the given keychain’s …","","","","","Get the whole balance visible to the wallet.","Unconfirmed UTXOs generated by a wallet tx","Get sum of trusted_pending and confirmed coins.","","","","","","","Return the TxOut of outpoint if it has been indexed.","Iterate over known txouts that spend to tracked script …","Finds all txouts on a transaction that has previously been …","","","","Get an unbounded spk iterator over a given keychain.","Undoes the effect of mark_used. Returns whether the index …","Unconfirmed UTXOs received from an external wallet","Iterate over revealed, but unused, spks of the given …","Iterate over revealed, but unused, spks of all keychains.","","","","Represents a failure when trying to insert/remove a …","The error type for LocalChain::apply_header_connected_to.","Occurs when the update cannot connect with the original …","Occurs when an update does not have a common checkpoint …","The ChangeSet represents changes to LocalChain.","A LocalChain checkpoint is used to find the agreement …","Iterates over checkpoints backwards.","Occurs when connected_to block conflicts with either the …","This is a local implementation of ChainOracle.","An error which occurs when a LocalChain is constructed …","Apply the given changeset.","Update the chain with a given Header connecting it with …","Update the chain with a given Header at height which you …","Applies the given update to the chain.","Get the BlockId of the checkpoint.","","","","","","","","","","","","","","","","","","","","","","","","","","","Removes blocks from (and inclusive of) the given block_id.","","","","","","","Extends the checkpoint linked list by a iterator of block …","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Construct a checkpoint from a list of BlockIds in …","Constructs a LocalChain from a BTreeMap of height to …","Construct a LocalChain from an initial changeset.","Construct LocalChain from genesis hash.","Construct a checkpoint from the given header and block …","Construct a LocalChain from a given checkpoint tip.","Get the genesis hash.","Get checkpoint at height.","Get checkpoint at given height (if it exists).","","Get the block hash of the checkpoint.","Get the height of the checkpoint.","The checkpoint’s height.","Derives an initial ChangeSet, meaning that it can be …","Inserts block_id at its height within the chain.","Insert a BlockId.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","Iterate from this checkpoint in descending height.","Iterate over checkpoints in descending height order.","Construct a new base block at the front of a linked list.","","The original checkpoint’s block hash which cannot be …","Get the previous checkpoint in the chain","","","","","Puts another checkpoint onto the linked list representing …","Iterate checkpoints over a height range.","Iterate checkpoints over a height range.","Get the highest checkpoint.","","","","","","","","","","","","","","","","","","The suggested checkpoint to include to connect the two …","","","","","","","","","","","","","","","The attempted update to the original_block hash.","","","","","","","","Data required to perform a spk-based blockchain client …","Data returned from a spk-based blockchain client full scan.","Data required to perform a spk-based blockchain client …","Data returned from a spk-based blockchain client sync.","","","","","","","","","Chain on additional OutPoints that will be synced against.","Chain on additional Scripts that will be synced against.","Chain on additional Scripts that will be synced against.","A checkpoint for the current chain LocalChain::tip. The …","A checkpoint for the current LocalChain::tip. The full …","Chain on additional Txids that will be synced against.","The update to apply to the receiving LocalChain.","The update to apply to the receiving TxGraph.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Construct a new SyncRequest from a given cp tip.","Construct a new FullScanRequest from a given chain_tip.","Construct a new FullScanRequest from a given chain_tip and …","The update to apply to the receiving TxGraph.","The update to apply to the receiving LocalChain.","Add a closure that will be called for OutPoints previously …","Add a closure that will be called for Scripts previously …","Add a closure that will be called for every Script …","Add a closure that will be called for every Script …","Add a closure that will be called for Txids previously …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Last active indices for the corresponding keychains (K).","Transactions with these outpoints or spent from these …","Populate the request with revealed script pubkeys from …","Set the OutPoints that will be synced against.","Set the Scripts that will be synced against.","Set the Scripts for a given keychain.","Set the Txids that will be synced against.","Transactions that spend from or to these indexed script …","Iterators of script pubkeys indexed by the keychain index.","","","","","","","","","Transactions with these txids.","","","","","","","","","Errors returned by TxGraph::calculate_fee.","A transaction that is included in the chain, or is still …","The ChangeSet represents changes to a TxGraph.","Missing TxOut for one or more of the inputs of the tx","When the transaction is invalid according to the graph it …","An iterator that traverses ancestors of a given root …","An iterator that traverses transaction descendants.","A graph of transactions and spends.","A transaction node in the TxGraph.","Get all transaction anchors known by TxGraph.","Iterate over all tx outputs known by TxGraph.","Iterates over the heights of that the new transaction …","The blocks that the transaction is “anchored” in.","Added anchors.","","Applies ChangeSet to TxGraph.","Extends this graph with another so that self becomes the …","","Get the total balance of outpoints that are in chain of …","Batch insert unconfirmed transactions.","","","","","","","","","","","","","","","Calculates the fee of a given transaction. Returns 0 if tx …","How the transaction is observed as (confirmed or …","","","","","","","","","","","","","","","","","","","Given a transaction, return an iterator of txids that …","","","","","","Get a filtered list of outputs from the given outpoints …","Get a filtered list of unspent outputs (UTXOs) from the …","Iterate over floating txouts known by TxGraph.","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Iterate over all full transactions in the graph.","Get the position of the transaction in chain with tip …","Get the txid of the spending transaction and where the …","Get a transaction by txid. This only returns Some for full …","Get a transaction node by txid. This only returns Some for …","Obtains a single tx output (if any) at the specified …","Determines the ChangeSet between self and an empty TxGraph.","Inserts the given anchor into TxGraph.","Inserts the given seen_at for txid into TxGraph.","Inserts the given transaction into TxGraph.","Inserts the given TxOut at OutPoint.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","Whether the graph has any transactions or outputs in it.","","Added last-seen unix timestamps of transactions.","The last-seen unix timestamp of the transaction as …","List graph transactions that are in chain with chain_tip.","Transform the TxGraph to have Anchors of another type.","Transform the ChangeSet to have Anchors of another type.","Construct a new TxGraph from a list of transactions.","","","The transactions spending from this output.","","","","","","","","","","Get the total balance of outpoints that are in chain of …","Get a filtered list of outputs from the given outpoints …","Get a filtered list of unspent outputs (UTXOs) from the …","","","","","","","","Get the position of the transaction in chain with tip …","Get the txid of the spending transaction and where the …","","","","","","","","List graph transactions that are in chain with chain_tip.","A partial or full representation of the transaction.","The transaction node (as part of the graph).","Returns known outputs of a given txid.","Iterates over the transactions spending from txid.","Txid of the transaction.","Iterates over all outpoints contained within ChangeSet.","Added txouts.","Added transactions.","","","","","","","","Update the last seen time for all unconfirmed transactions.","","","","","","","","Creates an iterator that filters and maps ancestor …","Creates an iterator that both filters and maps conflicting …","Creates an iterator that filters and maps descendants from …"],"i":[0,0,0,0,0,0,0,0,0,0,0,8,9,0,79,0,0,0,0,0,8,9,3,14,5,6,7,6,7,39,3,0,3,8,9,5,6,7,10,11,3,8,9,5,6,7,10,11,10,3,8,9,5,6,7,10,11,3,8,9,5,6,7,10,11,8,8,9,5,6,7,10,6,7,14,14,8,6,7,7,3,5,6,7,11,9,5,6,7,80,8,9,5,6,7,10,3,8,9,5,6,7,10,3,8,9,9,5,5,5,6,7,10,11,81,5,6,7,79,8,9,5,6,7,5,5,3,3,3,0,3,3,3,8,9,5,6,7,10,11,11,79,8,9,10,39,10,10,3,3,3,0,0,3,0,3,11,11,11,11,10,3,3,8,9,5,6,7,10,3,3,3,9,5,6,7,10,3,0,3,8,9,5,6,7,10,11,3,8,9,5,6,7,10,11,3,8,9,5,6,7,10,11,0,3,10,3,3,3,8,9,5,6,7,10,11,9,3,3,3,8,9,5,6,7,10,11,82,83,82,0,41,0,0,40,42,42,41,42,42,42,42,42,42,40,42,40,40,40,42,40,40,40,42,40,42,40,40,40,42,40,42,41,41,40,41,42,42,42,42,42,42,40,40,41,42,40,40,42,40,42,40,42,40,42,40,0,0,0,48,49,49,47,49,49,47,47,49,47,48,49,47,48,49,47,48,49,47,48,48,49,47,48,47,48,47,48,49,47,48,48,49,47,48,48,49,49,49,49,49,49,47,48,47,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,47,48,49,49,47,48,48,48,48,48,49,47,48,49,47,48,49,49,49,49,47,48,49,49,48,49,49,49,47,48,0,0,58,0,0,0,0,58,0,0,53,53,53,53,59,62,59,53,55,60,57,58,62,59,53,55,60,57,58,59,53,55,60,57,58,59,53,55,60,57,58,53,59,53,55,60,57,58,59,59,53,55,55,60,60,57,57,58,58,62,59,53,55,60,57,58,59,53,53,53,59,53,53,59,53,53,59,59,60,53,59,53,62,59,53,55,60,57,58,62,59,53,59,53,59,62,60,59,55,60,57,58,59,59,53,53,59,53,55,60,57,58,55,60,57,58,62,59,53,55,60,57,58,57,62,59,53,55,60,57,58,62,59,53,55,60,57,58,60,62,59,53,55,60,57,58,0,0,0,0,65,84,66,85,65,84,66,85,65,65,66,65,66,65,84,85,65,84,66,85,65,66,66,84,85,65,65,66,66,65,65,84,66,85,85,65,65,65,65,66,65,65,66,65,84,66,85,65,84,66,85,65,65,84,66,85,65,84,66,85,0,0,0,70,70,0,0,0,0,43,43,46,73,46,46,43,43,43,43,43,76,77,43,73,74,70,46,76,77,43,73,74,70,46,43,74,76,76,77,77,43,73,74,46,43,73,74,46,73,74,43,46,73,46,43,43,73,74,70,46,43,43,43,43,73,74,70,70,46,76,77,43,73,74,70,46,43,43,43,43,43,43,43,43,43,43,43,76,77,43,73,74,70,46,76,77,43,46,46,73,43,43,46,43,76,77,43,73,74,70,46,43,73,74,46,70,43,43,43,76,77,43,73,74,70,46,43,43,76,77,43,73,74,70,46,43,73,74,43,43,73,46,46,46,76,77,43,73,74,70,46,43,76,77,43,73,74,70,46,43,43,43],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[[3,[[0,[1,2]]]]],4],[[],5],[5,5],[6,5],[7,5],0,0,[[]],[[[3,[[0,[1,2]]]]]],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[[[3,[1]]],[[3,[1]]]],[[[8,[1]]],[[8,[1]]]],[9,9],[5,5],[6,6],[7,7],[[[10,[1]]],[[10,[1]]]],[[[11,[1]]],[[11,[1]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[8,[[8,[1]]]],[[[8,[2]],8],12],[[9,9],12],[[5,5],12],[[6,6],12],[[7,7],12],[[[10,[2]],10],12],0,0,[[],13],[[],13],[[[8,[14]]],[[15,[13]]]],[6,13],[7,13],0,[[],3],[[],5],[[],6],[[],7],[11],[[],[[16,[9]]]],[[],[[16,[5]]]],[[],[[16,[6]]]],[[],[[16,[7]]]],[[],17],[[[8,[18]],8],19],[[9,9],19],[[5,5],19],[[6,6],19],[[7,7],19],[[[10,[18]],10],19],[[[3,[20]],21],22],[[[8,[20]],21],22],[[9,21],22],[[5,21],22],[[6,21],22],[[7,21],22],[[[10,[20]],21],22],[[]],[[]],[[[8,[7]]],9],[[]],[[]],[[],5],[[],5],[[]],[[]],[[]],[[]],[[23,5,24]],[[23,5,24],5],[[23,5,24],6],[[23,5,24],7],[[],[[16,[5]]]],[[[8,[25]]]],[9],[5],[6],[7],0,0,[[[3,[[0,[1,2]]]],26],15],[[[3,[[0,[1,2]]]],27]],[[[3,[[0,[1,2]]]],28,29]],0,[[[3,[[0,[1,2]]]]]],[[[3,[[0,[1,2]]]],[0,[1,2]],30],19],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[5,5],[[16,[[15,[19]]]]]],[8,19],[9,19],[[[10,[14]],13],19],[[],19],[[[10,[14]],13],19],0,[[[3,[[0,[1,2]]]],27],19],[[[3,[[0,[1,2]]]],27],19],[[[3,[[0,[1,2]]]]],19],0,0,[[[3,[[0,[1,2]]]]],19],0,[[[3,[[0,[1,2]]]],27,[31,[[0,[1,2]]]]],32],[[],11],[[],11],[11,15],[[11,24],15],0,[[[3,[[0,[1,2]]]]],33],[[[3,[[0,[1,2]]]],[31,[[0,[1,2]]]]],34],[[[8,[35]],8],[[15,[12]]]],[[9,9],[[15,[12]]]],[[5,5],[[15,[12]]]],[[6,6],[[15,[12]]]],[[7,7],[[15,[12]]]],[[[10,[35]],10],[[15,[12]]]],[[[3,[[0,[1,2]]]],27],[[33,[[0,[1,2]]]]]],[[[3,[[0,[1,2]]]],28,29],15],[[[3,[[0,[1,2]]]],27,[31,[[0,[1,2]]]]]],[9,16],[5,16],[6,16],[7,16],0,[[[3,[[0,[1,2]]]]],[[15,[26]]]],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],0,[[[3,[[0,[1,2]]]],28],15],0,[[[3,[[0,[1,2]]]]],[[0,[34,36]]]],[[[3,[[0,[1,2]]]],37],34],[[],38],[[],38],[[],38],[[],38],[[],38],[[],38],[[],38],[[],38],[17,9],[[[3,[[0,[1,2]]]]],19],[[[3,[[0,[1,2]]]]],[[0,[34,1]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,[[[40,[14,39]],[40,[14,39]]]],[[[42,[41]],23,13],40],[[[42,[41]],23,13],40],[[]],[[[42,[14,41]],[40,[14]]]],[[[42,[14,41]],[43,[14]]],[[40,[14]]]],[[[42,[14,41]],44],[[40,[14]]]],[[[42,[14,41]],44],[[40,[14]]]],[[[42,[14,41]],44],[[40,[14]]]],[[]],[[]],[[]],[[]],[[[40,[1,1]]],[[40,[1,1]]]],[[]],[[],[[42,[45]]]],[[],[[40,[45]]]],[[],[[16,[40]]]],[[[40,[18,18]],40],19],[[[42,[20,20]],21],22],[[[40,[20,20]],21],22],[[]],[[]],[46,[[40,[45]]]],[47,[[40,[47]]]],[42,43],0,0,[27],[[28,29]],0,[[]],[[[42,[14,41]]],[[40,[14]]]],[[[42,[14,41]],37,14],[[40,[14]]]],[[[42,[14,41]],37,17],[[40,[14]]]],[[[42,[14,41]],27],[[40,[14]]]],[[[42,[14,41]],28,29],[[40,[14]]]],[[]],[[]],[[[40,[14,39]]],19],[27,19],[[],42],[40,16],[[]],[[],16],[[],16],[[],16],[[],16],[[],38],[[],38],[[]],[[]],0,0,0,[[48,48],48],[[[49,[[0,[1,2,20]]]],[0,[1,2,20]],[51,[50]]]],[[[49,[[0,[1,2,20]]]]],[[4,[[0,[1,2,20]],[11,[[51,[50]]]]]]]],[[[47,[2]],[47,[2]]]],[[[49,[[0,[1,2,20]]]],[47,[[0,[1,2,20]]]]]],[[[49,[[0,[1,2,20]]]]]],[47,4],[47,4],[[]],[[]],[[]],[[]],[[]],[[]],[[[49,[1]]],[[49,[1]]]],[[[47,[1]]],[[47,[1]]]],[48,48],[[]],[[]],[[]],0,[[],49],[[],47],[[],48],[[],[[16,[47]]]],[[],[[16,[48]]]],[[[47,[18]],47],19],[[48,48],19],[[[49,[20]],21],22],[[[47,[20]],21],22],[[48,21],22],[[48,21],22],[[]],[[]],[[]],0,[[[49,[[0,[1,2,20]]]],26],15],[[[49,[[0,[1,2,20]]]],27]],[[[49,[[0,[1,2,20]]]],28,29]],[[[49,[[0,[1,2,20]]]]]],[[[49,[[0,[1,2,20]]]]],3],[[]],[[]],[[]],[[[47,[2]]],19],[[[49,[[0,[1,2,20]]]],27],19],[[[49,[[0,[1,2,20]]]],[0,[1,2,20]],13],19],[[[49,[[0,[1,2,20]]]]],34],[[[49,[[0,[1,2,20]]]],[31,[[0,[1,2,20]]]]],34],[[[49,[[0,[1,2,20]]]]],4],[[[49,[[0,[1,2,20]]]]],[[15,[13]]]],[[[49,[[0,[1,2,20]]]]],4],[[[49,[[0,[1,2,20]]]]],[[15,[13]]]],[[[49,[[0,[1,2,20]]]]],[[4,[[0,[1,2,20]],13]]]],[[[49,[[0,[1,2,20]]]]],13],[[[49,[[0,[1,2,20]]]],13]],[[[49,[[0,[1,2,20]]]],[0,[1,2,20]],13],19],[[[49,[[0,[1,2,20]]]],27,[31,[[0,[1,2,20]]]]],32],[13,49],[[[49,[[0,[1,2,20]]]]]],[[[49,[[0,[1,2,20]]]]]],[[[49,[[0,[1,2,20]]]]],33],[[[49,[[0,[1,2,20]]]]]],[[[49,[[0,[1,2,20]]]],13]],[[[49,[[0,[1,2,20]]]],4]],[[[49,[[0,[1,2,20]]]]],34],[[[49,[[0,[1,2,20]]]],[31,[[0,[1,2,20]]]]],[[0,[34,1]]]],[[[49,[[0,[1,2,20]]]],27,[31,[[0,[1,2,20]]]]]],[47,16],[48,16],[[[49,[[0,[1,2,20]]]],[0,[1,2,20]],13],[[15,[26]]]],[[]],[[]],[[]],[[],52],[48,17],0,[48,17],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[[49,[[0,[1,2,20]]]],28],15],[[[49,[[0,[1,2,20]]]]],[[0,[34,36]]]],[[[49,[[0,[1,2,20]]]],37],34],[[],38],[[],38],[[],38],[[[49,[[0,[1,2,20]]]]],[[11,[[51,[50]]]]]],[[[49,[[0,[1,2,20]]]],[0,[1,2,20]],13],19],0,[[[49,[[0,[1,2,20]]]]],[[0,[34,1]]]],[[[49,[[0,[1,2,20]]]]],[[0,[34,1]]]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,[[53,54],[[16,[55]]]],[[53,56,13],[[16,[54,57]]]],[[53,56,13,5],[[16,[54,58]]]],[[53,59],[[16,[54,57]]]],[59,5],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[59,59],[53,53],[55,55],[60,60],[57,57],[58,58],[[]],[[]],[[]],[[]],[[]],[[]],[[53,5],[[16,[54,55]]]],[[59,59],19],[[53,53],19],[[55,55],19],[[60,60],19],[[57,57],19],[[58,58],19],[[59,44],[[16,[59,59]]]],[[59,21],22],[[53,21],22],[[55,21],22],[[55,21],22],[[60,21],22],[[60,21],22],[[57,21],22],[[57,21],22],[[58,21],22],[[58,21],22],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[44,[[16,[59,[15,[59]]]]]],[[[4,[13,61]]],[[16,[53,55]]]],[54,[[16,[53,55]]]],[61],[[56,13],59],[59,[[16,[53,55]]]],[53,61],[[59,13],[[15,[59]]]],[[53,13],[[15,[59]]]],[53,[[16,[5]]]],[59,61],[59,13],0,[53,54],[[59,5],59],[[53,5],[[16,[54,60]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[59],[[53,5,5],[[16,[[15,[19]]]]]],[59,62],[53,62],[5,59],[62,15],0,[59,[[15,[59]]]],[63],[63],[63],[63],[[59,5],[[16,[59,59]]]],[59,64],[53,64],[53,59],[[]],[[]],[[]],[[]],[[]],[[]],[[],52],[[],52],[[],52],[[],52],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],0,[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],38],[[],38],[[],38],[[],38],[[],38],[[],38],[[],38],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[65,44],65],[[65,44],65],[[[66,[[0,[2,1]]]],[0,[2,1]],44],[[66,[[0,[2,1]]]]]],0,0,[[65,44],65],0,0,[[]],[[]],[[]],[[]],[59,65],[59,[[66,[[0,[2,1]]]]]],[[59,49],[[66,[[0,[2,1]]]]]],0,0,[[65,[0,[67,68,69]]],65],[[65,[0,[67,68,69]]],65],[[[66,[[0,[2,1]]]],[0,[67,68,69,1]]],[[66,[[0,[2,1]]]]]],[[[66,[[0,[2,1]]]],[0,[2,1]],[0,[67,68,69]]],[[66,[[0,[2,1]]]]]],[[65,[0,[67,68,69]]],65],[[]],[[]],[[]],[[]],0,0,[[65,49,[31,[[0,[1,2,20,68,69]]]]],65],[[65,44],65],[[65,44],65],[[[66,[[0,[2,1]]]],[0,[2,1]],44],[[66,[[0,[2,1]]]]]],[[65,44],65],0,0,[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],0,[[],38],[[],38],[[],38],[[],38],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,[43,33],[43,64],[46,64],0,0,[[[46,[2]],[46,[2]]]],[[[43,[[0,[1,2]]]],[46,[[0,[1,2]]]]]],[[[43,[[0,[1,2]]]],[43,[[0,[1,2]]]]],[[46,[[0,[1,2]]]]]],[43,43],[[[43,[14]],5,44,67],48],[[[43,[[0,[1,2]]]],44],[[46,[[0,[1,2]]]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[43,27],[[16,[17,70]]]],0,[[],[[15,[71]]]],[[],[[15,[72]]]],[[],[[15,[72]]]],[[],[[15,[71]]]],[[[43,[1]]],[[43,[1]]]],[[[73,[1,1]]],[[73,[1,1]]]],[[[74,[1,1]]],[[74,[1,1]]]],[[[46,[1]]],[[46,[1]]]],[[]],[[]],[[]],[[]],[[[73,[2,2]],73],12],[[[74,[2,2]],74],12],[[],43],[[],46],[73],[[],[[16,[46]]]],[[43,27],64],[[[43,[18]],43],19],[[[73,[18,18]],73],19],[[[74,[18,18]],74],19],[[70,70],19],[[[46,[18]],46],19],[[[43,[14]],5,44],64],[[[43,[14]],5,44],64],[43,64],[[[43,[20]],21],22],[[[73,[20,20]],21],22],[[[74,[20,20]],21],22],[[70,21],22],[[70,21],22],[[[46,[20]],21],22],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[43,64],[[[43,[14]],5,37],[[15,[8]]]],[[[43,[14]],5,28],15],[[43,37],[[15,[[75,[27]]]]]],[[43,37],[[15,[[73,[[75,[27]]]]]]]],[[43,28],[[15,[29]]]],[[[43,[[0,[1,2]]]]],[[46,[[0,[1,2]]]]]],[[[43,[[0,[1,2]]]],37,[0,[1,2]]],[[46,[[0,[1,2]]]]]],[[[43,[[0,[1,2]]]],37,17],[[46,[[0,[1,2]]]]]],[[[43,[[0,[1,2]]]],27],[[46,[[0,[1,2]]]]]],[[[43,[[0,[1,2]]]],28,29],[[46,[[0,[1,2]]]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[43,19],[[[46,[2]]],19],0,0,[[[43,[14]],5],64],[[[43,[[0,[1,2]]]]],[[43,[[0,[1,2]]]]]],[[[46,[2]]],[[46,[2]]]],[44,[[43,[[0,[1,2]]]]]],[76,15],[77,15],[[43,28],78],[[[73,[35,35]],73],[[15,[12]]]],[[[74,[35,35]],74],[[15,[12]]]],[63],[46,16],[[]],[[]],[[]],[[]],[[],52],[[[43,[14]],5,44,67],[[16,[48]]]],[[[43,[14]],5,44],64],[[[43,[14]],5,44],64],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[[43,[14]],5,37],[[16,[[15,[8]]]]]],[[[43,[14]],5,28],[[16,[15]]]],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[[43,[14]],5],64],0,0,[[43,37],[[15,[[4,[13,29]]]]]],[[43,37],34],0,[46,64],0,0,[[],38],[[],38],[[],38],[[],38],[[],38],[[],38],[[],38],[[[43,[[0,[1,2]]]],17],[[46,[[0,[1,2]]]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[43,[[0,[1,2]]]]],[[76,[[0,[1,2]]]]]],[[43,27],77],[[[43,[[0,[1,2]]]],37],[[77,[[0,[1,2]]]]]]],"p":[[8,"Clone"],[8,"Ord"],[3,"SpkTxOutIndex"],[3,"BTreeMap"],[3,"BlockId"],[3,"ConfirmationHeightAnchor"],[3,"ConfirmationTimeHeightAnchor"],[4,"ChainPosition"],[4,"ConfirmationTime"],[3,"FullTxOut"],[3,"SpkIterator"],[4,"Ordering"],[15,"u32"],[8,"Anchor"],[4,"Option"],[4,"Result"],[15,"u64"],[8,"PartialEq"],[15,"bool"],[8,"Debug"],[3,"Formatter"],[6,"Result"],[3,"Block"],[15,"usize"],[8,"Hash"],[3,"Script"],[3,"Transaction"],[3,"OutPoint"],[3,"TxOut"],[3,"ScriptBuf"],[8,"RangeBounds"],[15,"i64"],[3,"BTreeSet"],[8,"DoubleEndedIterator"],[8,"PartialOrd"],[8,"ExactSizeIterator"],[3,"Txid"],[3,"TypeId"],[8,"Append"],[3,"ChangeSet"],[8,"Indexer"],[3,"IndexedTxGraph"],[3,"TxGraph"],[8,"IntoIterator"],[8,"Default"],[3,"ChangeSet"],[3,"ChangeSet"],[3,"Balance"],[3,"KeychainTxOutIndex"],[4,"DescriptorPublicKey"],[4,"Descriptor"],[3,"String"],[3,"LocalChain"],[6,"ChangeSet"],[3,"MissingGenesisError"],[3,"Header"],[3,"CannotConnectError"],[4,"ApplyHeaderError"],[3,"CheckPoint"],[3,"AlterCheckPointError"],[3,"BlockHash"],[3,"CheckPointIter"],[3,"Demand"],[8,"Iterator"],[3,"SyncRequest"],[3,"FullScanRequest"],[8,"FnMut"],[8,"Send"],[8,"Sync"],[4,"CalculateFeeError"],[3,"SignedAmount"],[3,"Amount"],[3,"TxNode"],[3,"CanonicalTx"],[3,"Arc"],[3,"TxAncestors"],[3,"TxDescendants"],[3,"HashSet"],[8,"ChainOracle"],[8,"DescriptorExt"],[8,"AnchorFromBlockPosition"],[13,"Confirmed"],[13,"Unconfirmed"],[3,"SyncResult"],[3,"FullScanResult"]]},\ "bdk_coin_select":{"doc":"","t":[3,3,4,4,3,3,13,6,13,3,4,13,13,13,3,4,3,13,13,17,13,13,13,13,13,3,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,11,11,11,12,11,12,11,11,11,11,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,12,12,12,12,11,11,11,11,12,11,12,12,11,12,12,12,11,11,11,11,12,11,11,11,11,11,11,12,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,11],"n":["Bnb","BnbIter","BnbLimit","BranchStrategy","CoinSelector","CoinSelectorOpt","Continue","DecideStrategy","Duration","ExcessStrategy","ExcessStrategyKind","MinAbsoluteFee","MinDrainValue","Rounds","Selection","SelectionConstraint","SelectionError","SkipBoth","SkipInclusion","TXIN_BASE_WEIGHT","TargetFee","TargetValue","ToDrain","ToFee","ToRecipient","WeightedValue","advertise_new_score","all_selected","apply_selection","backtrack","base_weight","best_score","best_strategy","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","candidate","candidates","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","coin_select_bnb","current_excess","current_weight","deselect","drain_value","drain_waste","drain_weight","effective_target","effective_value","eq","eq","excess","excess_strategies","fee","feerate","finish","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","forward","from","from","from","from","from","from","from","from","from","from","from","from","from","from","fund_outputs","hash","input_count","into","into","into","into","into","into","into","into","into","into","into","into","into_iter","into_iter","is_empty","is_segwit","is_selected","long_term_feerate","long_term_feerate","max_extra_target","min_absolute_fee","min_drain_value","new","new","new","next","opts","partial_cmp","pool","pool_pos","provide","recipient_value","rem_abs","rem_eff","select","select_all","select_until_finished","selected","selected","selected_absolute_value","selected_count","selected_effective_value","selected_indexes","selected_waste","selected_weight","selection","spend_drain_weight","target_feerate","target_value","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unselected","unselected_indexes","value","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","waste","weight","weight","will_continue"],"q":["bdk_coin_select","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Bnb represents the current state of the BnB algorithm.","","Determines how we should limit rounds of branch and bound.","Strategy in which we should branch.","CoinSelector selects and deselects from a set of …","","We continue exploring subtrees of this node, starting with …","Closure to decide the branching strategy, alongside a …","","","","Min absolute fee is not met","Min drain value is not met","","","","","We skip both the inclusion and omission branches of this …","We continue exploring ONLY the omission branch of this …","Txin “base” fields include outpoint (32+4) and …","The target fee (given the feerate) is not met","The target is not met","","","","A WeightedValue represents an input candidate for …","Compare the advertised score with the current best. The …","","","Attempt to backtrack to the previously selected node’s …","The weight of the template transaction, including fixed …","","Returns the ExcessStrategy that results in the least waste.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","This is a variation of the Branch and Bound Coin Selection …","Current excess.","Current weight of template tx + selected inputs.","","","","Additional weight if we include the drain (change) output.","This is the effective target value.","Effective value of this input candidate: …","","","","","","Returns feerate in sats/wu.","","","","","","","","","","","","","Continue down this branch and skip the inclusion branch if …","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","The total number of inputs; so we can calculate extra …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Turns our Bnb state into an iterator.","","","Whether this WeightedValue contains at least one segwit …","","","The feerate","Additional leeway for the target value.","The minimum absolute fee. I.e., needed for RBF.","Minimum value allowed for a drain (change) output.","Creates a new Bnb.","Create a new WeightedValue that represents a single input.","","","","","","","","","","","","","","","","Absolute value sum of all selected inputs.","","Effective value sum of all selected inputs.","","Waste sum of all selected inputs.","Weight sum of all selected inputs.","","Weight of spending the drain (change) output in the future.","The feerate we should try and achieve in sats per weight …","The value we need to select. If the value is None, then …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Total value of the UTXO(s) that this WeightedValue …","","","","","","","","","","","","","","Total weight of including this/these UTXO(s). txin fields: …","",""],"i":[0,0,0,0,0,0,34,0,22,0,0,11,11,22,0,0,0,34,34,0,11,11,12,12,12,0,2,4,5,2,9,2,5,34,2,26,22,8,9,4,10,11,5,12,13,34,2,26,22,8,9,4,10,11,5,12,13,4,4,8,9,4,10,11,5,12,13,8,9,4,10,11,5,12,13,12,0,4,4,4,13,9,9,4,8,11,12,5,5,13,13,4,8,9,4,10,10,11,11,5,12,12,13,2,34,2,26,22,22,22,8,9,4,10,11,5,12,13,9,12,8,34,2,26,22,8,9,4,10,11,5,12,13,2,26,4,8,4,9,9,9,9,9,2,8,4,26,4,12,2,2,10,13,2,2,4,4,4,4,5,4,4,4,4,4,4,2,9,9,9,8,9,4,10,11,5,12,13,10,11,12,34,2,26,22,8,9,4,10,11,5,12,13,34,2,26,22,8,9,4,10,11,5,12,13,34,2,26,22,8,9,4,10,11,5,12,13,4,4,8,34,2,26,22,8,9,4,10,11,5,12,13,13,8,13,34],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[[2,[1]],1],3],[4,3],[5,6],[[[2,[1]]],3],0,0,[5],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[4,7],8],0,[8,8],[9,9],[4,4],[10,10],[11,11],[5,5],[12,12],[13,13],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[12,12],14],[4,[[15,[4]]]],[4,16],[4,17],[[4,7],3],0,[9,16],0,[4,16],[[8,18],16],[[11,11],3],[[12,12],3],0,0,0,[13,18],[4,[[19,[5,10]]]],[[8,20],21],[[9,20],21],[[4,20],21],[[10,20],21],[[10,20],21],[[11,20],21],[[11,20],21],[[5,20],21],[[12,20],21],[[12,20],21],[[13,20],21],[[[2,[1]],3]],[[]],[[]],[[]],[[]],[7,22],[23,22],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[24,17],9],[12],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[2,[1]],25],[[26,[1]]]],[[]],[4,3],0,[[4,7],3],[9,18],0,0,0,0,[[4,27,1],[[2,[1]]]],[[28,17,3],8],[[27,9],4],[[[26,[[0,[1,29,30]]]]],15],0,[[12,12],[[15,[14]]]],0,0,[31],0,0,0,[[4,7],3],[4],[4,[[19,[5,10]]]],[4,6],0,[4,28],[4,7],[4,16],[4,6],[4,16],[4,17],0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],32],[[],32],[[],32],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],33],[[],33],[[],33],[[],33],[[],33],[[],33],[[],33],[[],33],[[],33],[[],33],[[],33],[[],33],[4,6],[4,6],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,[34,3]],"p":[[8,"Ord"],[3,"Bnb"],[15,"bool"],[3,"CoinSelector"],[3,"Selection"],[8,"Iterator"],[15,"usize"],[3,"WeightedValue"],[3,"CoinSelectorOpt"],[3,"SelectionError"],[4,"SelectionConstraint"],[4,"ExcessStrategyKind"],[3,"ExcessStrategy"],[4,"Ordering"],[4,"Option"],[15,"i64"],[15,"u32"],[15,"f32"],[4,"Result"],[3,"Formatter"],[6,"Result"],[4,"BnbLimit"],[3,"Duration"],[3,"TxOut"],[6,"DecideStrategy"],[3,"BnbIter"],[3,"Vec"],[15,"u64"],[8,"Copy"],[8,"Display"],[3,"Demand"],[3,"String"],[3,"TypeId"],[4,"BranchStrategy"]]},\ "bdk_electrum":{"doc":"This crate is used for updating structures of bdk_chain …","t":[8,3,3,2,11,11,11,11,12,11,11,11,2,11,11,11,11,10,11,11,11,11,11,12,10,11,11,11,11,11,11,11,11,11],"n":["ElectrumExt","ElectrumUpdate","RelevantTxids","bdk_chain","borrow","borrow","borrow_mut","borrow_mut","chain_update","clone","clone_into","default","electrum_client","fmt","fmt","from","from","full_scan","into","into","into_confirmation_time_tx_graph","into_tx_graph","missing_full_txs","relevant_txids","sync","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip"],"q":["bdk_electrum","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Trait to extend Client functionality.","Combination of chain and transactions updates from electrum","Represents updates fetched from an Electrum server, but …","","","","","","Chain update","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Full scan the keychain scripts specified with the …","Calls U::from(self).","Calls U::from(self).","Finalizes the update by fetching missing txids from the …","Finalizes the TxGraph update by fetching missing txids …","Determine the full transactions that are missing from graph…","Transaction updates from electrum","Sync a set of scripts with the blockchain (via an Electrum …","","","","","","","","",""],"i":[0,0,0,0,1,4,1,4,4,1,1,1,0,1,4,1,4,20,1,4,1,1,1,4,20,1,1,4,1,4,1,4,1,4],"f":[0,0,0,0,[[]],[[]],[[]],[[]],0,[1,1],[[]],[[],1],0,[[1,2],3],[[4,2],3],[[]],[[]],[[5,[9,[[0,[6,7]],8]],10,10],[[12,[11]]]],[[]],[[]],[[1,13,[15,[14]]],[[12,[[17,[16]],11]]]],[[1,13,[15,[14]]],[[12,[[17,[18]],11]]]],[[1,17],[[15,[14]]]],0,[[5,8,8,8,10],[[12,[4,11]]]],[[]],[[],12],[[],12],[[],12],[[],12],[[],19],[[],19],[[]],[[]]],"p":[[3,"RelevantTxids"],[3,"Formatter"],[6,"Result"],[3,"ElectrumUpdate"],[3,"CheckPoint"],[8,"Ord"],[8,"Clone"],[8,"IntoIterator"],[3,"BTreeMap"],[15,"usize"],[4,"Error"],[4,"Result"],[3,"Client"],[3,"Txid"],[3,"Vec"],[3,"ConfirmationTimeHeightAnchor"],[3,"TxGraph"],[3,"ConfirmationHeightAnchor"],[3,"TypeId"],[8,"ElectrumExt"]]},\ -"bdk_esplora":{"doc":"BDK Esplora","t":[6,8,8,3,3,11,11,11,11,2,11,11,10,10,11,11,12,12,12,10,10,11,11,11,11,12,12,11,11,11,11],"n":["Error","EsploraAsyncExt","EsploraExt","FullScanUpdate","SyncUpdate","borrow","borrow","borrow_mut","borrow_mut","esplora_client","from","from","full_scan","full_scan","into","into","last_active_indices","local_chain","local_chain","sync","sync","try_from","try_from","try_into","try_into","tx_graph","tx_graph","type_id","type_id","vzip","vzip"],"q":["bdk_esplora","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["esplora_client::Error","Trait to extend the functionality of …","Trait to extend the functionality of …","Update returns from a full scan.","Update returned from a sync.","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Scan keychain scripts for transactions against Esplora, …","Scan keychain scripts for transactions against Esplora, …","Calls U::from(self).","Calls U::from(self).","Last active indices for the corresponding keychains (K).","The update to apply to the receiving LocalChain.","The update to apply to the receiving LocalChain.","Sync a set of scripts with the blockchain (via an Esplora …","Sync a set of scripts with the blockchain (via an Esplora …","","","","","The update to apply to the receiving TxGraph.","The update to apply to the receiving TxGraph.","","","",""],"i":[0,0,0,0,0,7,14,7,14,0,7,14,16,17,7,14,7,7,14,16,17,7,14,7,14,7,14,7,14,7,14],"f":[0,0,0,0,0,[[]],[[]],[[]],[[]],0,[[]],[[]],[[1,[5,[[0,[2,3]],4]],6,6],[[9,[[7,[[0,[2,3]]]],8]]]],[[1,[5,[[0,[4,10]]]],6,6],[[13,[[12,[11]]]]]],[[]],[[]],0,0,0,[[1,4,4,4,6],[[9,[14,8]]]],[[1,[0,[4,10]],[0,[4,10]],[0,[4,10]],6],[[13,[[12,[11]]]]]],[[],9],[[],9],[[],9],[[],9],0,0,[[],15],[[],15],[[]],[[]]],"p":[[3,"CheckPoint"],[8,"Ord"],[8,"Clone"],[8,"IntoIterator"],[3,"BTreeMap"],[15,"usize"],[3,"FullScanUpdate"],[6,"Error"],[4,"Result"],[8,"Send"],[8,"Future"],[3,"Box"],[3,"Pin"],[3,"SyncUpdate"],[3,"TypeId"],[8,"EsploraExt"],[8,"EsploraAsyncExt"]]},\ +"bdk_esplora":{"doc":"BDK Esplora","t":[6,8,8,2,10,10,10,10],"n":["Error","EsploraAsyncExt","EsploraExt","esplora_client","full_scan","full_scan","sync","sync"],"q":["bdk_esplora","","","","","","",""],"d":["esplora_client::Error","Trait to extend the functionality of …","Trait to extend the functionality of …","","Scan keychain scripts for transactions against Esplora, …","Scan keychain scripts for transactions against Esplora, …","Sync a set of scripts with the blockchain (via an Esplora …","Sync a set of scripts with the blockchain (via an Esplora …"],"i":[0,0,0,0,13,14,13,14],"f":[0,0,0,0,[[[3,[[0,[1,2]]]],4,4],[[7,[[5,[[0,[1,2]]]],6]]]],[[3,4,4],[[10,[[9,[8]]]]]],[[11,4],[[7,[12,6]]]],[[11,4],[[10,[[9,[8]]]]]]],"p":[[8,"Ord"],[8,"Clone"],[3,"FullScanRequest"],[15,"usize"],[3,"FullScanResult"],[6,"Error"],[4,"Result"],[8,"Future"],[3,"Box"],[3,"Pin"],[3,"SyncRequest"],[3,"SyncResult"],[8,"EsploraExt"],[8,"EsploraAsyncExt"]]},\ "bdk_file_store":{"doc":"BDK File Store","t":[3,13,3,4,13,13,13,4,3,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12],"n":["AggregateChangesetsError","Bincode","EntryIter","FileError","InvalidMagicBytes","Io","Io","IterError","Store","aggregate_changesets","append_changeset","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","changeset","create_new","drop","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","into","into","into","into","into","into_iter","iter_changesets","iter_error","load_from_persistence","new","next","open","open_or_create_new","provide","provide","provide","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","write_changes","expected","got"],"q":["bdk_file_store","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bdk_file_store::FileError",""],"d":["Error type for Store::aggregate_changesets.","Failure to decode data from the file.","Iterator over entries in a file store.","Error that occurs due to problems encountered with the …","Magic bytes do not match what is expected.","Failure to read from the file.","IO error, this may mean that the file is too short.","Error type for EntryIter.","Persists an append-only list of changesets (C) to a single …","Loads all the changesets that have been stored as one …","Append a new changeset to the file and truncate the file …","","","","","","","","","","","The partially-aggregated changeset.","Create a new Store file in write-only mode; error if the …","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","Iterates over the stored changeset from first to last, …","The error returned by EntryIter.","","","","Open an existing Store.","Attempt to open existing Store file; create it if the file …","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,8,0,0,6,8,6,0,0,1,1,7,8,1,3,6,7,8,1,3,6,3,1,7,8,8,1,3,3,6,6,7,8,8,1,3,6,6,7,8,1,3,6,7,1,3,1,7,7,1,1,8,3,6,8,3,6,7,8,1,3,6,7,8,1,3,6,7,8,1,3,6,7,8,1,3,6,1,18,18],"f":[0,0,0,0,0,0,0,0,0,[1,[[4,[2,3]]]],[1,[[4,[5]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[[],[[4,[1,6]]]],[7],[[8,9],10],[[8,9],10],[[1,9],10],[[[3,[11]],9],10],[[3,9],10],[[6,9],10],[[6,9],10],[[]],[[]],[5,8],[[]],[[]],[[]],[5,6],[[]],[[]],[[]],[[]],[[]],[[]],[1,7],0,[1,[[12,[2]]]],[[13,14],7],[7,2],[[],[[4,[1,6]]]],[[],[[4,[1,6]]]],[15],[15],[15],[[],16],[[],16],[[],16],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],17],[[],17],[[],17],[[],17],[[],17],[[]],[[]],[[]],[[]],[[]],[1,12],0,0],"p":[[3,"Store"],[4,"Option"],[3,"AggregateChangesetsError"],[4,"Result"],[3,"Error"],[4,"FileError"],[3,"EntryIter"],[4,"IterError"],[3,"Formatter"],[6,"Result"],[8,"Debug"],[6,"Result"],[15,"u64"],[3,"File"],[3,"Demand"],[3,"String"],[3,"TypeId"],[13,"InvalidMagicBytes"]]},\ "bdk_hwi":{"doc":"HWI Signer","t":[3,11,11,11,11,11,11,11,11,11,11,11,11],"n":["HWISigner","borrow","borrow_mut","fmt","from","from_device","id","into","sign_transaction","try_from","try_into","type_id","vzip"],"q":["bdk_hwi","","","","","","","","","","","",""],"d":["Custom signer for Hardware Wallets","","","","Returns the argument unchanged.","Create a instance from the specified device and chain","","Calls U::from(self).","","","","",""],"i":[0,1,1,1,1,1,1,1,1,1,1,1,1],"f":[0,[[]],[[]],[[1,2],3],[[]],[[4,5],[[7,[1,6]]]],[[1,8],9],[[]],[[1,10,11,8],[[7,[12]]]],[[],7],[[],7],[[],13],[[]]],"p":[[3,"HWISigner"],[3,"Formatter"],[6,"Result"],[3,"HWIDevice"],[3,"HWIChain"],[4,"Error"],[4,"Result"],[3,"Secp256k1"],[4,"SignerId"],[3,"Psbt"],[3,"SignOptions"],[4,"SignerError"],[3,"TypeId"]]},\ "bdk_persist":{"doc":"BDK Persist","t":[3,8,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10],"n":["Persist","PersistBackend","borrow","borrow_mut","commit","fmt","from","into","load_from_persistence","new","stage","stage_and_commit","staged","try_from","try_into","type_id","vzip","write_changes"],"q":["bdk_persist","","","","","","","","","","","","","","","","",""],"d":["Persist wraps a PersistBackend to create a convenient …","A persistence backend for Persist.","","","Commit the staged changes to the underlying persistence …","","Returns the argument unchanged.","Calls U::from(self).","Return the aggregate changeset C from persistence.","Create a new Persist from PersistBackend.","Stage a changeset to be committed later with commit.","Stages a new changeset and commits it (along with any …","Get the changes that have not been committed yet.","","","","","Writes a changeset to the persistence backend."],"i":[0,0,1,1,1,1,1,1,8,1,1,1,1,1,1,1,1,8],"f":[0,0,[[]],[[]],[1,[[3,[2]]]],[[[1,[4]],5],[[7,[6]]]],[[]],[[]],[[],[[3,[2]]]],[[[0,[8,9,10]]],1],[1],[1,[[3,[2]]]],[1],[[],7],[[],7],[[],11],[[]],[[],3]],"p":[[3,"Persist"],[4,"Option"],[6,"Result"],[8,"Debug"],[3,"Formatter"],[3,"Error"],[4,"Result"],[8,"PersistBackend"],[8,"Send"],[8,"Sync"],[3,"TypeId"]]},\ diff --git a/docs-rs/bdk/nightly/latest/source-files.js b/docs-rs/bdk/nightly/latest/source-files.js index d72e5a2d5d..b7e6fb64d7 100644 --- a/docs-rs/bdk/nightly/latest/source-files.js +++ b/docs-rs/bdk/nightly/latest/source-files.js @@ -1,7 +1,7 @@ var sourcesIndex = JSON.parse('{\ "bdk":["",[["descriptor",[],["checksum.rs","dsl.rs","error.rs","mod.rs","policy.rs","template.rs"]],["keys",[],["mod.rs"]],["psbt",[],["mod.rs"]],["wallet",[],["coin_selection.rs","error.rs","export.rs","mod.rs","signer.rs","tx_builder.rs","utils.rs"]]],["lib.rs","types.rs"]],\ "bdk_bitcoind_rpc":["",[],["lib.rs"]],\ -"bdk_chain":["",[["keychain",[],["txout_index.rs"]]],["chain_data.rs","chain_oracle.rs","descriptor_ext.rs","example_utils.rs","indexed_tx_graph.rs","keychain.rs","lib.rs","local_chain.rs","spk_iter.rs","spk_txout_index.rs","tx_data_traits.rs","tx_graph.rs"]],\ +"bdk_chain":["",[["keychain",[],["txout_index.rs"]]],["chain_data.rs","chain_oracle.rs","descriptor_ext.rs","example_utils.rs","indexed_tx_graph.rs","keychain.rs","lib.rs","local_chain.rs","spk_client.rs","spk_iter.rs","spk_txout_index.rs","tx_data_traits.rs","tx_graph.rs"]],\ "bdk_coin_select":["",[],["bnb.rs","coin_selector.rs","lib.rs"]],\ "bdk_electrum":["",[],["electrum_ext.rs","lib.rs"]],\ "bdk_esplora":["",[],["async_ext.rs","blocking_ext.rs","lib.rs"]],\ diff --git a/docs-rs/bdk/nightly/latest/src/bdk/wallet/mod.rs.html b/docs-rs/bdk/nightly/latest/src/bdk/wallet/mod.rs.html index e5310d8766..8a9f0099c4 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk/wallet/mod.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk/wallet/mod.rs.html @@ -2512,6 +2512,53 @@ 2511 2512 2513 +2514 +2515 +2516 +2517 +2518 +2519 +2520 +2521 +2522 +2523 +2524 +2525 +2526 +2527 +2528 +2529 +2530 +2531 +2532 +2533 +2534 +2535 +2536 +2537 +2538 +2539 +2540 +2541 +2542 +2543 +2544 +2545 +2546 +2547 +2548 +2549 +2550 +2551 +2552 +2553 +2554 +2555 +2556 +2557 +2558 +2559 +2560
    // Bitcoin Dev Kit
     // Written in 2020 by Alekos Filini <alekos.filini@gmail.com>
     //
    @@ -2540,6 +2587,7 @@
         local_chain::{
             self, ApplyHeaderError, CannotConnectError, CheckPoint, CheckPointIter, LocalChain,
         },
    +    spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResult},
         tx_graph::{CanonicalTx, TxGraph},
         Append, BlockId, ChainPosition, ConfirmationTime, ConfirmationTimeHeightAnchor, FullTxOut,
         IndexedTxGraph,
    @@ -2625,6 +2673,26 @@
         pub chain: Option<CheckPoint>,
     }
     
    +impl From<FullScanResult<KeychainKind>> for Update {
    +    fn from(value: FullScanResult<KeychainKind>) -> Self {
    +        Self {
    +            last_active_indices: value.last_active_indices,
    +            graph: value.graph_update,
    +            chain: Some(value.chain_update),
    +        }
    +    }
    +}
    +
    +impl From<SyncResult> for Update {
    +    fn from(value: SyncResult) -> Self {
    +        Self {
    +            last_active_indices: BTreeMap::new(),
    +            graph: value.graph_update,
    +            chain: Some(value.chain_update),
    +        }
    +    }
    +}
    +
     /// The changes made to a wallet by applying an [`Update`].
     #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
     pub struct ChangeSet {
    @@ -4777,7 +4845,8 @@
         /// transactions related to your wallet into it.
         ///
         /// [`commit`]: Self::commit
    -    pub fn apply_update(&mut self, update: Update) -> Result<(), CannotConnectError> {
    +    pub fn apply_update(&mut self, update: impl Into<Update>) -> Result<(), CannotConnectError> {
    +        let update = update.into();
             let mut changeset = match update.chain {
                 Some(chain_update) => ChangeSet::from(self.chain.apply_update(chain_update)?),
                 None => ChangeSet::default(),
    @@ -4902,6 +4971,31 @@
         }
     }
     
    +/// Methods to construct sync/full-scan requests for spk-based chain sources.
    +impl Wallet {
    +    /// Create a partial [`SyncRequest`] for this wallet for all revealed spks.
    +    ///
    +    /// This is the first step when performing a spk-based wallet partial sync, the returned
    +    /// [`SyncRequest`] collects all revealed script pubkeys from the wallet keychain needed to
    +    /// start a blockchain sync with a spk based blockchain client.
    +    pub fn start_sync_with_revealed_spks(&self) -> SyncRequest {
    +        SyncRequest::from_chain_tip(self.chain.tip())
    +            .populate_with_revealed_spks(&self.indexed_graph.index, ..)
    +    }
    +
    +    /// Create a [`FullScanRequest] for this wallet.
    +    ///
    +    /// This is the first step when performing a spk-based wallet full scan, the returned
    +    /// [`FullScanRequest] collects iterators for the wallet's keychain script pub keys needed to
    +    /// start a blockchain full scan with a spk based blockchain client.
    +    ///
    +    /// This operation is generally only used when importing or restoring a previously used wallet
    +    /// in which the list of used scripts is not known.
    +    pub fn start_full_scan(&self) -> FullScanRequest<KeychainKind> {
    +        FullScanRequest::from_keychain_txout_index(self.chain.tip(), &self.indexed_graph.index)
    +    }
    +}
    +
     impl AsRef<bdk_chain::tx_graph::TxGraph<ConfirmationTimeHeightAnchor>> for Wallet {
         fn as_ref(&self) -> &bdk_chain::tx_graph::TxGraph<ConfirmationTimeHeightAnchor> {
             self.indexed_graph.graph()
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_chain/lib.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_chain/lib.rs.html
    index ab3ffd0eec..3379f8e794 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_chain/lib.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_chain/lib.rs.html
    @@ -97,6 +97,7 @@
     97
     98
     99
    +100
     
    //! This crate is a collection of core structures for [Bitcoin Dev Kit].
     //!
     //! The goal of this crate is to give wallets the mechanisms needed to:
    @@ -148,6 +149,7 @@
     mod spk_iter;
     #[cfg(feature = "miniscript")]
     pub use spk_iter::*;
    +pub mod spk_client;
     
     #[allow(unused_imports)]
     #[macro_use]
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_client.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_client.rs.html
    new file mode 100644
    index 0000000000..4911d6c94a
    --- /dev/null
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_client.rs.html
    @@ -0,0 +1,770 @@
    +spk_client.rs - source
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +111
    +112
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +215
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +224
    +225
    +226
    +227
    +228
    +229
    +230
    +231
    +232
    +233
    +234
    +235
    +236
    +237
    +238
    +239
    +240
    +241
    +242
    +243
    +244
    +245
    +246
    +247
    +248
    +249
    +250
    +251
    +252
    +253
    +254
    +255
    +256
    +257
    +258
    +259
    +260
    +261
    +262
    +263
    +264
    +265
    +266
    +267
    +268
    +269
    +270
    +271
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +289
    +290
    +291
    +292
    +293
    +294
    +295
    +296
    +297
    +298
    +299
    +300
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +308
    +309
    +310
    +311
    +312
    +313
    +314
    +315
    +316
    +317
    +318
    +319
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +329
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +350
    +351
    +352
    +353
    +354
    +355
    +356
    +357
    +358
    +359
    +360
    +361
    +362
    +363
    +364
    +365
    +366
    +367
    +368
    +369
    +370
    +371
    +372
    +373
    +374
    +375
    +376
    +377
    +378
    +379
    +380
    +381
    +382
    +383
    +384
    +
    //! Helper types for spk-based blockchain clients.
    +
    +use core::{fmt::Debug, marker::PhantomData, ops::RangeBounds};
    +
    +use alloc::{boxed::Box, collections::BTreeMap, vec::Vec};
    +use bitcoin::{OutPoint, Script, ScriptBuf, Txid};
    +
    +use crate::{local_chain::CheckPoint, ConfirmationTimeHeightAnchor, TxGraph};
    +
    +/// Data required to perform a spk-based blockchain client sync.
    +///
    +/// A client sync fetches relevant chain data for a known list of scripts, transaction ids and
    +/// outpoints. The sync process also updates the chain from the given [`CheckPoint`].
    +pub struct SyncRequest {
    +    /// A checkpoint for the current chain [`LocalChain::tip`].
    +    /// The sync process will return a new chain update that extends this tip.
    +    ///
    +    /// [`LocalChain::tip`]: crate::local_chain::LocalChain::tip
    +    pub chain_tip: CheckPoint,
    +    /// Transactions that spend from or to these indexed script pubkeys.
    +    pub spks: Box<dyn ExactSizeIterator<Item = ScriptBuf> + Send>,
    +    /// Transactions with these txids.
    +    pub txids: Box<dyn ExactSizeIterator<Item = Txid> + Send>,
    +    /// Transactions with these outpoints or spent from these outpoints.
    +    pub outpoints: Box<dyn ExactSizeIterator<Item = OutPoint> + Send>,
    +}
    +
    +impl SyncRequest {
    +    /// Construct a new [`SyncRequest`] from a given `cp` tip.
    +    pub fn from_chain_tip(cp: CheckPoint) -> Self {
    +        Self {
    +            chain_tip: cp,
    +            spks: Box::new(core::iter::empty()),
    +            txids: Box::new(core::iter::empty()),
    +            outpoints: Box::new(core::iter::empty()),
    +        }
    +    }
    +
    +    /// Set the [`Script`]s that will be synced against.
    +    ///
    +    /// This consumes the [`SyncRequest`] and returns the updated one.
    +    #[must_use]
    +    pub fn set_spks(
    +        mut self,
    +        spks: impl IntoIterator<IntoIter = impl ExactSizeIterator<Item = ScriptBuf> + Send + 'static>,
    +    ) -> Self {
    +        self.spks = Box::new(spks.into_iter());
    +        self
    +    }
    +
    +    /// Set the [`Txid`]s that will be synced against.
    +    ///
    +    /// This consumes the [`SyncRequest`] and returns the updated one.
    +    #[must_use]
    +    pub fn set_txids(
    +        mut self,
    +        txids: impl IntoIterator<IntoIter = impl ExactSizeIterator<Item = Txid> + Send + 'static>,
    +    ) -> Self {
    +        self.txids = Box::new(txids.into_iter());
    +        self
    +    }
    +
    +    /// Set the [`OutPoint`]s that will be synced against.
    +    ///
    +    /// This consumes the [`SyncRequest`] and returns the updated one.
    +    #[must_use]
    +    pub fn set_outpoints(
    +        mut self,
    +        outpoints: impl IntoIterator<
    +            IntoIter = impl ExactSizeIterator<Item = OutPoint> + Send + 'static,
    +        >,
    +    ) -> Self {
    +        self.outpoints = Box::new(outpoints.into_iter());
    +        self
    +    }
    +
    +    /// Chain on additional [`Script`]s that will be synced against.
    +    ///
    +    /// This consumes the [`SyncRequest`] and returns the updated one.
    +    #[must_use]
    +    pub fn chain_spks(
    +        mut self,
    +        spks: impl IntoIterator<
    +            IntoIter = impl ExactSizeIterator<Item = ScriptBuf> + Send + 'static,
    +            Item = ScriptBuf,
    +        >,
    +    ) -> Self {
    +        self.spks = Box::new(ExactSizeChain::new(self.spks, spks.into_iter()));
    +        self
    +    }
    +
    +    /// Chain on additional [`Txid`]s that will be synced against.
    +    ///
    +    /// This consumes the [`SyncRequest`] and returns the updated one.
    +    #[must_use]
    +    pub fn chain_txids(
    +        mut self,
    +        txids: impl IntoIterator<
    +            IntoIter = impl ExactSizeIterator<Item = Txid> + Send + 'static,
    +            Item = Txid,
    +        >,
    +    ) -> Self {
    +        self.txids = Box::new(ExactSizeChain::new(self.txids, txids.into_iter()));
    +        self
    +    }
    +
    +    /// Chain on additional [`OutPoint`]s that will be synced against.
    +    ///
    +    /// This consumes the [`SyncRequest`] and returns the updated one.
    +    #[must_use]
    +    pub fn chain_outpoints(
    +        mut self,
    +        outpoints: impl IntoIterator<
    +            IntoIter = impl ExactSizeIterator<Item = OutPoint> + Send + 'static,
    +            Item = OutPoint,
    +        >,
    +    ) -> Self {
    +        self.outpoints = Box::new(ExactSizeChain::new(self.outpoints, outpoints.into_iter()));
    +        self
    +    }
    +
    +    /// Add a closure that will be called for [`Script`]s previously added to this request.
    +    ///
    +    /// This consumes the [`SyncRequest`] and returns the updated one.
    +    #[must_use]
    +    pub fn inspect_spks(
    +        mut self,
    +        mut inspect: impl FnMut(&Script) + Send + Sync + 'static,
    +    ) -> Self {
    +        self.spks = Box::new(self.spks.inspect(move |spk| inspect(spk)));
    +        self
    +    }
    +
    +    /// Add a closure that will be called for [`Txid`]s previously added to this request.
    +    ///
    +    /// This consumes the [`SyncRequest`] and returns the updated one.
    +    #[must_use]
    +    pub fn inspect_txids(mut self, mut inspect: impl FnMut(&Txid) + Send + Sync + 'static) -> Self {
    +        self.txids = Box::new(self.txids.inspect(move |txid| inspect(txid)));
    +        self
    +    }
    +
    +    /// Add a closure that will be called for [`OutPoint`]s previously added to this request.
    +    ///
    +    /// This consumes the [`SyncRequest`] and returns the updated one.
    +    #[must_use]
    +    pub fn inspect_outpoints(
    +        mut self,
    +        mut inspect: impl FnMut(&OutPoint) + Send + Sync + 'static,
    +    ) -> Self {
    +        self.outpoints = Box::new(self.outpoints.inspect(move |op| inspect(op)));
    +        self
    +    }
    +
    +    /// Populate the request with revealed script pubkeys from `index` with the given `spk_range`.
    +    ///
    +    /// This consumes the [`SyncRequest`] and returns the updated one.
    +    #[cfg(feature = "miniscript")]
    +    #[must_use]
    +    pub fn populate_with_revealed_spks<K: Clone + Ord + Debug + Send + Sync>(
    +        self,
    +        index: &crate::keychain::KeychainTxOutIndex<K>,
    +        spk_range: impl RangeBounds<K>,
    +    ) -> Self {
    +        use alloc::borrow::ToOwned;
    +        self.chain_spks(
    +            index
    +                .revealed_spks(spk_range)
    +                .map(|(_, _, spk)| spk.to_owned())
    +                .collect::<Vec<_>>(),
    +        )
    +    }
    +}
    +
    +/// Data returned from a spk-based blockchain client sync.
    +///
    +/// See also [`SyncRequest`].
    +pub struct SyncResult<A = ConfirmationTimeHeightAnchor> {
    +    /// The update to apply to the receiving [`TxGraph`].
    +    pub graph_update: TxGraph<A>,
    +    /// The update to apply to the receiving [`LocalChain`](crate::local_chain::LocalChain).
    +    pub chain_update: CheckPoint,
    +}
    +
    +/// Data required to perform a spk-based blockchain client full scan.
    +///
    +/// A client full scan iterates through all the scripts for the given keychains, fetching relevant
    +/// data until some stop gap number of scripts is found that have no data. This operation is
    +/// generally only used when importing or restoring previously used keychains in which the list of
    +/// used scripts is not known. The full scan process also updates the chain from the given [`CheckPoint`].
    +pub struct FullScanRequest<K> {
    +    /// A checkpoint for the current [`LocalChain::tip`].
    +    /// The full scan process will return a new chain update that extends this tip.
    +    ///
    +    /// [`LocalChain::tip`]: crate::local_chain::LocalChain::tip
    +    pub chain_tip: CheckPoint,
    +    /// Iterators of script pubkeys indexed by the keychain index.
    +    pub spks_by_keychain: BTreeMap<K, Box<dyn Iterator<Item = (u32, ScriptBuf)> + Send>>,
    +}
    +
    +impl<K: Ord + Clone> FullScanRequest<K> {
    +    /// Construct a new [`FullScanRequest`] from a given `chain_tip`.
    +    #[must_use]
    +    pub fn from_chain_tip(chain_tip: CheckPoint) -> Self {
    +        Self {
    +            chain_tip,
    +            spks_by_keychain: BTreeMap::new(),
    +        }
    +    }
    +
    +    /// Construct a new [`FullScanRequest`] from a given `chain_tip` and `index`.
    +    ///
    +    /// Unbounded script pubkey iterators for each keychain (`K`) are extracted using
    +    /// [`KeychainTxOutIndex::all_unbounded_spk_iters`] and is used to populate the
    +    /// [`FullScanRequest`].
    +    ///
    +    /// [`KeychainTxOutIndex::all_unbounded_spk_iters`]: crate::keychain::KeychainTxOutIndex::all_unbounded_spk_iters
    +    #[cfg(feature = "miniscript")]
    +    #[must_use]
    +    pub fn from_keychain_txout_index(
    +        chain_tip: CheckPoint,
    +        index: &crate::keychain::KeychainTxOutIndex<K>,
    +    ) -> Self
    +    where
    +        K: Debug,
    +    {
    +        let mut req = Self::from_chain_tip(chain_tip);
    +        for (keychain, spks) in index.all_unbounded_spk_iters() {
    +            req = req.set_spks_for_keychain(keychain, spks);
    +        }
    +        req
    +    }
    +
    +    /// Set the [`Script`]s for a given `keychain`.
    +    ///
    +    /// This consumes the [`FullScanRequest`] and returns the updated one.
    +    #[must_use]
    +    pub fn set_spks_for_keychain(
    +        mut self,
    +        keychain: K,
    +        spks: impl IntoIterator<IntoIter = impl Iterator<Item = (u32, ScriptBuf)> + Send + 'static>,
    +    ) -> Self {
    +        self.spks_by_keychain
    +            .insert(keychain, Box::new(spks.into_iter()));
    +        self
    +    }
    +
    +    /// Chain on additional [`Script`]s that will be synced against.
    +    ///
    +    /// This consumes the [`FullScanRequest`] and returns the updated one.
    +    #[must_use]
    +    pub fn chain_spks_for_keychain(
    +        mut self,
    +        keychain: K,
    +        spks: impl IntoIterator<IntoIter = impl Iterator<Item = (u32, ScriptBuf)> + Send + 'static>,
    +    ) -> Self {
    +        match self.spks_by_keychain.remove(&keychain) {
    +            Some(keychain_spks) => self
    +                .spks_by_keychain
    +                .insert(keychain, Box::new(keychain_spks.chain(spks.into_iter()))),
    +            None => self
    +                .spks_by_keychain
    +                .insert(keychain, Box::new(spks.into_iter())),
    +        };
    +        self
    +    }
    +
    +    /// Add a closure that will be called for every [`Script`] previously added to any keychain in
    +    /// this request.
    +    ///
    +    /// This consumes the [`SyncRequest`] and returns the updated one.
    +    #[must_use]
    +    pub fn inspect_spks_for_all_keychains(
    +        mut self,
    +        inspect: impl FnMut(K, u32, &Script) + Send + Sync + Clone + 'static,
    +    ) -> Self
    +    where
    +        K: Send + 'static,
    +    {
    +        for (keychain, spks) in core::mem::take(&mut self.spks_by_keychain) {
    +            let mut inspect = inspect.clone();
    +            self.spks_by_keychain.insert(
    +                keychain.clone(),
    +                Box::new(spks.inspect(move |(i, spk)| inspect(keychain.clone(), *i, spk))),
    +            );
    +        }
    +        self
    +    }
    +
    +    /// Add a closure that will be called for every [`Script`] previously added to a given
    +    /// `keychain` in this request.
    +    ///
    +    /// This consumes the [`SyncRequest`] and returns the updated one.
    +    #[must_use]
    +    pub fn inspect_spks_for_keychain(
    +        mut self,
    +        keychain: K,
    +        mut inspect: impl FnMut(u32, &Script) + Send + Sync + 'static,
    +    ) -> Self
    +    where
    +        K: Send + 'static,
    +    {
    +        if let Some(spks) = self.spks_by_keychain.remove(&keychain) {
    +            self.spks_by_keychain.insert(
    +                keychain,
    +                Box::new(spks.inspect(move |(i, spk)| inspect(*i, spk))),
    +            );
    +        }
    +        self
    +    }
    +}
    +
    +/// Data returned from a spk-based blockchain client full scan.
    +///
    +/// See also [`FullScanRequest`].
    +pub struct FullScanResult<K> {
    +    /// The update to apply to the receiving [`LocalChain`](crate::local_chain::LocalChain).
    +    pub graph_update: TxGraph<ConfirmationTimeHeightAnchor>,
    +    /// The update to apply to the receiving [`TxGraph`].
    +    pub chain_update: CheckPoint,
    +    /// Last active indices for the corresponding keychains (`K`).
    +    pub last_active_indices: BTreeMap<K, u32>,
    +}
    +
    +/// A version of [`core::iter::Chain`] which can combine two [`ExactSizeIterator`]s to form a new
    +/// [`ExactSizeIterator`].
    +///
    +/// The danger of this is explained in [the `ExactSizeIterator` docs]
    +/// (https://doc.rust-lang.org/core/iter/trait.ExactSizeIterator.html#when-shouldnt-an-adapter-be-exactsizeiterator).
    +/// This does not apply here since it would be impossible to scan an item count that overflows
    +/// `usize` anyway.
    +struct ExactSizeChain<A, B, I> {
    +    a: Option<A>,
    +    b: Option<B>,
    +    i: PhantomData<I>,
    +}
    +
    +impl<A, B, I> ExactSizeChain<A, B, I> {
    +    fn new(a: A, b: B) -> Self {
    +        ExactSizeChain {
    +            a: Some(a),
    +            b: Some(b),
    +            i: PhantomData,
    +        }
    +    }
    +}
    +
    +impl<A, B, I> Iterator for ExactSizeChain<A, B, I>
    +where
    +    A: Iterator<Item = I>,
    +    B: Iterator<Item = I>,
    +{
    +    type Item = I;
    +
    +    fn next(&mut self) -> Option<Self::Item> {
    +        if let Some(a) = &mut self.a {
    +            let item = a.next();
    +            if item.is_some() {
    +                return item;
    +            }
    +            self.a = None;
    +        }
    +        if let Some(b) = &mut self.b {
    +            let item = b.next();
    +            if item.is_some() {
    +                return item;
    +            }
    +            self.b = None;
    +        }
    +        None
    +    }
    +}
    +
    +impl<A, B, I> ExactSizeIterator for ExactSizeChain<A, B, I>
    +where
    +    A: ExactSizeIterator<Item = I>,
    +    B: ExactSizeIterator<Item = I>,
    +{
    +    fn len(&self) -> usize {
    +        let a_len = self.a.as_ref().map(|a| a.len()).unwrap_or(0);
    +        let b_len = self.b.as_ref().map(|a| a.len()).unwrap_or(0);
    +        a_len + b_len
    +    }
    +}
    +
    +
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/src/bdk_esplora/async_ext.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_esplora/async_ext.rs.html index 0eda290cd0..f02d90bf21 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk_esplora/async_ext.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk_esplora/async_ext.rs.html @@ -587,9 +587,18 @@ 587 588 589 +590 +591 +592 +593 +594 +595 +596 +597
    use std::collections::BTreeSet;
     
     use async_trait::async_trait;
    +use bdk_chain::spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResult};
     use bdk_chain::Anchor;
     use bdk_chain::{
         bitcoin::{BlockHash, OutPoint, ScriptBuf, TxOut, Txid},
    @@ -600,7 +609,7 @@
     use esplora_client::{Amount, TxStatus};
     use futures::{stream::FuturesOrdered, TryStreamExt};
     
    -use crate::{anchor_from_status, FullScanUpdate, SyncUpdate};
    +use crate::anchor_from_status;
     
     /// [`esplora_client::Error`]
     type Error = Box<esplora_client::Error>;
    @@ -639,14 +648,10 @@
         /// [`LocalChain::tip`]: bdk_chain::local_chain::LocalChain::tip
         async fn full_scan<K: Ord + Clone + Send>(
             &self,
    -        local_tip: CheckPoint,
    -        keychain_spks: BTreeMap<
    -            K,
    -            impl IntoIterator<IntoIter = impl Iterator<Item = (u32, ScriptBuf)> + Send> + Send,
    -        >,
    +        request: FullScanRequest<K>,
             stop_gap: usize,
             parallel_requests: usize,
    -    ) -> Result<FullScanUpdate<K>, Error>;
    +    ) -> Result<FullScanResult<K>, Error>;
     
         /// Sync a set of scripts with the blockchain (via an Esplora client) for the data
         /// specified and return a [`TxGraph`].
    @@ -664,12 +669,9 @@
         /// [`full_scan`]: EsploraAsyncExt::full_scan
         async fn sync(
             &self,
    -        local_tip: CheckPoint,
    -        misc_spks: impl IntoIterator<IntoIter = impl Iterator<Item = ScriptBuf> + Send> + Send,
    -        txids: impl IntoIterator<IntoIter = impl Iterator<Item = Txid> + Send> + Send,
    -        outpoints: impl IntoIterator<IntoIter = impl Iterator<Item = OutPoint> + Send> + Send,
    +        request: SyncRequest,
             parallel_requests: usize,
    -    ) -> Result<SyncUpdate, Error>;
    +    ) -> Result<SyncResult, Error>;
     }
     
     #[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
    @@ -677,42 +679,56 @@
     impl EsploraAsyncExt for esplora_client::AsyncClient {
         async fn full_scan<K: Ord + Clone + Send>(
             &self,
    -        local_tip: CheckPoint,
    -        keychain_spks: BTreeMap<
    -            K,
    -            impl IntoIterator<IntoIter = impl Iterator<Item = (u32, ScriptBuf)> + Send> + Send,
    -        >,
    +        request: FullScanRequest<K>,
             stop_gap: usize,
             parallel_requests: usize,
    -    ) -> Result<FullScanUpdate<K>, Error> {
    +    ) -> Result<FullScanResult<K>, Error> {
             let latest_blocks = fetch_latest_blocks(self).await?;
    -        let (tx_graph, last_active_indices) =
    -            full_scan_for_index_and_graph(self, keychain_spks, stop_gap, parallel_requests).await?;
    -        let local_chain =
    -            chain_update(self, &latest_blocks, &local_tip, tx_graph.all_anchors()).await?;
    -        Ok(FullScanUpdate {
    -            local_chain,
    -            tx_graph,
    +        let (graph_update, last_active_indices) = full_scan_for_index_and_graph(
    +            self,
    +            request.spks_by_keychain,
    +            stop_gap,
    +            parallel_requests,
    +        )
    +        .await?;
    +        let chain_update = chain_update(
    +            self,
    +            &latest_blocks,
    +            &request.chain_tip,
    +            graph_update.all_anchors(),
    +        )
    +        .await?;
    +        Ok(FullScanResult {
    +            chain_update,
    +            graph_update,
                 last_active_indices,
             })
         }
     
         async fn sync(
             &self,
    -        local_tip: CheckPoint,
    -        misc_spks: impl IntoIterator<IntoIter = impl Iterator<Item = ScriptBuf> + Send> + Send,
    -        txids: impl IntoIterator<IntoIter = impl Iterator<Item = Txid> + Send> + Send,
    -        outpoints: impl IntoIterator<IntoIter = impl Iterator<Item = OutPoint> + Send> + Send,
    +        request: SyncRequest,
             parallel_requests: usize,
    -    ) -> Result<SyncUpdate, Error> {
    +    ) -> Result<SyncResult, Error> {
             let latest_blocks = fetch_latest_blocks(self).await?;
    -        let tx_graph =
    -            sync_for_index_and_graph(self, misc_spks, txids, outpoints, parallel_requests).await?;
    -        let local_chain =
    -            chain_update(self, &latest_blocks, &local_tip, tx_graph.all_anchors()).await?;
    -        Ok(SyncUpdate {
    -            tx_graph,
    -            local_chain,
    +        let graph_update = sync_for_index_and_graph(
    +            self,
    +            request.spks,
    +            request.txids,
    +            request.outpoints,
    +            parallel_requests,
    +        )
    +        .await?;
    +        let chain_update = chain_update(
    +            self,
    +            &latest_blocks,
    +            &request.chain_tip,
    +            graph_update.all_anchors(),
    +        )
    +        .await?;
    +        Ok(SyncResult {
    +            chain_update,
    +            graph_update,
             })
         }
     }
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_esplora/blocking_ext.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_esplora/blocking_ext.rs.html
    index d6f351d50b..0e705329f5 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_esplora/blocking_ext.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_esplora/blocking_ext.rs.html
    @@ -791,18 +791,12 @@
     791
     792
     793
    -794
    -795
    -796
    -797
    -798
    -799
    -800
     
    use std::collections::BTreeSet;
     use std::thread::JoinHandle;
     use std::usize;
     
     use bdk_chain::collections::BTreeMap;
    +use bdk_chain::spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResult};
     use bdk_chain::Anchor;
     use bdk_chain::{
         bitcoin::{Amount, BlockHash, OutPoint, ScriptBuf, TxOut, Txid},
    @@ -812,8 +806,6 @@
     use esplora_client::TxStatus;
     
     use crate::anchor_from_status;
    -use crate::FullScanUpdate;
    -use crate::SyncUpdate;
     
     /// [`esplora_client::Error`]
     pub type Error = Box<esplora_client::Error>;
    @@ -850,11 +842,10 @@
         /// [`LocalChain::tip`]: bdk_chain::local_chain::LocalChain::tip
         fn full_scan<K: Ord + Clone>(
             &self,
    -        local_tip: CheckPoint,
    -        keychain_spks: BTreeMap<K, impl IntoIterator<Item = (u32, ScriptBuf)>>,
    +        request: FullScanRequest<K>,
             stop_gap: usize,
             parallel_requests: usize,
    -    ) -> Result<FullScanUpdate<K>, Error>;
    +    ) -> Result<FullScanResult<K>, Error>;
     
         /// Sync a set of scripts with the blockchain (via an Esplora client) for the data
         /// specified and return a [`TxGraph`].
    @@ -870,59 +861,54 @@
         ///
         /// [`LocalChain::tip`]: bdk_chain::local_chain::LocalChain::tip
         /// [`full_scan`]: EsploraExt::full_scan
    -    fn sync(
    -        &self,
    -        local_tip: CheckPoint,
    -        misc_spks: impl IntoIterator<Item = ScriptBuf>,
    -        txids: impl IntoIterator<Item = Txid>,
    -        outpoints: impl IntoIterator<Item = OutPoint>,
    -        parallel_requests: usize,
    -    ) -> Result<SyncUpdate, Error>;
    +    fn sync(&self, request: SyncRequest, parallel_requests: usize) -> Result<SyncResult, Error>;
     }
     
     impl EsploraExt for esplora_client::BlockingClient {
         fn full_scan<K: Ord + Clone>(
             &self,
    -        local_tip: CheckPoint,
    -        keychain_spks: BTreeMap<K, impl IntoIterator<Item = (u32, ScriptBuf)>>,
    +        request: FullScanRequest<K>,
             stop_gap: usize,
             parallel_requests: usize,
    -    ) -> Result<FullScanUpdate<K>, Error> {
    +    ) -> Result<FullScanResult<K>, Error> {
             let latest_blocks = fetch_latest_blocks(self)?;
    -        let (tx_graph, last_active_indices) = full_scan_for_index_and_graph_blocking(
    +        let (graph_update, last_active_indices) = full_scan_for_index_and_graph_blocking(
                 self,
    -            keychain_spks,
    +            request.spks_by_keychain,
                 stop_gap,
                 parallel_requests,
             )?;
    -        let local_chain = chain_update(self, &latest_blocks, &local_tip, tx_graph.all_anchors())?;
    -        Ok(FullScanUpdate {
    -            local_chain,
    -            tx_graph,
    +        let chain_update = chain_update(
    +            self,
    +            &latest_blocks,
    +            &request.chain_tip,
    +            graph_update.all_anchors(),
    +        )?;
    +        Ok(FullScanResult {
    +            chain_update,
    +            graph_update,
                 last_active_indices,
             })
         }
     
    -    fn sync(
    -        &self,
    -        local_tip: CheckPoint,
    -        misc_spks: impl IntoIterator<Item = ScriptBuf>,
    -        txids: impl IntoIterator<Item = Txid>,
    -        outpoints: impl IntoIterator<Item = OutPoint>,
    -        parallel_requests: usize,
    -    ) -> Result<SyncUpdate, Error> {
    +    fn sync(&self, request: SyncRequest, parallel_requests: usize) -> Result<SyncResult, Error> {
             let latest_blocks = fetch_latest_blocks(self)?;
    -        let tx_graph = sync_for_index_and_graph_blocking(
    +        let graph_update = sync_for_index_and_graph_blocking(
                 self,
    -            misc_spks,
    -            txids,
    -            outpoints,
    +            request.spks,
    +            request.txids,
    +            request.outpoints,
                 parallel_requests,
             )?;
    -        let local_chain = chain_update(self, &latest_blocks, &local_tip, tx_graph.all_anchors())?;
    -        Ok(SyncUpdate {
    -            local_chain,
    -            tx_graph,
    +        let chain_update = chain_update(
    +            self,
    +            &latest_blocks,
    +            &request.chain_tip,
    +            graph_update.all_anchors(),
    +        )?;
    +        Ok(SyncResult {
    +            chain_update,
    +            graph_update,
             })
         }
     }
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_esplora/lib.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_esplora/lib.rs.html
    index 28da0feffe..c658d3a8d9 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_esplora/lib.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_esplora/lib.rs.html
    @@ -48,26 +48,6 @@
     48
     49
     50
    -51
    -52
    -53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -61
    -62
    -63
    -64
    -65
    -66
    -67
    -68
    -69
    -70
     
    #![doc = include_str!("../README.md")]
     
     //! This crate is used for updating structures of [`bdk_chain`] with data from an Esplora server.
    @@ -86,9 +66,7 @@
     //! [`TxGraph`]: bdk_chain::tx_graph::TxGraph
     //! [`example_esplora`]: https://github.com/bitcoindevkit/bdk/tree/master/example-crates/example_esplora
     
    -use std::collections::BTreeMap;
    -
    -use bdk_chain::{local_chain::CheckPoint, BlockId, ConfirmationTimeHeightAnchor, TxGraph};
    +use bdk_chain::{BlockId, ConfirmationTimeHeightAnchor};
     use esplora_client::TxStatus;
     
     pub use esplora_client;
    @@ -120,23 +98,5 @@
             None
         }
     }
    -
    -/// Update returns from a full scan.
    -pub struct FullScanUpdate<K> {
    -    /// The update to apply to the receiving [`LocalChain`](bdk_chain::local_chain::LocalChain).
    -    pub local_chain: CheckPoint,
    -    /// The update to apply to the receiving [`TxGraph`].
    -    pub tx_graph: TxGraph<ConfirmationTimeHeightAnchor>,
    -    /// Last active indices for the corresponding keychains (`K`).
    -    pub last_active_indices: BTreeMap<K, u32>,
    -}
    -
    -/// Update returned from a sync.
    -pub struct SyncUpdate {
    -    /// The update to apply to the receiving [`LocalChain`](bdk_chain::local_chain::LocalChain).
    -    pub local_chain: CheckPoint,
    -    /// The update to apply to the receiving [`TxGraph`].
    -    pub tx_graph: TxGraph<ConfirmationTimeHeightAnchor>,
    -}
     
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/src/example_esplora/main.rs.html b/docs-rs/bdk/nightly/latest/src/example_esplora/main.rs.html index a8da978c7a..d8166c3d92 100644 --- a/docs-rs/bdk/nightly/latest/src/example_esplora/main.rs.html +++ b/docs-rs/bdk/nightly/latest/src/example_esplora/main.rs.html @@ -354,17 +354,25 @@ 354 355 356 +357 +358 +359 +360 +361 +362 +363
    use std::{
    -    collections::BTreeMap,
    +    collections::BTreeSet,
         io::{self, Write},
         sync::Mutex,
     };
     
     use bdk_chain::{
    -    bitcoin::{constants::genesis_block, Address, Network, OutPoint, ScriptBuf, Txid},
    +    bitcoin::{constants::genesis_block, Address, Network, Txid},
         indexed_tx_graph::{self, IndexedTxGraph},
         keychain,
         local_chain::{self, LocalChain},
    +    spk_client::{FullScanRequest, SyncRequest},
         Append, ConfirmationTimeHeightAnchor,
     };
     
    @@ -523,45 +531,34 @@
                 scan_options,
                 ..
             } => {
    -            let local_tip = chain.lock().expect("mutex must not be poisoned").tip();
    -            let keychain_spks = graph
    -                .lock()
    -                .expect("mutex must not be poisoned")
    -                .index
    -                .all_unbounded_spk_iters()
    -                .into_iter()
    -                // This `map` is purely for logging.
    -                .map(|(keychain, iter)| {
    -                    let mut first = true;
    -                    let spk_iter = iter.inspect(move |(i, _)| {
    -                        if first {
    -                            eprint!("\nscanning {}: ", keychain);
    -                            first = false;
    +            let request = {
    +                let chain_tip = chain.lock().expect("mutex must not be poisoned").tip();
    +                let indexed_graph = &*graph.lock().expect("mutex must not be poisoned");
    +                FullScanRequest::from_keychain_txout_index(chain_tip, &indexed_graph.index)
    +                    .inspect_spks_for_all_keychains({
    +                        let mut once = BTreeSet::<Keychain>::new();
    +                        move |keychain, spk_i, _| {
    +                            if once.insert(keychain) {
    +                                eprint!("\nscanning {}: ", keychain);
    +                            }
    +                            eprint!("{} ", spk_i);
    +                            // Flush early to ensure we print at every iteration.
    +                            let _ = io::stderr().flush();
                             }
    -                        eprint!("{} ", i);
    -                        // Flush early to ensure we print at every iteration.
    -                        let _ = io::stderr().flush();
    -                    });
    -                    (keychain, spk_iter)
    -                })
    -                .collect::<BTreeMap<_, _>>();
    +                    })
    +            };
     
                 // The client scans keychain spks for transaction histories, stopping after `stop_gap`
                 // is reached. It returns a `TxGraph` update (`graph_update`) and a structure that
                 // represents the last active spk derivation indices of keychains
                 // (`keychain_indices_update`).
                 let mut update = client
    -                .full_scan(
    -                    local_tip,
    -                    keychain_spks,
    -                    *stop_gap,
    -                    scan_options.parallel_requests,
    -                )
    +                .full_scan(request, *stop_gap, scan_options.parallel_requests)
                     .context("scanning for transactions")?;
     
                 // We want to keep track of the latest time a transaction was seen unconfirmed.
                 let now = std::time::UNIX_EPOCH.elapsed().unwrap().as_secs();
    -            let _ = update.tx_graph.update_last_seen_unconfirmed(now);
    +            let _ = update.graph_update.update_last_seen_unconfirmed(now);
     
                 let mut graph = graph.lock().expect("mutex must not be poisoned");
                 let mut chain = chain.lock().expect("mutex must not be poisoned");
    @@ -569,11 +566,11 @@
                 // deriviation indices. Usually before a scan you are on a fresh wallet with no
                 // addresses derived so we need to derive up to last active addresses the scan found
                 // before adding the transactions.
    -            (chain.apply_update(update.local_chain)?, {
    +            (chain.apply_update(update.chain_update)?, {
                     let (_, index_changeset) = graph
                         .index
                         .reveal_to_target_multi(&update.last_active_indices);
    -                let mut indexed_tx_graph_changeset = graph.apply_update(update.tx_graph);
    +                let mut indexed_tx_graph_changeset = graph.apply_update(update.graph_update);
                     indexed_tx_graph_changeset.append(index_changeset.into());
                     indexed_tx_graph_changeset
                 })
    @@ -597,12 +594,9 @@
                     unused_spks = false;
                 }
     
    -            // Spks, outpoints and txids we want updates on will be accumulated here.
    -            let mut spks: Box<dyn Iterator<Item = ScriptBuf>> = Box::new(core::iter::empty());
    -            let mut outpoints: Box<dyn Iterator<Item = OutPoint>> = Box::new(core::iter::empty());
    -            let mut txids: Box<dyn Iterator<Item = Txid>> = Box::new(core::iter::empty());
    -
                 let local_tip = chain.lock().expect("mutex must not be poisoned").tip();
    +            // Spks, outpoints and txids we want updates on will be accumulated here.
    +            let mut request = SyncRequest::from_chain_tip(local_tip.clone());
     
                 // Get a short lock on the structures to get spks, utxos, and txs that we are interested
                 // in.
    @@ -616,12 +610,12 @@
                             .revealed_spks(..)
                             .map(|(k, i, spk)| (k.to_owned(), i, spk.to_owned()))
                             .collect::<Vec<_>>();
    -                    spks = Box::new(spks.chain(all_spks.into_iter().map(|(k, i, spk)| {
    -                        eprintln!("scanning {}:{}", k, i);
    +                    request = request.chain_spks(all_spks.into_iter().map(|(k, i, spk)| {
    +                        eprint!("scanning {}:{}", k, i);
                             // Flush early to ensure we print at every iteration.
                             let _ = io::stderr().flush();
                             spk
    -                    })));
    +                    }));
                     }
                     if unused_spks {
                         let unused_spks = graph
    @@ -629,17 +623,18 @@
                             .unused_spks()
                             .map(|(k, i, spk)| (k, i, spk.to_owned()))
                             .collect::<Vec<_>>();
    -                    spks = Box::new(spks.chain(unused_spks.into_iter().map(|(k, i, spk)| {
    -                        eprintln!(
    -                            "Checking if address {} {}:{} has been used",
    -                            Address::from_script(&spk, args.network).unwrap(),
    -                            k,
    -                            i,
    -                        );
    -                        // Flush early to ensure we print at every iteration.
    -                        let _ = io::stderr().flush();
    -                        spk
    -                    })));
    +                    request =
    +                        request.chain_spks(unused_spks.into_iter().map(move |(k, i, spk)| {
    +                            eprint!(
    +                                "Checking if address {} {}:{} has been used",
    +                                Address::from_script(&spk, args.network).unwrap(),
    +                                k,
    +                                i,
    +                            );
    +                            // Flush early to ensure we print at every iteration.
    +                            let _ = io::stderr().flush();
    +                            spk
    +                        }));
                     }
                     if utxos {
                         // We want to search for whether the UTXO is spent, and spent by which
    @@ -651,11 +646,11 @@
                             .filter_chain_unspents(&*chain, local_tip.block_id(), init_outpoints)
                             .map(|(_, utxo)| utxo)
                             .collect::<Vec<_>>();
    -                    outpoints = Box::new(
    +                    request = request.chain_outpoints(
                             utxos
                                 .into_iter()
                                 .inspect(|utxo| {
    -                                eprintln!(
    +                                eprint!(
                                         "Checking if outpoint {} (value: {}) has been spent",
                                         utxo.outpoint, utxo.txout.value
                                     );
    @@ -675,29 +670,48 @@
                             .filter(|canonical_tx| !canonical_tx.chain_position.is_confirmed())
                             .map(|canonical_tx| canonical_tx.tx_node.txid)
                             .collect::<Vec<Txid>>();
    -                    txids = Box::new(unconfirmed_txids.into_iter().inspect(|txid| {
    -                        eprintln!("Checking if {} is confirmed yet", txid);
    +                    request = request.chain_txids(unconfirmed_txids.into_iter().inspect(|txid| {
    +                        eprint!("Checking if {} is confirmed yet", txid);
                             // Flush early to ensure we print at every iteration.
                             let _ = io::stderr().flush();
                         }));
                     }
                 }
     
    -            let mut update = client.sync(
    -                local_tip,
    -                spks,
    -                txids,
    -                outpoints,
    -                scan_options.parallel_requests,
    -            )?;
    +            let total_spks = request.spks.len();
    +            let total_txids = request.txids.len();
    +            let total_ops = request.outpoints.len();
    +            request = request
    +                .inspect_spks({
    +                    let mut visited = 0;
    +                    move |_| {
    +                        visited += 1;
    +                        eprintln!(" [ {:>6.2}% ]", (visited * 100) as f32 / total_spks as f32)
    +                    }
    +                })
    +                .inspect_txids({
    +                    let mut visited = 0;
    +                    move |_| {
    +                        visited += 1;
    +                        eprintln!(" [ {:>6.2}% ]", (visited * 100) as f32 / total_txids as f32)
    +                    }
    +                })
    +                .inspect_outpoints({
    +                    let mut visited = 0;
    +                    move |_| {
    +                        visited += 1;
    +                        eprintln!(" [ {:>6.2}% ]", (visited * 100) as f32 / total_ops as f32)
    +                    }
    +                });
    +            let mut update = client.sync(request, scan_options.parallel_requests)?;
     
                 // Update last seen unconfirmed
                 let now = std::time::UNIX_EPOCH.elapsed().unwrap().as_secs();
    -            let _ = update.tx_graph.update_last_seen_unconfirmed(now);
    +            let _ = update.graph_update.update_last_seen_unconfirmed(now);
     
                 (
    -                chain.lock().unwrap().apply_update(update.local_chain)?,
    -                graph.lock().unwrap().apply_update(update.tx_graph),
    +                chain.lock().unwrap().apply_update(update.chain_update)?,
    +                graph.lock().unwrap().apply_update(update.graph_update),
                 )
             }
         };
    diff --git a/docs-rs/bdk/nightly/latest/src/wallet_esplora_async/main.rs.html b/docs-rs/bdk/nightly/latest/src/wallet_esplora_async/main.rs.html
    index 8af6b43bbb..6cc0750205 100644
    --- a/docs-rs/bdk/nightly/latest/src/wallet_esplora_async/main.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/wallet_esplora_async/main.rs.html
    @@ -98,11 +98,19 @@
     98
     99
     100
    -
    use std::{io::Write, str::FromStr};
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +
    use std::{collections::BTreeSet, io::Write, str::FromStr};
     
     use bdk::{
    -    bitcoin::{Address, Network},
    -    wallet::Update,
    +    bitcoin::{Address, Network, Script},
         KeychainKind, SignOptions, Wallet,
     };
     use bdk_esplora::{esplora_client, EsploraAsyncExt};
    @@ -137,34 +145,44 @@
         let client =
             esplora_client::Builder::new("https://blockstream.info/testnet/api").build_async()?;
     
    -    let prev_tip = wallet.latest_checkpoint();
    -    let keychain_spks = wallet
    -        .all_unbounded_spk_iters()
    -        .into_iter()
    -        .map(|(k, k_spks)| {
    -            let mut once = Some(());
    -            let mut stdout = std::io::stdout();
    -            let k_spks = k_spks
    -                .inspect(move |(spk_i, _)| match once.take() {
    -                    Some(_) => print!("\nScanning keychain [{:?}]", k),
    -                    None => print!(" {:<3}", spk_i),
    -                })
    -                .inspect(move |_| stdout.flush().expect("must flush"));
    -            (k, k_spks)
    +    fn generate_inspect(kind: KeychainKind) -> impl FnMut(u32, &Script) + Send + Sync + 'static {
    +        let mut once = Some(());
    +        let mut stdout = std::io::stdout();
    +        move |spk_i, _| {
    +            match once.take() {
    +                Some(_) => print!("\nScanning keychain [{:?}]", kind),
    +                None => print!(" {:<3}", spk_i),
    +            };
    +            stdout.flush().expect("must flush");
    +        }
    +    }
    +    let request = wallet
    +        .start_full_scan()
    +        .inspect_spks_for_all_keychains({
    +            let mut once = BTreeSet::<KeychainKind>::new();
    +            move |keychain, spk_i, _| {
    +                match once.insert(keychain) {
    +                    true => print!("\nScanning keychain [{:?}]", keychain),
    +                    false => print!(" {:<3}", spk_i),
    +                }
    +                std::io::stdout().flush().expect("must flush")
    +            }
             })
    -        .collect();
    +        .inspect_spks_for_keychain(
    +            KeychainKind::External,
    +            generate_inspect(KeychainKind::External),
    +        )
    +        .inspect_spks_for_keychain(
    +            KeychainKind::Internal,
    +            generate_inspect(KeychainKind::Internal),
    +        );
     
         let mut update = client
    -        .full_scan(prev_tip, keychain_spks, STOP_GAP, PARALLEL_REQUESTS)
    +        .full_scan(request, STOP_GAP, PARALLEL_REQUESTS)
             .await?;
         let now = std::time::UNIX_EPOCH.elapsed().unwrap().as_secs();
    -    let _ = update.tx_graph.update_last_seen_unconfirmed(now);
    +    let _ = update.graph_update.update_last_seen_unconfirmed(now);
     
    -    let update = Update {
    -        last_active_indices: update.last_active_indices,
    -        graph: update.tx_graph,
    -        chain: Some(update.local_chain),
    -    };
         wallet.apply_update(update)?;
         wallet.commit()?;
         println!();
    diff --git a/docs-rs/bdk/nightly/latest/src/wallet_esplora_blocking/main.rs.html b/docs-rs/bdk/nightly/latest/src/wallet_esplora_blocking/main.rs.html
    index 7499e76934..97c5a7376f 100644
    --- a/docs-rs/bdk/nightly/latest/src/wallet_esplora_blocking/main.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/wallet_esplora_blocking/main.rs.html
    @@ -83,31 +83,15 @@
     83
     84
     85
    -86
    -87
    -88
    -89
    -90
    -91
    -92
    -93
    -94
    -95
    -96
    -97
    -98
    -99
    -100
     
    const DB_MAGIC: &str = "bdk_wallet_esplora_example";
     const SEND_AMOUNT: u64 = 1000;
     const STOP_GAP: usize = 5;
     const PARALLEL_REQUESTS: usize = 1;
     
    -use std::{io::Write, str::FromStr};
    +use std::{collections::BTreeSet, io::Write, str::FromStr};
     
     use bdk::{
         bitcoin::{Address, Network},
    -    wallet::Update,
         KeychainKind, SignOptions, Wallet,
     };
     use bdk_esplora::{esplora_client, EsploraExt};
    @@ -136,36 +120,22 @@
         let client =
             esplora_client::Builder::new("https://blockstream.info/testnet/api").build_blocking();
     
    -    let keychain_spks = wallet
    -        .all_unbounded_spk_iters()
    -        .into_iter()
    -        .map(|(k, k_spks)| {
    -            let mut once = Some(());
    -            let mut stdout = std::io::stdout();
    -            let k_spks = k_spks
    -                .inspect(move |(spk_i, _)| match once.take() {
    -                    Some(_) => print!("\nScanning keychain [{:?}]", k),
    -                    None => print!(" {:<3}", spk_i),
    -                })
    -                .inspect(move |_| stdout.flush().expect("must flush"));
    -            (k, k_spks)
    -        })
    -        .collect();
    -
    -    let mut update = client.full_scan(
    -        wallet.latest_checkpoint(),
    -        keychain_spks,
    -        STOP_GAP,
    -        PARALLEL_REQUESTS,
    -    )?;
    +    let request = wallet.start_full_scan().inspect_spks_for_all_keychains({
    +        let mut once = BTreeSet::<KeychainKind>::new();
    +        move |keychain, spk_i, _| {
    +            match once.insert(keychain) {
    +                true => print!("\nScanning keychain [{:?}]", keychain),
    +                false => print!(" {:<3}", spk_i),
    +            };
    +            std::io::stdout().flush().expect("must flush")
    +        }
    +    });
    +
    +    let mut update = client.full_scan(request, STOP_GAP, PARALLEL_REQUESTS)?;
         let now = std::time::UNIX_EPOCH.elapsed().unwrap().as_secs();
    -    let _ = update.tx_graph.update_last_seen_unconfirmed(now);
    +    let _ = update.graph_update.update_last_seen_unconfirmed(now);
     
    -    wallet.apply_update(Update {
    -        last_active_indices: update.last_active_indices,
    -        graph: update.tx_graph,
    -        chain: Some(update.local_chain),
    -    })?;
    +    wallet.apply_update(update)?;
         wallet.commit()?;
         println!();
     
    diff --git a/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.DB_MAGIC.html b/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.DB_MAGIC.html
    index 101a9161ff..ed4374360f 100644
    --- a/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.DB_MAGIC.html
    +++ b/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.DB_MAGIC.html
    @@ -1 +1 @@
    -DB_MAGIC in wallet_esplora_async - Rust
    pub(crate) const DB_MAGIC: &str = "bdk_wallet_esplora_async_example";
    \ No newline at end of file +DB_MAGIC in wallet_esplora_async - Rust
    pub(crate) const DB_MAGIC: &str = "bdk_wallet_esplora_async_example";
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.PARALLEL_REQUESTS.html b/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.PARALLEL_REQUESTS.html index 137d4d9713..67ef1a001d 100644 --- a/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.PARALLEL_REQUESTS.html +++ b/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.PARALLEL_REQUESTS.html @@ -1 +1 @@ -PARALLEL_REQUESTS in wallet_esplora_async - Rust
    pub(crate) const PARALLEL_REQUESTS: usize = 5;
    \ No newline at end of file +PARALLEL_REQUESTS in wallet_esplora_async - Rust
    pub(crate) const PARALLEL_REQUESTS: usize = 5;
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.SEND_AMOUNT.html b/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.SEND_AMOUNT.html index 5934fd7137..440502731a 100644 --- a/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.SEND_AMOUNT.html +++ b/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.SEND_AMOUNT.html @@ -1 +1 @@ -SEND_AMOUNT in wallet_esplora_async - Rust
    pub(crate) const SEND_AMOUNT: u64 = 5000;
    \ No newline at end of file +SEND_AMOUNT in wallet_esplora_async - Rust
    pub(crate) const SEND_AMOUNT: u64 = 5000;
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.STOP_GAP.html b/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.STOP_GAP.html index 1ff7ae69e4..36afeec8d7 100644 --- a/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.STOP_GAP.html +++ b/docs-rs/bdk/nightly/latest/wallet_esplora_async/constant.STOP_GAP.html @@ -1 +1 @@ -STOP_GAP in wallet_esplora_async - Rust
    pub(crate) const STOP_GAP: usize = 50;
    \ No newline at end of file +STOP_GAP in wallet_esplora_async - Rust
    pub(crate) const STOP_GAP: usize = 50;
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/wallet_esplora_async/fn.main.html b/docs-rs/bdk/nightly/latest/wallet_esplora_async/fn.main.html index 7456b3b3f6..b793c08528 100644 --- a/docs-rs/bdk/nightly/latest/wallet_esplora_async/fn.main.html +++ b/docs-rs/bdk/nightly/latest/wallet_esplora_async/fn.main.html @@ -1 +1 @@ -main in wallet_esplora_async - Rust

    Function wallet_esplora_async::main

    source ·
    pub(crate) fn main() -> Result<(), Error>
    \ No newline at end of file +main in wallet_esplora_async - Rust

    Function wallet_esplora_async::main

    source ·
    pub(crate) fn main() -> Result<(), Error>
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/wallet_esplora_async/index.html b/docs-rs/bdk/nightly/latest/wallet_esplora_async/index.html index 99f9c4a529..43bacaf475 100644 --- a/docs-rs/bdk/nightly/latest/wallet_esplora_async/index.html +++ b/docs-rs/bdk/nightly/latest/wallet_esplora_async/index.html @@ -1 +1 @@ -wallet_esplora_async - Rust
    \ No newline at end of file +wallet_esplora_async - Rust
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/wallet_esplora_blocking/fn.main.html b/docs-rs/bdk/nightly/latest/wallet_esplora_blocking/fn.main.html index 79fe044eb2..7ecf66503e 100644 --- a/docs-rs/bdk/nightly/latest/wallet_esplora_blocking/fn.main.html +++ b/docs-rs/bdk/nightly/latest/wallet_esplora_blocking/fn.main.html @@ -1 +1 @@ -main in wallet_esplora_blocking - Rust
    pub(crate) fn main() -> Result<(), Error>
    \ No newline at end of file +main in wallet_esplora_blocking - Rust
    pub(crate) fn main() -> Result<(), Error>
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/wallet_esplora_blocking/index.html b/docs-rs/bdk/nightly/latest/wallet_esplora_blocking/index.html index a5e0599040..d85299e4f3 100644 --- a/docs-rs/bdk/nightly/latest/wallet_esplora_blocking/index.html +++ b/docs-rs/bdk/nightly/latest/wallet_esplora_blocking/index.html @@ -1 +1 @@ -wallet_esplora_blocking - Rust
    \ No newline at end of file +wallet_esplora_blocking - Rust
    \ No newline at end of file diff --git a/examples/index.html b/examples/index.html index 59ea35d62d..6943b785db 100644 --- a/examples/index.html +++ b/examples/index.html @@ -29,7 +29,7 @@ - + @@ -53,7 +53,7 @@ Blog
    GitHub - (opens new window)

    # Examples

    Click the links below and learn from community-built example projects.

    # BDK-CLI (opens new window)

    A command line interface to experiment with the bitcoindevkit.

    # DevkitWallet (opens new window)

    A demo app for the bitcoindevkit on Android using bdk-kotlin.

    # Padawan Wallet (opens new window)

    A testnet-only bitcoin wallet full of tutorials on how to use bitcoin wallets.

    # BDKSwiftExampleWallet (opens new window)

    An example iOS app using bdk-swift.

    # Tatooine (opens new window)

    Tatooine is a small bitcoin testnet faucet built with Ktor, a Kotlin asynchronous framework for creating microservices and web applications.

    # SEBA Bank Proof of reserves (opens new window)

    The bdk library aims to be the core building block for Bitcoin wallets of any kind. The bdk-reserves library provides an implementation of proof-of-reserves for bdk.

    # Stackmate (opens new window)

    A multi-purpose Bitcoin Wallet.

    # Spotbit (opens new window)

    Spotbit's purpose is to allow users to access price feeds in a customisable way that preserves privacy and mitigate the reliance on a single source of data.

    - + diff --git a/foundation/index.html b/foundation/index.html index d253a388c1..faf644ed9f 100644 --- a/foundation/index.html +++ b/foundation/index.html @@ -29,7 +29,7 @@ - + @@ -74,6 +74,6 @@
    - + diff --git a/getting-started/index.html b/getting-started/index.html index ce823e8947..0dcca365bb 100644 --- a/getting-started/index.html +++ b/getting-started/index.html @@ -31,7 +31,7 @@ - + @@ -105,7 +105,7 @@ wallet.get_descriptor_for_keychain(KeychainKind::External).to_string(), wallet.get_descriptor_for_keychain(KeychainKind::Internal).to_string()); } -

    More information about each component used in the code can be found in BDK Documentation (opens new window).

    More information about each component used in the code can be found in BDK Documentation (opens new window).

    - + diff --git a/index.html b/index.html index 3727dfe514..a20247234c 100644 --- a/index.html +++ b/index.html @@ -29,7 +29,7 @@ - + @@ -80,6 +80,6 @@
    - + diff --git a/sitemap.xml b/sitemap.xml index 38dd726ec8..81c83993c3 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -https://bitcoindevkit.org/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/_2024-q4-update/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/bdk-cli-basics/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/bitcoin-core-rpc-demo/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/bdk-cli-basics-multisig-2of3/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/bdk-core-pt1/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/bdk-rn-making-of/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/compact-filters-demo/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/bdk-with-tor/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/bindings-scope/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/descriptor-based-paper-wallet/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/descriptors-in-the-wild/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/exploring-bdk-flutter/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/exploring-bdk-rn/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-2/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-3/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/getting-started-with-rust-hwi/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/2020/12/hello-world/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/hidden-power-of-bitcoin/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/2020/12/release-v0.2.0/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/improving-coin-selection-in-bdk/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/miniscript-vulnerability/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/release-v0.3.0/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/2021/02/release-v0.4.0/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/2021/03/release-v0.5.0/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/2021/04/release-v0.6.0/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/2021/05/release-v0.7.0/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/road-to-bdk-1/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/2021/06/release-v0.8.0/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/spending-policy-demo/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/using-bdk-with-hardware-wallets/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/2021/07/release-v0.9.0/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/bdk-cli/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/bdk-cli/compiler/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/bdk-cli/concept/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/bdk-cli/installation/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/bdk-cli/interface/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/bdk-cli/introduction/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/bdk-cli/regtest/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/case-studies/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/bdk-cli/playground/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/descriptors/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/getting-started/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/foundation/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/supporters/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/examples/2024-04-29T08:44:31.000Zdailyhttps://bitcoindevkit.org/blog/dailyhttps://bitcoindevkit.org/blog/tags/dailyhttps://bitcoindevkit.org/blog/author/dailyhttps://bitcoindevkit.org/blog/tags/BDK/dailyhttps://bitcoindevkit.org/blog/tags/project/dailyhttps://bitcoindevkit.org/blog/tags/bdk-cli/dailyhttps://bitcoindevkit.org/blog/tags/basics/dailyhttps://bitcoindevkit.org/blog/tags/novice/dailyhttps://bitcoindevkit.org/blog/tags/tutorial/dailyhttps://bitcoindevkit.org/blog/tags/Bitcoin%20Core/dailyhttps://bitcoindevkit.org/blog/tags/RPC/dailyhttps://bitcoindevkit.org/blog/tags/Wallet/dailyhttps://bitcoindevkit.org/blog/tags/multi-sig/dailyhttps://bitcoindevkit.org/blog/tags/architecture/dailyhttps://bitcoindevkit.org/blog/tags/BDK-RN/dailyhttps://bitcoindevkit.org/blog/tags/Development/dailyhttps://bitcoindevkit.org/blog/tags/Architecture/dailyhttps://bitcoindevkit.org/blog/tags/compact_filters/dailyhttps://bitcoindevkit.org/blog/tags/BIP157/dailyhttps://bitcoindevkit.org/blog/tags/Neutrino/dailyhttps://bitcoindevkit.org/blog/tags/tor/dailyhttps://bitcoindevkit.org/blog/tags/wallet/dailyhttps://bitcoindevkit.org/blog/tags/blockchain/dailyhttps://bitcoindevkit.org/blog/tags/bindings/dailyhttps://bitcoindevkit.org/blog/tags/guide/dailyhttps://bitcoindevkit.org/blog/tags/descriptor/dailyhttps://bitcoindevkit.org/blog/tags/paper%20wallets/dailyhttps://bitcoindevkit.org/blog/tags/bitcoin/dailyhttps://bitcoindevkit.org/blog/tags/React%20Native/dailyhttps://bitcoindevkit.org/blog/tags/Flutter/dailyhttps://bitcoindevkit.org/blog/tags/iOS/dailyhttps://bitcoindevkit.org/blog/tags/Android/dailyhttps://bitcoindevkit.org/blog/tags/mobile/dailyhttps://bitcoindevkit.org/blog/tags/bdk-rn/dailyhttps://bitcoindevkit.org/blog/tags/bdk/dailyhttps://bitcoindevkit.org/blog/tags/fee/dailyhttps://bitcoindevkit.org/blog/tags/machine%20learning/dailyhttps://bitcoindevkit.org/blog/tags/taproot/dailyhttps://bitcoindevkit.org/blog/tags/miniscript/dailyhttps://bitcoindevkit.org/blog/tags/Hardware%20Wallets/dailyhttps://bitcoindevkit.org/blog/tags/getting%20started/dailyhttps://bitcoindevkit.org/blog/tags/rust/dailyhttps://bitcoindevkit.org/blog/tags/bitcoin-cli/dailyhttps://bitcoindevkit.org/blog/tags/release/dailyhttps://bitcoindevkit.org/blog/tags/coin%20selection/dailyhttps://bitcoindevkit.org/blog/tags/development/dailyhttps://bitcoindevkit.org/blog/tags/summer%20of%20bitcoin/dailyhttps://bitcoindevkit.org/blog/tags/security/dailyhttps://bitcoindevkit.org/blog/author/Steve%20Myers/dailyhttps://bitcoindevkit.org/blog/author/Daniela%20Brozzoni/dailyhttps://bitcoindevkit.org/blog/author/waterst0ne/dailyhttps://bitcoindevkit.org/blog/author/Rajarshi%20Maitra/dailyhttps://bitcoindevkit.org/blog/author/Lloyd%20Fournier/dailyhttps://bitcoindevkit.org/blog/author/Bitcoin%20Zavior/dailyhttps://bitcoindevkit.org/blog/author/rorp/dailyhttps://bitcoindevkit.org/blog/author/thunderbiscuit/dailyhttps://bitcoindevkit.org/blog/author/Riccardo%20Casatta/dailyhttps://bitcoindevkit.org/blog/author/Gabriele%20Domenichini/dailyhttps://bitcoindevkit.org/blog/author/Alekos%20Filini/dailyhttps://bitcoindevkit.org/blog/author/Wszdexdrf/dailyhttps://bitcoindevkit.org/blog/author/Sandipan%20Dey/dailyhttps://bitcoindevkit.org/blog/author/C%C3%A9sar%20Alvarez%20Vallero/dailyhttps://bitcoindevkit.org/blog/page/2/dailyhttps://bitcoindevkit.org/blog/page/3/dailyhttps://bitcoindevkit.org/blog/page/4/dailyhttps://bitcoindevkit.org/blog/author/Alekos%20Filini/page/2/daily \ No newline at end of file +https://bitcoindevkit.org/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/_2024-q4-update/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/bdk-cli-basics-multisig-2of3/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/bitcoin-core-rpc-demo/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/bdk-cli-basics/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/bdk-core-pt1/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/bdk-with-tor/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/bindings-scope/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/bdk-rn-making-of/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/compact-filters-demo/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/descriptors-in-the-wild/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/descriptor-based-paper-wallet/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/exploring-bdk-flutter/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/exploring-bdk-rn/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-2/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-3/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/getting-started-with-rust-hwi/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/2020/12/hello-world/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/hidden-power-of-bitcoin/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/improving-coin-selection-in-bdk/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/miniscript-vulnerability/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/release-v0.3.0/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/2020/12/release-v0.2.0/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/2021/02/release-v0.4.0/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/2021/03/release-v0.5.0/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/2021/05/release-v0.7.0/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/2021/04/release-v0.6.0/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/2021/06/release-v0.8.0/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/2021/07/release-v0.9.0/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/road-to-bdk-1/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/using-bdk-with-hardware-wallets/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/spending-policy-demo/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/bdk-cli/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/bdk-cli/concept/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/bdk-cli/compiler/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/bdk-cli/installation/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/bdk-cli/interface/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/bdk-cli/introduction/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/bdk-cli/playground/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/bdk-cli/regtest/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/case-studies/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/descriptors/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/foundation/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/examples/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/getting-started/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/supporters/2024-05-01T07:01:28.000Zdailyhttps://bitcoindevkit.org/blog/dailyhttps://bitcoindevkit.org/blog/tags/dailyhttps://bitcoindevkit.org/blog/author/dailyhttps://bitcoindevkit.org/blog/tags/BDK/dailyhttps://bitcoindevkit.org/blog/tags/project/dailyhttps://bitcoindevkit.org/blog/tags/tutorial/dailyhttps://bitcoindevkit.org/blog/tags/bdk-cli/dailyhttps://bitcoindevkit.org/blog/tags/multi-sig/dailyhttps://bitcoindevkit.org/blog/tags/Bitcoin%20Core/dailyhttps://bitcoindevkit.org/blog/tags/RPC/dailyhttps://bitcoindevkit.org/blog/tags/Wallet/dailyhttps://bitcoindevkit.org/blog/tags/basics/dailyhttps://bitcoindevkit.org/blog/tags/novice/dailyhttps://bitcoindevkit.org/blog/tags/architecture/dailyhttps://bitcoindevkit.org/blog/tags/tor/dailyhttps://bitcoindevkit.org/blog/tags/wallet/dailyhttps://bitcoindevkit.org/blog/tags/blockchain/dailyhttps://bitcoindevkit.org/blog/tags/bindings/dailyhttps://bitcoindevkit.org/blog/tags/BDK-RN/dailyhttps://bitcoindevkit.org/blog/tags/Development/dailyhttps://bitcoindevkit.org/blog/tags/Architecture/dailyhttps://bitcoindevkit.org/blog/tags/compact_filters/dailyhttps://bitcoindevkit.org/blog/tags/BIP157/dailyhttps://bitcoindevkit.org/blog/tags/Neutrino/dailyhttps://bitcoindevkit.org/blog/tags/guide/dailyhttps://bitcoindevkit.org/blog/tags/descriptor/dailyhttps://bitcoindevkit.org/blog/tags/paper%20wallets/dailyhttps://bitcoindevkit.org/blog/tags/bitcoin/dailyhttps://bitcoindevkit.org/blog/tags/React%20Native/dailyhttps://bitcoindevkit.org/blog/tags/Flutter/dailyhttps://bitcoindevkit.org/blog/tags/iOS/dailyhttps://bitcoindevkit.org/blog/tags/Android/dailyhttps://bitcoindevkit.org/blog/tags/mobile/dailyhttps://bitcoindevkit.org/blog/tags/bdk-rn/dailyhttps://bitcoindevkit.org/blog/tags/bdk/dailyhttps://bitcoindevkit.org/blog/tags/fee/dailyhttps://bitcoindevkit.org/blog/tags/machine%20learning/dailyhttps://bitcoindevkit.org/blog/tags/taproot/dailyhttps://bitcoindevkit.org/blog/tags/miniscript/dailyhttps://bitcoindevkit.org/blog/tags/Hardware%20Wallets/dailyhttps://bitcoindevkit.org/blog/tags/getting%20started/dailyhttps://bitcoindevkit.org/blog/tags/rust/dailyhttps://bitcoindevkit.org/blog/tags/bitcoin-cli/dailyhttps://bitcoindevkit.org/blog/tags/coin%20selection/dailyhttps://bitcoindevkit.org/blog/tags/development/dailyhttps://bitcoindevkit.org/blog/tags/summer%20of%20bitcoin/dailyhttps://bitcoindevkit.org/blog/tags/security/dailyhttps://bitcoindevkit.org/blog/tags/release/dailyhttps://bitcoindevkit.org/blog/author/Steve%20Myers/dailyhttps://bitcoindevkit.org/blog/author/Daniela%20Brozzoni/dailyhttps://bitcoindevkit.org/blog/author/waterst0ne/dailyhttps://bitcoindevkit.org/blog/author/Rajarshi%20Maitra/dailyhttps://bitcoindevkit.org/blog/author/Lloyd%20Fournier/dailyhttps://bitcoindevkit.org/blog/author/rorp/dailyhttps://bitcoindevkit.org/blog/author/thunderbiscuit/dailyhttps://bitcoindevkit.org/blog/author/Bitcoin%20Zavior/dailyhttps://bitcoindevkit.org/blog/author/Gabriele%20Domenichini/dailyhttps://bitcoindevkit.org/blog/author/Riccardo%20Casatta/dailyhttps://bitcoindevkit.org/blog/author/Alekos%20Filini/dailyhttps://bitcoindevkit.org/blog/author/Wszdexdrf/dailyhttps://bitcoindevkit.org/blog/author/Sandipan%20Dey/dailyhttps://bitcoindevkit.org/blog/author/C%C3%A9sar%20Alvarez%20Vallero/dailyhttps://bitcoindevkit.org/blog/page/2/dailyhttps://bitcoindevkit.org/blog/page/3/dailyhttps://bitcoindevkit.org/blog/page/4/dailyhttps://bitcoindevkit.org/blog/author/Alekos%20Filini/page/2/daily \ No newline at end of file diff --git a/supporters/index.html b/supporters/index.html index ca1793fc12..d1ef88d76c 100644 --- a/supporters/index.html +++ b/supporters/index.html @@ -29,7 +29,7 @@ - + @@ -63,7 +63,7 @@ Brink Sponsor Kraken Kraken -
    - +