diff --git a/404.html b/404.html index 83f08b873c..ad6c543258 100644 --- a/404.html +++ b/404.html @@ -15,7 +15,7 @@ - + @@ -39,7 +39,7 @@ Blog GitHub - (opens new window)

404 - Not Found

How did we get here?
+ (opens new window)

404 - Not Found

That's a Four-Oh-Four.
Take me home.
- + diff --git a/adoption/all/index.html b/adoption/all/index.html index fcb20d4648..3837f876a7 100644 --- a/adoption/all/index.html +++ b/adoption/all/index.html @@ -29,7 +29,7 @@ - + @@ -82,6 +82,6 @@
BDK Foundation
- + diff --git a/adoption/custodial/index.html b/adoption/custodial/index.html index 03a9fe0a92..7752ca708e 100644 --- a/adoption/custodial/index.html +++ b/adoption/custodial/index.html @@ -29,7 +29,7 @@ - + @@ -82,6 +82,6 @@
BDK Foundation
- + diff --git a/adoption/desktop/index.html b/adoption/desktop/index.html index 067b09ec65..801af47cb2 100644 --- a/adoption/desktop/index.html +++ b/adoption/desktop/index.html @@ -29,7 +29,7 @@ - + @@ -82,6 +82,6 @@
BDK Foundation
- + diff --git a/adoption/exchange/index.html b/adoption/exchange/index.html index 78ba0a5bba..ceec5add6c 100644 --- a/adoption/exchange/index.html +++ b/adoption/exchange/index.html @@ -29,7 +29,7 @@ - + @@ -82,6 +82,6 @@
BDK Foundation
- + diff --git a/adoption/hardware/index.html b/adoption/hardware/index.html index 5ed1b068b1..1248477eca 100644 --- a/adoption/hardware/index.html +++ b/adoption/hardware/index.html @@ -29,7 +29,7 @@ - + @@ -84,6 +84,6 @@
BDK Foundation
- + diff --git a/adoption/infrastructure/index.html b/adoption/infrastructure/index.html index 9c9dbabd43..705bef1351 100644 --- a/adoption/infrastructure/index.html +++ b/adoption/infrastructure/index.html @@ -29,7 +29,7 @@ - + @@ -78,6 +78,6 @@
BDK Foundation
- + diff --git a/adoption/mobile/index.html b/adoption/mobile/index.html index 3c7d09b5f6..97c8e41c95 100644 --- a/adoption/mobile/index.html +++ b/adoption/mobile/index.html @@ -29,7 +29,7 @@ - + @@ -84,6 +84,6 @@
BDK Foundation
- + diff --git a/adoption/web/index.html b/adoption/web/index.html index b380283801..56103856e7 100644 --- a/adoption/web/index.html +++ b/adoption/web/index.html @@ -29,7 +29,7 @@ - + @@ -82,6 +82,6 @@
BDK Foundation
- + diff --git a/assets/js/31.00e676e0.js b/assets/js/31.abe06a5e.js similarity index 99% rename from assets/js/31.00e676e0.js rename to assets/js/31.abe06a5e.js index bc94982ce2..b019ab2b6c 100644 --- a/assets/js/31.00e676e0.js +++ b/assets/js/31.abe06a5e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{352:function(t,e,a){t.exports=a.p+"assets/img/BDK-RN-Architecture.42fbc351.png"},353:function(t,e,a){t.exports=a.p+"assets/img/BDK-RN.370f20c3.png"},354:function(t,e,a){t.exports=a.p+"assets/img/android_folder.0ff999be.png"},406: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(352),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(353)}}),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(354)}}),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],{352:function(t,e,a){t.exports=a.p+"assets/img/BDK-RN-Architecture.42fbc351.png"},353:function(t,e,a){t.exports=a.p+"assets/img/BDK-RN.370f20c3.png"},354:function(t,e,a){t.exports=a.p+"assets/img/android_folder.0ff999be.png"},408: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(352),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(353)}}),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(354)}}),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/34.0866fba2.js b/assets/js/34.530523dd.js similarity index 99% rename from assets/js/34.0866fba2.js rename to assets/js/34.530523dd.js index 30f9edccbc..00767c39cf 100644 --- a/assets/js/34.0866fba2.js +++ b/assets/js/34.530523dd.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{350:function(t,e,a){t.exports=a.p+"assets/img/descriptor-tracker.5942c853.jpg"},351:function(t,e,a){t.exports=a.p+"assets/img/checkpoints.a4179787.jpg"},405: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("p",[t._v("The Bitcoin Devkit (BDK) lets you do a lot of useful things through convenient high level\nabstractions. It works great when these abstractions map nicely onto what you are trying to do. My\ngoal is to develop a new "),e("code",[t._v("bdk_core")]),t._v(" library for when they don't. I want "),e("code",[t._v("bdk_core")]),t._v(" to expose all the\nuseful "),e("em",[t._v("mechanisms")]),t._v(" that BDK has inside it without them being tied to any particular usage "),e("em",[t._v("policy")]),t._v("\nand with very minimal dependencies.")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("bdk_core")]),t._v(' idea is still "in the lab". We\'re not sure yet whether '),e("code",[t._v("bdk_core")]),t._v(" will just be what's\nleft of "),e("code",[t._v("bdk")]),t._v(" once we spin off all the components that have extra dependencies into their own crates\nand refine it a bit. In that case "),e("code",[t._v("bdk_core")]),t._v(" will just be called "),e("code",[t._v("bdk v1.0.0")]),t._v(" or something. Or it might\nbe that "),e("code",[t._v("bdk")]),t._v(" lives on with its current APIs and uses stuff "),e("code",[t._v("bdk_core")]),t._v(" to implement it internally.")]),t._v(" "),e("h2",{attrs:{id:"the-separation-of-policy-and-mechanism"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#the-separation-of-policy-and-mechanism"}},[t._v("#")]),t._v(" The separation of policy and mechanism")]),t._v(" "),e("p",[t._v("My guiding principle for "),e("code",[t._v("bdk_core")]),t._v(" is the "),e("em",[t._v("separation of policy and mechanism")]),t._v(". This is\nwhat I mean by these terms:")]),t._v(" "),e("ul",[e("li",[e("em",[t._v("mechanism")]),t._v(": How you do a particular thing. Mechanism code is functional and doesn't change much.")]),t._v(" "),e("li",[e("em",[t._v("policy")]),t._v(": What you want to do. Policy code composes mechanisms to achieve something in\nan application.")])]),t._v(" "),e("p",[t._v("Here's a nice passage about why the designers of the "),e("a",{attrs:{href:"https://en.wikipedia.org/wiki/X_Window_System",target:"_blank",rel:"noopener noreferrer"}},[t._v("X window system"),e("OutboundLink")],1),t._v(" applied this principle. X has\nbeen around since 1984 and doesn't look like it's going anywhere so it probably has a lot to teach us.\nFrom "),e("em",[e("a",{attrs:{href:"https://en.wikipedia.org/wiki/The_Art_of_Unix_Programming",target:"_blank",rel:"noopener noreferrer"}},[t._v("The Art of UNIX Programming"),e("OutboundLink")],1)]),t._v(":")]),t._v(" "),e("blockquote",[e("p",[t._v("...we observed that the designers of X made a basic decision to implement “mechanism, not policy”—to\nmake X a generic graphics engine and leave decisions about user-interface style to toolkits and\nother levels of the system. We justified this by pointing out that policy and mechanism tend to\nmutate on different timescales, with policy changing much faster than mechanism. Fashions in the\nlook and feel of GUI toolkits may come and go, but raster operations and compositing are forever.")])]),t._v(" "),e("blockquote",[e("p",[t._v("Thus, hardwiring policy and mechanism together has two bad effects: It makes policy rigid and\nharder to change in response to user requirements, and it means that trying to change policy has a\nstrong tendency to destabilize the mechanisms.")])]),t._v(" "),e("blockquote",[e("p",[t._v("On the other hand, by separating the two we make it\npossible to experiment with new policy without breaking mechanisms. We also make it much easier to\nwrite good tests for the mechanism (policy, because it ages so quickly, often does not justify the\ninvestment).")])]),t._v(" "),e("ul",[e("li",[t._v("[ ] > This design rule has wide application outside the GUI context. In general, it implies that we")])]),t._v(" "),e("blockquote",[e("p",[t._v("should look for ways to separate interfaces from engines.")])]),t._v(" "),e("p",[t._v("You'll notice we have a similar situation in Bitcoin engineering. We have mechanism code like\nsigning algorithms, key derivation, transaction construction logic, etc., that don't change much. But\nhow these compose together in applications changes quickly over time and between applications.")]),t._v(" "),e("p",[t._v("The main culprit of policy and mechanism conflation in "),e("code",[t._v("bdk")]),t._v(" is the main "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/struct.Wallet.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("Wallet")]),e("OutboundLink")],1),t._v(" type.\nWallets do all of the following:")]),t._v(" "),e("ol",[e("li",[t._v("Store one or two descriptors (external and optional internal).")]),t._v(" "),e("li",[t._v("Keep track of which addresses you've given out so you only give out fresh ones from each descriptor.")]),t._v(" "),e("li",[t._v("Keep a list of transactions associated with the addresses in the wallet.")]),t._v(" "),e("li",[t._v("Given a source of blockchain data it can update its internal list of transactions.")]),t._v(" "),e("li",[t._v("Given some parameters it can build a PSBT from transaction outputs.")]),t._v(" "),e("li",[t._v("Given a PSBT it can sign it with its "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/signer/index.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("Signers")]),e("OutboundLink")],1),t._v(".")])]),t._v(" "),e("p",[t._v("All of that is very useful but it is bound together with the particular policies and opinions of "),e("code",[t._v("Wallet")]),t._v(".\nIf "),e("code",[t._v("Wallet")]),t._v("'s policy is not your policy it's going to be tricky to get it to do what you want.\nHere are some examples:")]),t._v(" "),e("ol",[e("li",[t._v("In order to control how the "),e("code",[t._v("Wallet")]),t._v(" will select coins for a transaction internally you have to\npass in something implementing the "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("CoinSelectionAlgorithm")]),e("OutboundLink")],1),t._v(" trait. A coin selection algorithm\nis clearly mechanism code but the policy of "),e("code",[t._v("Wallet")]),t._v(" restricts that mechanism's interface. We\nhave "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/281",target:"_blank",rel:"noopener noreferrer"}},[t._v("very old issues"),e("OutboundLink")],1),t._v(" related to what the\ninterface of this trait should be and we don't have a clear way forward. In "),e("code",[t._v("bdk_core")]),t._v(" I want to\npurely provide the coin selection mechanisms for figuring out whether you need to select more\nUTXOs or whether you need a change output etc. How you use that mechanism will be up to you.")]),t._v(" "),e("li",[t._v("Another trait that has a similar structure is the "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/signer/index.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("Signer")]),e("OutboundLink")],1),t._v(" trait. You have to pass in signers\nso your wallet can sign PSBTs but you have little control over how the wallet chooses which\nsigners to use in any given situation. Right now the wallet will just iterate through all the\nsigners and ask them to sign. This is not always appropriate. In "),e("code",[t._v("bdk_core")]),t._v(" I want to provide\nfunctions for populating PSBTs given something that can sign. You'll be in control of when they\nget called.")])]),t._v(" "),e("h2",{attrs:{id:"a-syncing-mechansim-without-the-policy"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#a-syncing-mechansim-without-the-policy"}},[t._v("#")]),t._v(" A syncing mechansim without the policy")]),t._v(" "),e("p",[t._v("Syncing in "),e("code",[t._v("bdk")]),t._v(" is the place where the design of "),e("code",[t._v("Wallet")]),t._v(" is most restrictive. The "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/blockchain/trait.WalletSync.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("WalletSync")]),e("OutboundLink")],1),t._v("\ntrait forces you to sync all addresses in a wallet in one big batch. But this is not always what you\nwant to do. I spoke to a developer who wanted to sync his wallet slowly over time with each address\nbeing queried over a different Tor connection. It would be really difficult to implement\n"),e("code",[t._v("WalletSync")]),t._v(" with such a strategy. Another example where "),e("code",[t._v("WalletSync")]),t._v(" isn't the right fit is the\n"),e("a",{attrs:{href:"https://l2.technology/sensei",target:"_blank",rel:"noopener noreferrer"}},[t._v("Sensei"),e("OutboundLink")],1),t._v(" project which uses BDK but incrementally updates the database whenever new information\ncomes in from the blockchain.")]),t._v(" "),e("p",[t._v("Even if syncing all addresses at the same time is roughly what you want to do "),e("code",[t._v("WalletSync")]),t._v(" still\ngets in the way since it defines whether you do it synchronously or asynchrononusly. Applications\ncan control this through "),e("code",[t._v("bdk")]),t._v("'s "),e("code",[t._v("async-interface")]),t._v(" feature flag which internally changes the trait\ndefinition through macros. Another annoyance is that when using "),e("code",[t._v("async-interface")]),t._v(" the future that\ngets returned from "),e("code",[t._v("WalletSync")]),t._v(" "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/165",target:"_blank",rel:"noopener noreferrer"}},[t._v("cannot be "),e("code",[t._v("Send")]),e("OutboundLink")],1),t._v("\nbecause of how "),e("code",[t._v("Wallet")]),t._v(" handles database mutability internally, meaning you can't spawn the future\ninto a new thread.")]),t._v(" "),e("h3",{attrs:{id:"a-general-syncing-mechanism"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#a-general-syncing-mechanism"}},[t._v("#")]),t._v(" A general syncing mechanism")]),t._v(" "),e("p",[t._v("So what is the most general syncing mechanism that solves these problems? These are the things I\nthink it has to do regardless of where the blockchain data comes from or how it's stored:")]),t._v(" "),e("ol",[e("li",[t._v("Generate and store addresses.")]),t._v(" "),e("li",[t._v("Index transaction data, e.g. transaction outputs we own, when/if they were spent, etc.")]),t._v(" "),e("li",[t._v("Keep track of which addresses have been given out and which have been used.")]),t._v(" "),e("li",[t._v('Be able to "roll back" our view of the above data if a reorg makes some of it stale.')]),t._v(" "),e("li",[t._v("Keep track of transactions related our addresses in our mempool.")])]),t._v(" "),e("p",[t._v("Let's talk about how to implement a mechanism that does all that.")]),t._v(" "),e("h3",{attrs:{id:"how-to-store-and-index-transactions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#how-to-store-and-index-transactions"}},[t._v("#")]),t._v(" How to store and index transactions")]),t._v(" "),e("p",[t._v("Different persistent storage backends have different APIs and their own indexing strategies. That's\nwhy the "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/database/trait.Database.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("Database")]),e("OutboundLink")],1),t._v(" trait exists in BDK, to make a clean API to the different storage engines. It's\nimportant to note that the database in BDK only holds public data that could always be retrieved\nfrom the chain. It's just a cache. Despite this we support different backends. Right now it is a\nlot of work to add a new index to the data since you have to add it to every backend and you might have\nto apply schema changes (we still "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/359",target:"_blank",rel:"noopener noreferrer"}},[t._v("don't have a standard approach to\nthis"),e("OutboundLink")],1),t._v(").")]),t._v(" "),e("p",[t._v("Thomas Eizinger "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/165#issuecomment-1047483895",target:"_blank",rel:"noopener noreferrer"}},[t._v("suggested"),e("OutboundLink")],1),t._v("\ndoing everything in memory and only writing to persistent storage when it was convenient. It took me\nsome time but I came around to this idea. It would allow us to get rid of the "),e("code",[t._v("Database")]),t._v(" trait (at\nleast at the "),e("code",[t._v("bdk_core")]),t._v(" level) and greatly simplify what the persistent storage layer has to do.\nWhenever the data is loaded from persistent storage we can just do the indexing in memory and\npresent it to the application.")]),t._v(" "),e("p",[e("em",[t._v("But wait! Wouldn't this mean we'd use way more memory than we need to?")]),t._v(" Yes but memory is cheap.\nConsider that if we say the average transaction size is 300 bytes then with all our indexes each\ntransaction might cost 1kb of memory (pessimistically). This means we could index one thousand\ntransactions in a single megabyte! My iPhone has 4gb of memory so it could index a million\ntransactions with plenty of memory to spare. "),e("em",[t._v("But what if some users can't afford an iPhone?")]),t._v(" Then\nthey also couldn't have afforded to have made a million Bitcoin transactions! "),e("em",[t._v("But what about memory\nconstrained devices like hardware wallets!?")]),t._v(" Those devices typically don't store and retrieve\ntransactions. They're usually just signing devices. Perhaps one day someone will build a memory\nconstrained device that needs to do this work but until then I think this is a fine approach to\ntake.")]),t._v(" "),e("p",[t._v("For now I'm calling this thing that does the in-memory indexing of transactions related to a single\ndescriptor a "),e("code",[t._v("DescriptorTracker")]),t._v(". Here's a diagram that communicates how I imagine it relates to the\nother components.")]),t._v(" "),e("figure",[e("img",{attrs:{src:a(350),alt:""}})]),t._v(" "),e("h3",{attrs:{id:"rolling-back-rolling-forward-and-syncing-to-disk"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#rolling-back-rolling-forward-and-syncing-to-disk"}},[t._v("#")]),t._v(" Rolling back, rolling forward and syncing to disk")]),t._v(" "),e("p",[t._v("State changes in blockchains are clearly delineated. They all happen in blocks! Every view of the\nblockchain, whether you're getting it through compact block filters, an electrum server or something\nwacky like a utreexo bridge will have a concept of blocks and transactions in them. For a wallet we\nonly need a very sparse view of the blockchain that includes at which block a set of transactions\nexisted. That way, if a block disappears we know that all those transactions might disappear too.")]),t._v(" "),e("p",[t._v("With "),e("code",[t._v("bdk_core")]),t._v(" I want to introduce the concept of a "),e("em",[t._v("checkpoint")]),t._v(", which is a block height and hash and\na set of txids that were present at that height "),e("strong",[t._v("but not present in the previous checkpoint")]),t._v(". In\nthis way we create an append-only data structure that can easily be rolled back to a previous height\nif there is a reorg. After rolling back we can then roll forward and apply the new blocks.")]),t._v(" "),e("p",[t._v("Here's an example of how this idea works:")]),t._v(" "),e("figure",[e("img",{attrs:{src:a(351),alt:""}})]),t._v(" "),e("p",[t._v("There are a few edge cases I'd like to cover:")]),t._v(" "),e("ol",[e("li",[t._v("What if when gathering new data from the chain to update a "),e("code",[t._v("DescriptorTracker")]),t._v(" we find an old transaction that belongs to an earlier checkpoint that we had missed form our earlier syncs?")]),t._v(" "),e("li",[t._v("What if when we go to write to persistent storage from a "),e("code",[t._v("DescriptorTracker")]),t._v(" we find that it has some transactions the tracker doesn't? Should we try and reconcile the two sets of transactions?")])]),t._v(" "),e("p",[t._v("I think the correct approach is to treat the chain data as the source of truth for the\n"),e("code",[t._v("DescriptorTracker")]),t._v(" and the "),e("code",[t._v("DescriptorTracker")]),t._v(" as the source of truth for persistent storage. That\nis in the case of (1) we should just rollback the "),e("code",[t._v("DescriptorTracker")]),t._v(" and insert the old but\nrecently discovered transaction in the right place. In the case of (2) we should roll back the\npersistent storage to the point where it differs and apply changes from there. This implies that you\nshould only keep one instance of a "),e("code",[t._v("DescriptorTracker")]),t._v(" for a descriptor in your application and only\nupdate persistent storage by first applying the changes to the tracker.")]),t._v(" "),e("h2",{attrs:{id:"examples"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[t._v("#")]),t._v(" Examples")]),t._v(" "),e("p",[t._v("Here are some examples of what I think this may end up looking like in code. Keep in mind that if\nthis looks complicated it will probably be more complicated in practice! This doesn't mean that we\ncan't create simplifying abstractions and tools around these primitives to cover common policies. I hope we can implement "),e("code",[t._v("Wallet")]),t._v(" with "),e("code",[t._v("DescriptorTracker")]),t._v("s internally.")]),t._v(" "),e("h3",{attrs:{id:"doing-an-initial-sync-of-a-descriptor-that-may-already-contain-coins"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#doing-an-initial-sync-of-a-descriptor-that-may-already-contain-coins"}},[t._v("#")]),t._v(" Doing an initial sync of a descriptor that may already contain coins")]),t._v(" "),e("p",[t._v("When we first sync a descriptor that may already contain coins we want to iterate over all the\nscripts of the wallet and then stop if there's a big enough gap (e.g. 20). In this example we use an\nstateless "),e("a",{attrs:{href:"https://mempool.space/docs/api/rest",target:"_blank",rel:"noopener noreferrer"}},[t._v("esplora-like API"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a descriptor tracker the external addresses of a BIP86 key")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tracker "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTracker")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"tr([73c5da0a/86'/0'/0']xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*)\"")]),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("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" esplora "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),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("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("fetch_related_transactions")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),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("// iterate over all addresses in a descriptor")]),t._v("\n scripts"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter_scripts")]),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 punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// stop if you find a gap of 20 unused addresses")]),t._v("\n stop_gap"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),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("..")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Default")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),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("}")]),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 keyword"}},[t._v("await")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\ntracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("update"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// now we want to persist this disk")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" db_update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n start_checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),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(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Note that the db_update type is the same as the `update` above.")]),t._v("\nmy_db"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("db_update"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"doing-a-sync-of-a-wallet-after-you-already-have-syncd"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#doing-a-sync-of-a-wallet-after-you-already-have-syncd"}},[t._v("#")]),t._v(" Doing a sync of a wallet after you already have sync'd")]),t._v(" "),e("p",[t._v("Now imagine you just want to check if any UTXOs in your wallet have been spent. In this case we've\nalready sync'd before so we need to load that data into the tracker from disk first (rather than\ngoing straight to the blockchain). Then we just ask esplora for transactions related to these\ntransaction outputs.")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a descriptor tracker the external addresses of a BIP86 key")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tracker "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTracker")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"tr([73c5da0a/86'/0'/0']xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*)\"")]),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("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" init_update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" my_db"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),t._v("\n"),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("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// get up to speed with what was on disk.")]),t._v("\ntracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("init_update"),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 comment"}},[t._v("// get the latest checkpoint")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" checkpoint "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_checkpoint")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),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("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" esplora "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),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("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fetch transactions spending any utxos we have")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("fetch_related_transactions")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n tx_outs"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter_unspent")]),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 punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Default")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),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("}")]),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 keyword"}},[t._v("await")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" update "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ok")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("update"),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 punctuation"}},[t._v("{")]),t._v("\n tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("update"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[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("// now we want to persist this disk")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" db_update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),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("// this call could fail if tracker no longer has this checkpoint.")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// In this case we'd ask persistent_storage for an earlier checkpoint and try again.")]),t._v("\n start_checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" persistent_storage"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_checkpoint")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),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("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n persistent_storage"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("db_update"),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 class-name"}},[t._v("Err")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Error")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StaleCheckpoint")]),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 punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// here we should call fetch related transactions with an earlier checkpoint.")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// In practice this logic will be called in a loop")]),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("h3",{attrs:{id:"updating-state-when-you-get-the-data-in-real-time"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#updating-state-when-you-get-the-data-in-real-time"}},[t._v("#")]),t._v(" Updating state when you get the data in real time")]),t._v(" "),e("p",[t._v("If you have an event based view of the blockchain that feeds you block connected or block\ndisconnected events then I imagine the API would look something like this.\nThere's quite a bit left out here but I hope you get the idea.")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a descriptor tracker the external addresses of a BIP86 key")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tracker "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTracker")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"tr([73c5da0a/86'/0'/0']xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*)\"")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain_events "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* get a Stream of blockchain block connected/disconnected events */")]),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\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("loop")]),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("let")]),t._v(" blockchain_event "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" blockchain_events"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("next")]),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 keyword"}},[t._v("await")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" blockchain_event "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BlockChainEvent")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Connected")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("new_block"),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 punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_block")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("new_block"),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 punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ok")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("modified"),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 keyword"}},[t._v("if")]),t._v(" modified "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// update persistent storage from tracker")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Err")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApplyBlockError")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("OutOfOrder")]),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 punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the block event we got was not the next block we expected.")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// How to recover from this will depend on the application and block source")]),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("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BlockchainEvent")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Disconnected")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("disconnected_height"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" disconnected_hash"),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 punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// this might invalidate a checkpoint")]),t._v("\n tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("disconnect_block")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("disconnected_height"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" disconnected_hash"),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 comment"}},[t._v("// Now apply to persistent storage")]),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 punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),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/100",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=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{350:function(t,e,a){t.exports=a.p+"assets/img/descriptor-tracker.5942c853.jpg"},351:function(t,e,a){t.exports=a.p+"assets/img/checkpoints.a4179787.jpg"},404: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("p",[t._v("The Bitcoin Devkit (BDK) lets you do a lot of useful things through convenient high level\nabstractions. It works great when these abstractions map nicely onto what you are trying to do. My\ngoal is to develop a new "),e("code",[t._v("bdk_core")]),t._v(" library for when they don't. I want "),e("code",[t._v("bdk_core")]),t._v(" to expose all the\nuseful "),e("em",[t._v("mechanisms")]),t._v(" that BDK has inside it without them being tied to any particular usage "),e("em",[t._v("policy")]),t._v("\nand with very minimal dependencies.")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("bdk_core")]),t._v(' idea is still "in the lab". We\'re not sure yet whether '),e("code",[t._v("bdk_core")]),t._v(" will just be what's\nleft of "),e("code",[t._v("bdk")]),t._v(" once we spin off all the components that have extra dependencies into their own crates\nand refine it a bit. In that case "),e("code",[t._v("bdk_core")]),t._v(" will just be called "),e("code",[t._v("bdk v1.0.0")]),t._v(" or something. Or it might\nbe that "),e("code",[t._v("bdk")]),t._v(" lives on with its current APIs and uses stuff "),e("code",[t._v("bdk_core")]),t._v(" to implement it internally.")]),t._v(" "),e("h2",{attrs:{id:"the-separation-of-policy-and-mechanism"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#the-separation-of-policy-and-mechanism"}},[t._v("#")]),t._v(" The separation of policy and mechanism")]),t._v(" "),e("p",[t._v("My guiding principle for "),e("code",[t._v("bdk_core")]),t._v(" is the "),e("em",[t._v("separation of policy and mechanism")]),t._v(". This is\nwhat I mean by these terms:")]),t._v(" "),e("ul",[e("li",[e("em",[t._v("mechanism")]),t._v(": How you do a particular thing. Mechanism code is functional and doesn't change much.")]),t._v(" "),e("li",[e("em",[t._v("policy")]),t._v(": What you want to do. Policy code composes mechanisms to achieve something in\nan application.")])]),t._v(" "),e("p",[t._v("Here's a nice passage about why the designers of the "),e("a",{attrs:{href:"https://en.wikipedia.org/wiki/X_Window_System",target:"_blank",rel:"noopener noreferrer"}},[t._v("X window system"),e("OutboundLink")],1),t._v(" applied this principle. X has\nbeen around since 1984 and doesn't look like it's going anywhere so it probably has a lot to teach us.\nFrom "),e("em",[e("a",{attrs:{href:"https://en.wikipedia.org/wiki/The_Art_of_Unix_Programming",target:"_blank",rel:"noopener noreferrer"}},[t._v("The Art of UNIX Programming"),e("OutboundLink")],1)]),t._v(":")]),t._v(" "),e("blockquote",[e("p",[t._v("...we observed that the designers of X made a basic decision to implement “mechanism, not policy”—to\nmake X a generic graphics engine and leave decisions about user-interface style to toolkits and\nother levels of the system. We justified this by pointing out that policy and mechanism tend to\nmutate on different timescales, with policy changing much faster than mechanism. Fashions in the\nlook and feel of GUI toolkits may come and go, but raster operations and compositing are forever.")])]),t._v(" "),e("blockquote",[e("p",[t._v("Thus, hardwiring policy and mechanism together has two bad effects: It makes policy rigid and\nharder to change in response to user requirements, and it means that trying to change policy has a\nstrong tendency to destabilize the mechanisms.")])]),t._v(" "),e("blockquote",[e("p",[t._v("On the other hand, by separating the two we make it\npossible to experiment with new policy without breaking mechanisms. We also make it much easier to\nwrite good tests for the mechanism (policy, because it ages so quickly, often does not justify the\ninvestment).")])]),t._v(" "),e("ul",[e("li",[t._v("[ ] > This design rule has wide application outside the GUI context. In general, it implies that we")])]),t._v(" "),e("blockquote",[e("p",[t._v("should look for ways to separate interfaces from engines.")])]),t._v(" "),e("p",[t._v("You'll notice we have a similar situation in Bitcoin engineering. We have mechanism code like\nsigning algorithms, key derivation, transaction construction logic, etc., that don't change much. But\nhow these compose together in applications changes quickly over time and between applications.")]),t._v(" "),e("p",[t._v("The main culprit of policy and mechanism conflation in "),e("code",[t._v("bdk")]),t._v(" is the main "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/struct.Wallet.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("Wallet")]),e("OutboundLink")],1),t._v(" type.\nWallets do all of the following:")]),t._v(" "),e("ol",[e("li",[t._v("Store one or two descriptors (external and optional internal).")]),t._v(" "),e("li",[t._v("Keep track of which addresses you've given out so you only give out fresh ones from each descriptor.")]),t._v(" "),e("li",[t._v("Keep a list of transactions associated with the addresses in the wallet.")]),t._v(" "),e("li",[t._v("Given a source of blockchain data it can update its internal list of transactions.")]),t._v(" "),e("li",[t._v("Given some parameters it can build a PSBT from transaction outputs.")]),t._v(" "),e("li",[t._v("Given a PSBT it can sign it with its "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/signer/index.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("Signers")]),e("OutboundLink")],1),t._v(".")])]),t._v(" "),e("p",[t._v("All of that is very useful but it is bound together with the particular policies and opinions of "),e("code",[t._v("Wallet")]),t._v(".\nIf "),e("code",[t._v("Wallet")]),t._v("'s policy is not your policy it's going to be tricky to get it to do what you want.\nHere are some examples:")]),t._v(" "),e("ol",[e("li",[t._v("In order to control how the "),e("code",[t._v("Wallet")]),t._v(" will select coins for a transaction internally you have to\npass in something implementing the "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("CoinSelectionAlgorithm")]),e("OutboundLink")],1),t._v(" trait. A coin selection algorithm\nis clearly mechanism code but the policy of "),e("code",[t._v("Wallet")]),t._v(" restricts that mechanism's interface. We\nhave "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/281",target:"_blank",rel:"noopener noreferrer"}},[t._v("very old issues"),e("OutboundLink")],1),t._v(" related to what the\ninterface of this trait should be and we don't have a clear way forward. In "),e("code",[t._v("bdk_core")]),t._v(" I want to\npurely provide the coin selection mechanisms for figuring out whether you need to select more\nUTXOs or whether you need a change output etc. How you use that mechanism will be up to you.")]),t._v(" "),e("li",[t._v("Another trait that has a similar structure is the "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/signer/index.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("Signer")]),e("OutboundLink")],1),t._v(" trait. You have to pass in signers\nso your wallet can sign PSBTs but you have little control over how the wallet chooses which\nsigners to use in any given situation. Right now the wallet will just iterate through all the\nsigners and ask them to sign. This is not always appropriate. In "),e("code",[t._v("bdk_core")]),t._v(" I want to provide\nfunctions for populating PSBTs given something that can sign. You'll be in control of when they\nget called.")])]),t._v(" "),e("h2",{attrs:{id:"a-syncing-mechansim-without-the-policy"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#a-syncing-mechansim-without-the-policy"}},[t._v("#")]),t._v(" A syncing mechansim without the policy")]),t._v(" "),e("p",[t._v("Syncing in "),e("code",[t._v("bdk")]),t._v(" is the place where the design of "),e("code",[t._v("Wallet")]),t._v(" is most restrictive. The "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/blockchain/trait.WalletSync.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("WalletSync")]),e("OutboundLink")],1),t._v("\ntrait forces you to sync all addresses in a wallet in one big batch. But this is not always what you\nwant to do. I spoke to a developer who wanted to sync his wallet slowly over time with each address\nbeing queried over a different Tor connection. It would be really difficult to implement\n"),e("code",[t._v("WalletSync")]),t._v(" with such a strategy. Another example where "),e("code",[t._v("WalletSync")]),t._v(" isn't the right fit is the\n"),e("a",{attrs:{href:"https://l2.technology/sensei",target:"_blank",rel:"noopener noreferrer"}},[t._v("Sensei"),e("OutboundLink")],1),t._v(" project which uses BDK but incrementally updates the database whenever new information\ncomes in from the blockchain.")]),t._v(" "),e("p",[t._v("Even if syncing all addresses at the same time is roughly what you want to do "),e("code",[t._v("WalletSync")]),t._v(" still\ngets in the way since it defines whether you do it synchronously or asynchrononusly. Applications\ncan control this through "),e("code",[t._v("bdk")]),t._v("'s "),e("code",[t._v("async-interface")]),t._v(" feature flag which internally changes the trait\ndefinition through macros. Another annoyance is that when using "),e("code",[t._v("async-interface")]),t._v(" the future that\ngets returned from "),e("code",[t._v("WalletSync")]),t._v(" "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/165",target:"_blank",rel:"noopener noreferrer"}},[t._v("cannot be "),e("code",[t._v("Send")]),e("OutboundLink")],1),t._v("\nbecause of how "),e("code",[t._v("Wallet")]),t._v(" handles database mutability internally, meaning you can't spawn the future\ninto a new thread.")]),t._v(" "),e("h3",{attrs:{id:"a-general-syncing-mechanism"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#a-general-syncing-mechanism"}},[t._v("#")]),t._v(" A general syncing mechanism")]),t._v(" "),e("p",[t._v("So what is the most general syncing mechanism that solves these problems? These are the things I\nthink it has to do regardless of where the blockchain data comes from or how it's stored:")]),t._v(" "),e("ol",[e("li",[t._v("Generate and store addresses.")]),t._v(" "),e("li",[t._v("Index transaction data, e.g. transaction outputs we own, when/if they were spent, etc.")]),t._v(" "),e("li",[t._v("Keep track of which addresses have been given out and which have been used.")]),t._v(" "),e("li",[t._v('Be able to "roll back" our view of the above data if a reorg makes some of it stale.')]),t._v(" "),e("li",[t._v("Keep track of transactions related our addresses in our mempool.")])]),t._v(" "),e("p",[t._v("Let's talk about how to implement a mechanism that does all that.")]),t._v(" "),e("h3",{attrs:{id:"how-to-store-and-index-transactions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#how-to-store-and-index-transactions"}},[t._v("#")]),t._v(" How to store and index transactions")]),t._v(" "),e("p",[t._v("Different persistent storage backends have different APIs and their own indexing strategies. That's\nwhy the "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/database/trait.Database.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("Database")]),e("OutboundLink")],1),t._v(" trait exists in BDK, to make a clean API to the different storage engines. It's\nimportant to note that the database in BDK only holds public data that could always be retrieved\nfrom the chain. It's just a cache. Despite this we support different backends. Right now it is a\nlot of work to add a new index to the data since you have to add it to every backend and you might have\nto apply schema changes (we still "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/359",target:"_blank",rel:"noopener noreferrer"}},[t._v("don't have a standard approach to\nthis"),e("OutboundLink")],1),t._v(").")]),t._v(" "),e("p",[t._v("Thomas Eizinger "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/165#issuecomment-1047483895",target:"_blank",rel:"noopener noreferrer"}},[t._v("suggested"),e("OutboundLink")],1),t._v("\ndoing everything in memory and only writing to persistent storage when it was convenient. It took me\nsome time but I came around to this idea. It would allow us to get rid of the "),e("code",[t._v("Database")]),t._v(" trait (at\nleast at the "),e("code",[t._v("bdk_core")]),t._v(" level) and greatly simplify what the persistent storage layer has to do.\nWhenever the data is loaded from persistent storage we can just do the indexing in memory and\npresent it to the application.")]),t._v(" "),e("p",[e("em",[t._v("But wait! Wouldn't this mean we'd use way more memory than we need to?")]),t._v(" Yes but memory is cheap.\nConsider that if we say the average transaction size is 300 bytes then with all our indexes each\ntransaction might cost 1kb of memory (pessimistically). This means we could index one thousand\ntransactions in a single megabyte! My iPhone has 4gb of memory so it could index a million\ntransactions with plenty of memory to spare. "),e("em",[t._v("But what if some users can't afford an iPhone?")]),t._v(" Then\nthey also couldn't have afforded to have made a million Bitcoin transactions! "),e("em",[t._v("But what about memory\nconstrained devices like hardware wallets!?")]),t._v(" Those devices typically don't store and retrieve\ntransactions. They're usually just signing devices. Perhaps one day someone will build a memory\nconstrained device that needs to do this work but until then I think this is a fine approach to\ntake.")]),t._v(" "),e("p",[t._v("For now I'm calling this thing that does the in-memory indexing of transactions related to a single\ndescriptor a "),e("code",[t._v("DescriptorTracker")]),t._v(". Here's a diagram that communicates how I imagine it relates to the\nother components.")]),t._v(" "),e("figure",[e("img",{attrs:{src:a(350),alt:""}})]),t._v(" "),e("h3",{attrs:{id:"rolling-back-rolling-forward-and-syncing-to-disk"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#rolling-back-rolling-forward-and-syncing-to-disk"}},[t._v("#")]),t._v(" Rolling back, rolling forward and syncing to disk")]),t._v(" "),e("p",[t._v("State changes in blockchains are clearly delineated. They all happen in blocks! Every view of the\nblockchain, whether you're getting it through compact block filters, an electrum server or something\nwacky like a utreexo bridge will have a concept of blocks and transactions in them. For a wallet we\nonly need a very sparse view of the blockchain that includes at which block a set of transactions\nexisted. That way, if a block disappears we know that all those transactions might disappear too.")]),t._v(" "),e("p",[t._v("With "),e("code",[t._v("bdk_core")]),t._v(" I want to introduce the concept of a "),e("em",[t._v("checkpoint")]),t._v(", which is a block height and hash and\na set of txids that were present at that height "),e("strong",[t._v("but not present in the previous checkpoint")]),t._v(". In\nthis way we create an append-only data structure that can easily be rolled back to a previous height\nif there is a reorg. After rolling back we can then roll forward and apply the new blocks.")]),t._v(" "),e("p",[t._v("Here's an example of how this idea works:")]),t._v(" "),e("figure",[e("img",{attrs:{src:a(351),alt:""}})]),t._v(" "),e("p",[t._v("There are a few edge cases I'd like to cover:")]),t._v(" "),e("ol",[e("li",[t._v("What if when gathering new data from the chain to update a "),e("code",[t._v("DescriptorTracker")]),t._v(" we find an old transaction that belongs to an earlier checkpoint that we had missed form our earlier syncs?")]),t._v(" "),e("li",[t._v("What if when we go to write to persistent storage from a "),e("code",[t._v("DescriptorTracker")]),t._v(" we find that it has some transactions the tracker doesn't? Should we try and reconcile the two sets of transactions?")])]),t._v(" "),e("p",[t._v("I think the correct approach is to treat the chain data as the source of truth for the\n"),e("code",[t._v("DescriptorTracker")]),t._v(" and the "),e("code",[t._v("DescriptorTracker")]),t._v(" as the source of truth for persistent storage. That\nis in the case of (1) we should just rollback the "),e("code",[t._v("DescriptorTracker")]),t._v(" and insert the old but\nrecently discovered transaction in the right place. In the case of (2) we should roll back the\npersistent storage to the point where it differs and apply changes from there. This implies that you\nshould only keep one instance of a "),e("code",[t._v("DescriptorTracker")]),t._v(" for a descriptor in your application and only\nupdate persistent storage by first applying the changes to the tracker.")]),t._v(" "),e("h2",{attrs:{id:"examples"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[t._v("#")]),t._v(" Examples")]),t._v(" "),e("p",[t._v("Here are some examples of what I think this may end up looking like in code. Keep in mind that if\nthis looks complicated it will probably be more complicated in practice! This doesn't mean that we\ncan't create simplifying abstractions and tools around these primitives to cover common policies. I hope we can implement "),e("code",[t._v("Wallet")]),t._v(" with "),e("code",[t._v("DescriptorTracker")]),t._v("s internally.")]),t._v(" "),e("h3",{attrs:{id:"doing-an-initial-sync-of-a-descriptor-that-may-already-contain-coins"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#doing-an-initial-sync-of-a-descriptor-that-may-already-contain-coins"}},[t._v("#")]),t._v(" Doing an initial sync of a descriptor that may already contain coins")]),t._v(" "),e("p",[t._v("When we first sync a descriptor that may already contain coins we want to iterate over all the\nscripts of the wallet and then stop if there's a big enough gap (e.g. 20). In this example we use an\nstateless "),e("a",{attrs:{href:"https://mempool.space/docs/api/rest",target:"_blank",rel:"noopener noreferrer"}},[t._v("esplora-like API"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a descriptor tracker the external addresses of a BIP86 key")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tracker "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTracker")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"tr([73c5da0a/86'/0'/0']xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*)\"")]),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("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" esplora "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),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("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("fetch_related_transactions")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),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("// iterate over all addresses in a descriptor")]),t._v("\n scripts"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter_scripts")]),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 punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// stop if you find a gap of 20 unused addresses")]),t._v("\n stop_gap"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),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("..")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Default")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),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("}")]),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 keyword"}},[t._v("await")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\ntracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("update"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// now we want to persist this disk")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" db_update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n start_checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),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(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Note that the db_update type is the same as the `update` above.")]),t._v("\nmy_db"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("db_update"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"doing-a-sync-of-a-wallet-after-you-already-have-syncd"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#doing-a-sync-of-a-wallet-after-you-already-have-syncd"}},[t._v("#")]),t._v(" Doing a sync of a wallet after you already have sync'd")]),t._v(" "),e("p",[t._v("Now imagine you just want to check if any UTXOs in your wallet have been spent. In this case we've\nalready sync'd before so we need to load that data into the tracker from disk first (rather than\ngoing straight to the blockchain). Then we just ask esplora for transactions related to these\ntransaction outputs.")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a descriptor tracker the external addresses of a BIP86 key")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tracker "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTracker")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"tr([73c5da0a/86'/0'/0']xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*)\"")]),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("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" init_update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" my_db"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),t._v("\n"),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("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// get up to speed with what was on disk.")]),t._v("\ntracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("init_update"),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 comment"}},[t._v("// get the latest checkpoint")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" checkpoint "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_checkpoint")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),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("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" esplora "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),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("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fetch transactions spending any utxos we have")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("fetch_related_transactions")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n tx_outs"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter_unspent")]),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 punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Default")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),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("}")]),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 keyword"}},[t._v("await")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" update "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ok")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("update"),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 punctuation"}},[t._v("{")]),t._v("\n tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("update"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[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("// now we want to persist this disk")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" db_update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),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("// this call could fail if tracker no longer has this checkpoint.")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// In this case we'd ask persistent_storage for an earlier checkpoint and try again.")]),t._v("\n start_checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" persistent_storage"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_checkpoint")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),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("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n persistent_storage"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("db_update"),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 class-name"}},[t._v("Err")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Error")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StaleCheckpoint")]),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 punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// here we should call fetch related transactions with an earlier checkpoint.")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// In practice this logic will be called in a loop")]),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("h3",{attrs:{id:"updating-state-when-you-get-the-data-in-real-time"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#updating-state-when-you-get-the-data-in-real-time"}},[t._v("#")]),t._v(" Updating state when you get the data in real time")]),t._v(" "),e("p",[t._v("If you have an event based view of the blockchain that feeds you block connected or block\ndisconnected events then I imagine the API would look something like this.\nThere's quite a bit left out here but I hope you get the idea.")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a descriptor tracker the external addresses of a BIP86 key")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tracker "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTracker")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"tr([73c5da0a/86'/0'/0']xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*)\"")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain_events "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* get a Stream of blockchain block connected/disconnected events */")]),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\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("loop")]),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("let")]),t._v(" blockchain_event "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" blockchain_events"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("next")]),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 keyword"}},[t._v("await")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" blockchain_event "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BlockChainEvent")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Connected")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("new_block"),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 punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_block")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("new_block"),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 punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ok")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("modified"),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 keyword"}},[t._v("if")]),t._v(" modified "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// update persistent storage from tracker")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Err")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApplyBlockError")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("OutOfOrder")]),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 punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the block event we got was not the next block we expected.")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// How to recover from this will depend on the application and block source")]),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("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BlockchainEvent")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Disconnected")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("disconnected_height"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" disconnected_hash"),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 punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// this might invalidate a checkpoint")]),t._v("\n tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("disconnect_block")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("disconnected_height"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" disconnected_hash"),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 comment"}},[t._v("// Now apply to persistent storage")]),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 punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),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/100",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=n.exports}}]); \ No newline at end of file diff --git a/assets/js/35.e3cc4111.js b/assets/js/35.c77abd8d.js similarity index 98% rename from assets/js/35.e3cc4111.js rename to assets/js/35.c77abd8d.js index c486397194..d9b4823b6b 100644 --- a/assets/js/35.e3cc4111.js +++ b/assets/js/35.c77abd8d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{318:function(t,a,s){},377:function(t,a,s){"use strict";s(318)},437:function(t,a,s){"use strict";s.r(a);s(377);var e=s(7),i=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"all"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#all"}},[t._v("#")]),t._v(" All")]),t._v(" "),a("p",[t._v("Explore the ecosystem of projects that are built with the BDK family of libraries.")]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://bitkey.build/",target:"_blank"}},[a("img",{staticStyle:{"max-height":"130px"},attrs:{src:"/img/case-studies-logos/block-logo.gif"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h2",[a("a",{attrs:{href:"https://bitkey.build/",target:"_blank"}},[t._v("Bitkey")])]),t._v(" "),a("p",[t._v("\n Bitkey is the safe, easy way to own and manage bitcoin. It’s a mobile app, hardware device, and a set of recovery tools, for simple, secure self-custody.\n ")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/peach-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h2",[a("a",{attrs:{href:"https://peachbitcoin.com/",target:"_blank"}},[t._v("Peach Bitcoin")])]),t._v(" "),a("p",[t._v("Connecting Bitcoin buyers and sellers directly together. Buy or sell bitcoin peer-to-peer anywhere, at anytime.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.anchorwatch.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/anchorwatch-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.anchorwatch.com/",target:"_blank"}},[t._v("AnchorWatch")])]),t._v(" "),a("p",[t._v("Protect your bitcoin with regulated insurance and enterprise-grade multi-institutional custody.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.mutinywallet.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/mutiny-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.mutinywallet.com/",target:"_blank"}},[t._v("Mutiny Wallet")])]),t._v(" "),a("p",[t._v("Mutiny is a self-custodial lightning wallet that runs in the browser.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://foundationdevices.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/foundation-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://foundationdevices.com/",target:"_blank"}},[t._v("Envoy By Foundation")])]),t._v(" "),a("p",[t._v("A Bitcoin wallet with powerful account management and privacy features. Use alongside your Passport hardware wallet to take true ownership of your Bitcoin.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://mempool.space/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/mempool-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://mempool.space/",target:"_blank"}},[t._v("mempool.space")])]),t._v(" "),a("p",[t._v("Explore the full Bitcoin ecosystem.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.caravanmultisig.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/caravan-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.caravanmultisig.com/#/",target:"_blank"}},[t._v("Caravan")])]),t._v(" "),a("p",[t._v("Caravan is a multi-sig coordinator application, and an Unchained-sponsored open source project.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.bullbitcoin.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/bull-bitcoin-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.bullbitcoin.com/",target:"_blank"}},[t._v("Bull Bitcoin")])]),t._v(" "),a("p",[t._v("A self-custodial Bitcoin Wallet and Exchange app that lets users buy, sell, spend and get paid with Bitcoin. Bitcoins are automatically sent from the exchange to the user's wallet.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.lava.xyz/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lava-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.lava.xyz/",target:"_blank"}},[t._v("Lava")])]),t._v(" "),a("p",[t._v("The Future of Finance Available Today. Functional, safe and simple.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/lightningdevkit/ldk-node",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/ldk-node-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/lightningdevkit/ldk-node",target:"_blank"}},[t._v("LDK Node")])]),t._v(" "),a("p",[t._v("A ready-to-go Lightning node library built using LDK and BDK.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.goldenraven.padawanwallet",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/padawan-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.goldenraven.padawanwallet",target:"_blank"}},[t._v("Padawan Wallet")])]),t._v(" "),a("p",[t._v("Padawan is a testnet-only bitcoin wallet packed with tutorials to learn how to use bitcoin on mobile.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.seba.swiss/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/seba-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.seba.swiss/",target:"_blank"}},[t._v("Seba Bank")])]),t._v(" "),a("p",[t._v("From everyday banking to crypto custody and trading, get the most out of your assets with a regulated global crypto bank.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://bitmask.app/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/bitmask-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://bitmask.app/",target:"_blank"}},[t._v("BitMask Wallet")])]),t._v(" "),a("p",[t._v("Your Gateway to DeepWeb3 on Bitcoin. A browser extension for decentralized applications on Bitcoin.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.smartvaults.io/",target:"_blank"}},[a("img",{staticStyle:{"max-height":"130px"},attrs:{src:"/img/case-studies-logos/smart-vaults-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.smartvaults.io/",target:"_blank"}},[t._v("Smart Vaults")])]),t._v(" "),a("p",[t._v("Determine who, how, and when your Bitcoin can be accessed.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://galoy.io/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/galoy-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://galoy.io/",target:"_blank"}},[t._v("Galoy")])]),t._v(" "),a("p",[t._v("Bitcoin-native banking infrastructure for organizations.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.iriswallet.testnet",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/iris-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.iriswallet.testnet",target:"_blank"}},[t._v("Iris Wallet")])]),t._v(" "),a("p",[t._v("Open-source wallet for Bitcoin and RGB assets.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/spotbit-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank"}},[t._v("Spotbit")])]),t._v(" "),a("p",[t._v("Spotbit is a portable API for Bitcoin price data and candles.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/StackmateNetwork",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/stackmate-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/StackmateNetwork",target:"_blank"}},[t._v("Stackmate")])]),t._v(" "),a("p",[t._v("A multi-purpose Bitcoin Wallet.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://lipa.swiss/en",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lipa-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://lipa.swiss/en",target:"_blank"}},[t._v("Lipa")])]),t._v(" "),a("p",[t._v("The Swiss app for cashless payments with Bitcoin.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://lexe.app/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lexe-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://lexe.app/",target:"_blank"}},[t._v("Lexe Wallet")])]),t._v(" "),a("p",[t._v("Lexe is a self-custodial Bitcoin and Lightning wallet that can receive payments 24/7.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://10101.finance/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/10101-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://10101.finance/",target:"_blank"}},[t._v("10101")])]),t._v(" "),a("p",[t._v("Decentralised finance. For real. BTC trading without counterparty risk in one easy and fast app.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://wizardsardine.com/liana/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/liana-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://wizardsardine.com/liana/",target:"_blank"}},[t._v("Liana")])]),t._v(" "),a("p",[t._v("Never lose your coins. Liana is a simple Bitcoin wallet with built-in loss protection and inheritance.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/utreexo/utreexod",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/utreexod-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/utreexo/utreexod",target:"_blank"}},[t._v("utreexod")])]),t._v(" "),a("p",[t._v("A fully validating Bitcoin node with Utreexo support.")])])]),t._v(" "),a("a",{staticClass:"nav-link external action-button",attrs:{href:"https://github.com/orgs/bitcoindevkit/discussions/64",target:"_blank",rel:"noopener noreferrer"}},[t._v("\n Add your project\n "),a("span",[a("svg",{staticClass:"icon outbound",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"}},[a("path",{attrs:{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}}),t._v(" "),a("polygon",{attrs:{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"}})]),t._v(" "),a("span",{staticClass:"sr-only"},[t._v("(opens new window)")])])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{317:function(t,a,s){},376:function(t,a,s){"use strict";s(317)},435:function(t,a,s){"use strict";s.r(a);s(376);var e=s(7),i=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"all"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#all"}},[t._v("#")]),t._v(" All")]),t._v(" "),a("p",[t._v("Explore the ecosystem of projects that are built with the BDK family of libraries.")]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://bitkey.build/",target:"_blank"}},[a("img",{staticStyle:{"max-height":"130px"},attrs:{src:"/img/case-studies-logos/block-logo.gif"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h2",[a("a",{attrs:{href:"https://bitkey.build/",target:"_blank"}},[t._v("Bitkey")])]),t._v(" "),a("p",[t._v("\n Bitkey is the safe, easy way to own and manage bitcoin. It’s a mobile app, hardware device, and a set of recovery tools, for simple, secure self-custody.\n ")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/peach-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h2",[a("a",{attrs:{href:"https://peachbitcoin.com/",target:"_blank"}},[t._v("Peach Bitcoin")])]),t._v(" "),a("p",[t._v("Connecting Bitcoin buyers and sellers directly together. Buy or sell bitcoin peer-to-peer anywhere, at anytime.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.anchorwatch.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/anchorwatch-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.anchorwatch.com/",target:"_blank"}},[t._v("AnchorWatch")])]),t._v(" "),a("p",[t._v("Protect your bitcoin with regulated insurance and enterprise-grade multi-institutional custody.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.mutinywallet.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/mutiny-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.mutinywallet.com/",target:"_blank"}},[t._v("Mutiny Wallet")])]),t._v(" "),a("p",[t._v("Mutiny is a self-custodial lightning wallet that runs in the browser.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://foundationdevices.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/foundation-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://foundationdevices.com/",target:"_blank"}},[t._v("Envoy By Foundation")])]),t._v(" "),a("p",[t._v("A Bitcoin wallet with powerful account management and privacy features. Use alongside your Passport hardware wallet to take true ownership of your Bitcoin.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://mempool.space/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/mempool-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://mempool.space/",target:"_blank"}},[t._v("mempool.space")])]),t._v(" "),a("p",[t._v("Explore the full Bitcoin ecosystem.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.caravanmultisig.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/caravan-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.caravanmultisig.com/#/",target:"_blank"}},[t._v("Caravan")])]),t._v(" "),a("p",[t._v("Caravan is a multi-sig coordinator application, and an Unchained-sponsored open source project.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.bullbitcoin.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/bull-bitcoin-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.bullbitcoin.com/",target:"_blank"}},[t._v("Bull Bitcoin")])]),t._v(" "),a("p",[t._v("A self-custodial Bitcoin Wallet and Exchange app that lets users buy, sell, spend and get paid with Bitcoin. Bitcoins are automatically sent from the exchange to the user's wallet.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.lava.xyz/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lava-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.lava.xyz/",target:"_blank"}},[t._v("Lava")])]),t._v(" "),a("p",[t._v("The Future of Finance Available Today. Functional, safe and simple.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/lightningdevkit/ldk-node",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/ldk-node-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/lightningdevkit/ldk-node",target:"_blank"}},[t._v("LDK Node")])]),t._v(" "),a("p",[t._v("A ready-to-go Lightning node library built using LDK and BDK.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.goldenraven.padawanwallet",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/padawan-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.goldenraven.padawanwallet",target:"_blank"}},[t._v("Padawan Wallet")])]),t._v(" "),a("p",[t._v("Padawan is a testnet-only bitcoin wallet packed with tutorials to learn how to use bitcoin on mobile.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.seba.swiss/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/seba-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.seba.swiss/",target:"_blank"}},[t._v("Seba Bank")])]),t._v(" "),a("p",[t._v("From everyday banking to crypto custody and trading, get the most out of your assets with a regulated global crypto bank.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://bitmask.app/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/bitmask-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://bitmask.app/",target:"_blank"}},[t._v("BitMask Wallet")])]),t._v(" "),a("p",[t._v("Your Gateway to DeepWeb3 on Bitcoin. A browser extension for decentralized applications on Bitcoin.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.smartvaults.io/",target:"_blank"}},[a("img",{staticStyle:{"max-height":"130px"},attrs:{src:"/img/case-studies-logos/smart-vaults-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.smartvaults.io/",target:"_blank"}},[t._v("Smart Vaults")])]),t._v(" "),a("p",[t._v("Determine who, how, and when your Bitcoin can be accessed.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://galoy.io/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/galoy-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://galoy.io/",target:"_blank"}},[t._v("Galoy")])]),t._v(" "),a("p",[t._v("Bitcoin-native banking infrastructure for organizations.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.iriswallet.testnet",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/iris-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.iriswallet.testnet",target:"_blank"}},[t._v("Iris Wallet")])]),t._v(" "),a("p",[t._v("Open-source wallet for Bitcoin and RGB assets.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/spotbit-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank"}},[t._v("Spotbit")])]),t._v(" "),a("p",[t._v("Spotbit is a portable API for Bitcoin price data and candles.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/StackmateNetwork",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/stackmate-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/StackmateNetwork",target:"_blank"}},[t._v("Stackmate")])]),t._v(" "),a("p",[t._v("A multi-purpose Bitcoin Wallet.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://lipa.swiss/en",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lipa-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://lipa.swiss/en",target:"_blank"}},[t._v("Lipa")])]),t._v(" "),a("p",[t._v("The Swiss app for cashless payments with Bitcoin.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://lexe.app/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lexe-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://lexe.app/",target:"_blank"}},[t._v("Lexe Wallet")])]),t._v(" "),a("p",[t._v("Lexe is a self-custodial Bitcoin and Lightning wallet that can receive payments 24/7.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://10101.finance/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/10101-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://10101.finance/",target:"_blank"}},[t._v("10101")])]),t._v(" "),a("p",[t._v("Decentralised finance. For real. BTC trading without counterparty risk in one easy and fast app.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://wizardsardine.com/liana/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/liana-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://wizardsardine.com/liana/",target:"_blank"}},[t._v("Liana")])]),t._v(" "),a("p",[t._v("Never lose your coins. Liana is a simple Bitcoin wallet with built-in loss protection and inheritance.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/utreexo/utreexod",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/utreexod-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/utreexo/utreexod",target:"_blank"}},[t._v("utreexod")])]),t._v(" "),a("p",[t._v("A fully validating Bitcoin node with Utreexo support.")])])]),t._v(" "),a("a",{staticClass:"nav-link external action-button",attrs:{href:"https://github.com/orgs/bitcoindevkit/discussions/64",target:"_blank",rel:"noopener noreferrer"}},[t._v("\n Add your project\n "),a("span",[a("svg",{staticClass:"icon outbound",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"}},[a("path",{attrs:{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}}),t._v(" "),a("polygon",{attrs:{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"}})]),t._v(" "),a("span",{staticClass:"sr-only"},[t._v("(opens new window)")])])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/36.fa4b2252.js b/assets/js/36.34830475.js similarity index 80% rename from assets/js/36.fa4b2252.js rename to assets/js/36.34830475.js index ec21a5f00e..cc2c8926f9 100644 --- a/assets/js/36.fa4b2252.js +++ b/assets/js/36.34830475.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{317:function(t,s,a){},376:function(t,s,a){"use strict";a(317)},436:function(t,s,a){"use strict";a.r(s);a(376);var i=a(7),e=Object(i.a)({},(function(){var t=this._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[t("h1",{attrs:{id:"custodial"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#custodial"}},[this._v("#")]),this._v(" Custodial")]),this._v(" "),t("div",{staticClass:"project"},[t("div",{staticClass:"project-logo"},[t("a",{attrs:{href:"https://www.seba.swiss/",target:"_blank"}},[t("img",{attrs:{src:"/img/case-studies-logos/seba-130.png"}})])]),this._v(" "),t("div",{staticClass:"tagline"},[t("h3",[t("a",{attrs:{href:"https://www.seba.swiss/",target:"_blank"}},[this._v("Seba Bank")])]),this._v(" "),t("p",[this._v("From everyday banking to crypto custody and trading, get the most out of your assets with a regulated global crypto bank.")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{318:function(t,s,a){},377:function(t,s,a){"use strict";a(318)},436:function(t,s,a){"use strict";a.r(s);a(377);var i=a(7),e=Object(i.a)({},(function(){var t=this._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[t("h1",{attrs:{id:"custodial"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#custodial"}},[this._v("#")]),this._v(" Custodial")]),this._v(" "),t("div",{staticClass:"project"},[t("div",{staticClass:"project-logo"},[t("a",{attrs:{href:"https://www.seba.swiss/",target:"_blank"}},[t("img",{attrs:{src:"/img/case-studies-logos/seba-130.png"}})])]),this._v(" "),t("div",{staticClass:"tagline"},[t("h3",[t("a",{attrs:{href:"https://www.seba.swiss/",target:"_blank"}},[this._v("Seba Bank")])]),this._v(" "),t("p",[this._v("From everyday banking to crypto custody and trading, get the most out of your assets with a regulated global crypto bank.")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/39.9b478629.js b/assets/js/39.c87916df.js similarity index 88% rename from assets/js/39.9b478629.js rename to assets/js/39.c87916df.js index f4c45a2759..8a61193d63 100644 --- a/assets/js/39.9b478629.js +++ b/assets/js/39.c87916df.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{321:function(t,a,s){},380:function(t,a,s){"use strict";s(321)},440:function(t,a,s){"use strict";s.r(a);s(380);var e=s(7),i=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"hardware"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#hardware"}},[t._v("#")]),t._v(" Hardware")]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://bitkey.build/",target:"_blank"}},[a("img",{staticStyle:{"max-height":"130px"},attrs:{src:"/img/case-studies-logos/block-logo.gif"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h2",[a("a",{attrs:{href:"https://bitkey.build/",target:"_blank"}},[t._v("Bitkey")])]),t._v(" "),a("p",[t._v("\n Bitkey is the safe, easy way to own and manage bitcoin. It’s a mobile app, hardware device, and a set of recovery tools, for simple, secure self-custody.\n ")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://foundationdevices.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/foundation-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://foundationdevices.com/",target:"_blank"}},[t._v("Envoy By Foundation")])]),t._v(" "),a("p",[t._v("A Bitcoin wallet with powerful account management and privacy features. Use alongside your Passport hardware wallet to take true ownership of your Bitcoin.")])])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{322:function(t,a,s){},381:function(t,a,s){"use strict";s(322)},441:function(t,a,s){"use strict";s.r(a);s(381);var e=s(7),i=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"hardware"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#hardware"}},[t._v("#")]),t._v(" Hardware")]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://bitkey.build/",target:"_blank"}},[a("img",{staticStyle:{"max-height":"130px"},attrs:{src:"/img/case-studies-logos/block-logo.gif"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h2",[a("a",{attrs:{href:"https://bitkey.build/",target:"_blank"}},[t._v("Bitkey")])]),t._v(" "),a("p",[t._v("\n Bitkey is the safe, easy way to own and manage bitcoin. It’s a mobile app, hardware device, and a set of recovery tools, for simple, secure self-custody.\n ")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://foundationdevices.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/foundation-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://foundationdevices.com/",target:"_blank"}},[t._v("Envoy By Foundation")])]),t._v(" "),a("p",[t._v("A Bitcoin wallet with powerful account management and privacy features. Use alongside your Passport hardware wallet to take true ownership of your Bitcoin.")])])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/40.3dbbc631.js b/assets/js/40.0743931a.js similarity index 86% rename from assets/js/40.3dbbc631.js rename to assets/js/40.0743931a.js index 3994d3438e..dca130a8a9 100644 --- a/assets/js/40.3dbbc631.js +++ b/assets/js/40.0743931a.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{322:function(t,s,a){},381:function(t,s,a){"use strict";a(322)},441:function(t,s,a){"use strict";a.r(s);a(381);var i=a(7),r=Object(i.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"infrastructure"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#infrastructure"}},[t._v("#")]),t._v(" Infrastructure")]),t._v(" "),s("div",{staticClass:"project"},[s("div",{staticClass:"project-logo"},[s("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank"}},[s("img",{attrs:{src:"/img/case-studies-logos/spotbit-130.png"}})])]),t._v(" "),s("div",{staticClass:"tagline"},[s("h3",[s("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank"}},[t._v("Spotbit")])]),t._v(" "),s("p",[t._v("Spotbit is a portable API for Bitcoin price data and candles.")])])]),t._v(" "),s("div",{staticClass:"project"},[s("div",{staticClass:"project-logo"},[s("a",{attrs:{href:"https://galoy.io/",target:"_blank"}},[s("img",{attrs:{src:"/img/case-studies-logos/galoy-130.png"}})])]),t._v(" "),s("div",{staticClass:"tagline"},[s("h3",[s("a",{attrs:{href:"https://galoy.io/",target:"_blank"}},[t._v("Galoy")])]),t._v(" "),s("p",[t._v("Bitcoin-native banking infrastructure for organizations.")])])])])}),[],!1,null,null,null);s.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{323:function(t,s,a){},382:function(t,s,a){"use strict";a(323)},442:function(t,s,a){"use strict";a.r(s);a(382);var i=a(7),r=Object(i.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"infrastructure"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#infrastructure"}},[t._v("#")]),t._v(" Infrastructure")]),t._v(" "),s("div",{staticClass:"project"},[s("div",{staticClass:"project-logo"},[s("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank"}},[s("img",{attrs:{src:"/img/case-studies-logos/spotbit-130.png"}})])]),t._v(" "),s("div",{staticClass:"tagline"},[s("h3",[s("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank"}},[t._v("Spotbit")])]),t._v(" "),s("p",[t._v("Spotbit is a portable API for Bitcoin price data and candles.")])])]),t._v(" "),s("div",{staticClass:"project"},[s("div",{staticClass:"project-logo"},[s("a",{attrs:{href:"https://galoy.io/",target:"_blank"}},[s("img",{attrs:{src:"/img/case-studies-logos/galoy-130.png"}})])]),t._v(" "),s("div",{staticClass:"tagline"},[s("h3",[s("a",{attrs:{href:"https://galoy.io/",target:"_blank"}},[t._v("Galoy")])]),t._v(" "),s("p",[t._v("Bitcoin-native banking infrastructure for organizations.")])])])])}),[],!1,null,null,null);s.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/41.802e975e.js b/assets/js/41.9b3697eb.js similarity index 97% rename from assets/js/41.802e975e.js rename to assets/js/41.9b3697eb.js index 910da5500f..05b16dd06d 100644 --- a/assets/js/41.802e975e.js +++ b/assets/js/41.9b3697eb.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{323:function(t,a,s){},382:function(t,a,s){"use strict";s(323)},442:function(t,a,s){"use strict";s.r(a);s(382);var e=s(7),i=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"mobile"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mobile"}},[t._v("#")]),t._v(" Mobile")]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://bitkey.build/",target:"_blank"}},[a("img",{staticStyle:{"max-height":"130px"},attrs:{src:"/img/case-studies-logos/block-logo.gif"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h2",[a("a",{attrs:{href:"https://bitkey.build/",target:"_blank"}},[t._v("Bitkey")])]),t._v(" "),a("p",[t._v("\n Bitkey is the safe, easy way to own and manage bitcoin. It’s a mobile app, hardware device, and a set of recovery tools, for simple, secure self-custody.\n ")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/peach-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h2",[a("a",{attrs:{href:"https://peachbitcoin.com/",target:"_blank"}},[t._v("Peach Bitcoin")])]),t._v(" "),a("p",[t._v("Connecting Bitcoin buyers and sellers directly together. Buy or sell bitcoin peer-to-peer anywhere, at anytime.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.mutinywallet.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/mutiny-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.mutinywallet.com/",target:"_blank"}},[t._v("Mutiny Wallet")])]),t._v(" "),a("p",[t._v("Mutiny is a self-custodial lightning wallet that runs in the browser.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://foundationdevices.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/foundation-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://foundationdevices.com/",target:"_blank"}},[t._v("Envoy By Foundation")])]),t._v(" "),a("p",[t._v("A Bitcoin wallet with powerful account management and privacy features. Use alongside your Passport hardware wallet to take true ownership of your Bitcoin.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.bullbitcoin.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/bull-bitcoin-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.bullbitcoin.com/",target:"_blank"}},[t._v("Bull Bitcoin")])]),t._v(" "),a("p",[t._v("A self-custodial Bitcoin Wallet and Exchange app that lets users buy, sell, spend and get paid with Bitcoin. Bitcoins are automatically sent from the exchange to the user's wallet.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.lava.xyz/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lava-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.lava.xyz/",target:"_blank"}},[t._v("Lava")])]),t._v(" "),a("p",[t._v("The Future of Finance Available Today. Functional, safe and simple.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/lightningdevkit/ldk-node",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/ldk-node-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/lightningdevkit/ldk-node",target:"_blank"}},[t._v("LDK Node")])]),t._v(" "),a("p",[t._v("A ready-to-go Lightning node library built using LDK and BDK.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.goldenraven.padawanwallet",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/padawan-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.goldenraven.padawanwallet",target:"_blank"}},[t._v("Padawan Wallet")])]),t._v(" "),a("p",[t._v("Padawan is a testnet-only bitcoin wallet packed with tutorials to learn how to use bitcoin on mobile.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.smartvaults.io/",target:"_blank"}},[a("img",{staticStyle:{"max-height":"130px"},attrs:{src:"/img/case-studies-logos/smart-vaults-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.smartvaults.io/",target:"_blank"}},[t._v("Smart Vaults")])]),t._v(" "),a("p",[t._v("Determine who, how, and when your Bitcoin can be accessed.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.iriswallet.testnet",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/iris-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.iriswallet.testnet",target:"_blank"}},[t._v("Iris Wallet")])]),t._v(" "),a("p",[t._v("Open-source wallet for Bitcoin and RGB assets.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/spotbit-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank"}},[t._v("Spotbit")])]),t._v(" "),a("p",[t._v("Spotbit is a portable API for Bitcoin price data and candles.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://lipa.swiss/en",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lipa-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://lipa.swiss/en",target:"_blank"}},[t._v("Lipa")])]),t._v(" "),a("p",[t._v("The Swiss app for cashless payments with Bitcoin.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://lexe.app/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lexe-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://lexe.app/",target:"_blank"}},[t._v("Lexe Wallet")])]),t._v(" "),a("p",[t._v("Lexe is a self-custodial Bitcoin and Lightning wallet that can receive payments 24/7.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://10101.finance/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/10101-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://10101.finance/",target:"_blank"}},[t._v("10101")])]),t._v(" "),a("p",[t._v("Decentralised finance. For real. BTC trading without counterparty risk in one easy and fast app.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://wizardsardine.com/liana/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/liana-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://wizardsardine.com/liana/",target:"_blank"}},[t._v("Liana")])]),t._v(" "),a("p",[t._v("Never lose your coins. Liana is a simple Bitcoin wallet with built-in loss protection and inheritance.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/utreexo/utreexod",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/utreexod-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/utreexo/utreexod",target:"_blank"}},[t._v("utreexod")])]),t._v(" "),a("p",[t._v("A fully validating Bitcoin node with Utreexo support.")])])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{321:function(t,a,s){},380:function(t,a,s){"use strict";s(321)},440:function(t,a,s){"use strict";s.r(a);s(380);var e=s(7),i=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"mobile"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mobile"}},[t._v("#")]),t._v(" Mobile")]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://bitkey.build/",target:"_blank"}},[a("img",{staticStyle:{"max-height":"130px"},attrs:{src:"/img/case-studies-logos/block-logo.gif"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h2",[a("a",{attrs:{href:"https://bitkey.build/",target:"_blank"}},[t._v("Bitkey")])]),t._v(" "),a("p",[t._v("\n Bitkey is the safe, easy way to own and manage bitcoin. It’s a mobile app, hardware device, and a set of recovery tools, for simple, secure self-custody.\n ")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/peach-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h2",[a("a",{attrs:{href:"https://peachbitcoin.com/",target:"_blank"}},[t._v("Peach Bitcoin")])]),t._v(" "),a("p",[t._v("Connecting Bitcoin buyers and sellers directly together. Buy or sell bitcoin peer-to-peer anywhere, at anytime.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.mutinywallet.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/mutiny-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.mutinywallet.com/",target:"_blank"}},[t._v("Mutiny Wallet")])]),t._v(" "),a("p",[t._v("Mutiny is a self-custodial lightning wallet that runs in the browser.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://foundationdevices.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/foundation-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://foundationdevices.com/",target:"_blank"}},[t._v("Envoy By Foundation")])]),t._v(" "),a("p",[t._v("A Bitcoin wallet with powerful account management and privacy features. Use alongside your Passport hardware wallet to take true ownership of your Bitcoin.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.bullbitcoin.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/bull-bitcoin-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.bullbitcoin.com/",target:"_blank"}},[t._v("Bull Bitcoin")])]),t._v(" "),a("p",[t._v("A self-custodial Bitcoin Wallet and Exchange app that lets users buy, sell, spend and get paid with Bitcoin. Bitcoins are automatically sent from the exchange to the user's wallet.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.lava.xyz/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lava-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.lava.xyz/",target:"_blank"}},[t._v("Lava")])]),t._v(" "),a("p",[t._v("The Future of Finance Available Today. Functional, safe and simple.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/lightningdevkit/ldk-node",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/ldk-node-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/lightningdevkit/ldk-node",target:"_blank"}},[t._v("LDK Node")])]),t._v(" "),a("p",[t._v("A ready-to-go Lightning node library built using LDK and BDK.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.goldenraven.padawanwallet",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/padawan-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.goldenraven.padawanwallet",target:"_blank"}},[t._v("Padawan Wallet")])]),t._v(" "),a("p",[t._v("Padawan is a testnet-only bitcoin wallet packed with tutorials to learn how to use bitcoin on mobile.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.smartvaults.io/",target:"_blank"}},[a("img",{staticStyle:{"max-height":"130px"},attrs:{src:"/img/case-studies-logos/smart-vaults-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.smartvaults.io/",target:"_blank"}},[t._v("Smart Vaults")])]),t._v(" "),a("p",[t._v("Determine who, how, and when your Bitcoin can be accessed.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.iriswallet.testnet",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/iris-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.iriswallet.testnet",target:"_blank"}},[t._v("Iris Wallet")])]),t._v(" "),a("p",[t._v("Open-source wallet for Bitcoin and RGB assets.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/spotbit-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank"}},[t._v("Spotbit")])]),t._v(" "),a("p",[t._v("Spotbit is a portable API for Bitcoin price data and candles.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://lipa.swiss/en",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lipa-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://lipa.swiss/en",target:"_blank"}},[t._v("Lipa")])]),t._v(" "),a("p",[t._v("The Swiss app for cashless payments with Bitcoin.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://lexe.app/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lexe-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://lexe.app/",target:"_blank"}},[t._v("Lexe Wallet")])]),t._v(" "),a("p",[t._v("Lexe is a self-custodial Bitcoin and Lightning wallet that can receive payments 24/7.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://10101.finance/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/10101-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://10101.finance/",target:"_blank"}},[t._v("10101")])]),t._v(" "),a("p",[t._v("Decentralised finance. For real. BTC trading without counterparty risk in one easy and fast app.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://wizardsardine.com/liana/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/liana-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://wizardsardine.com/liana/",target:"_blank"}},[t._v("Liana")])]),t._v(" "),a("p",[t._v("Never lose your coins. Liana is a simple Bitcoin wallet with built-in loss protection and inheritance.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/utreexo/utreexod",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/utreexod-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/utreexo/utreexod",target:"_blank"}},[t._v("utreexod")])]),t._v(" "),a("p",[t._v("A fully validating Bitcoin node with Utreexo support.")])])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/49.c5e899f8.js b/assets/js/49.25167055.js similarity index 99% rename from assets/js/49.c5e899f8.js rename to assets/js/49.25167055.js index c42833db8f..fd342d1aab 100644 --- a/assets/js/49.c5e899f8.js +++ b/assets/js/49.25167055.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[49],{403: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([[49],{407: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/50.525b80bb.js b/assets/js/50.db815b83.js similarity index 99% rename from assets/js/50.525b80bb.js rename to assets/js/50.db815b83.js index 030a260572..4c7daaadeb 100644 --- a/assets/js/50.525b80bb.js +++ b/assets/js/50.db815b83.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{404: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([[50],{403: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/51.4769671b.js b/assets/js/51.2aa80360.js similarity index 99% rename from assets/js/51.4769671b.js rename to assets/js/51.2aa80360.js index 4917ad0b80..072ceb137d 100644 --- a/assets/js/51.4769671b.js +++ b/assets/js/51.2aa80360.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{407: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([[51],{405: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/52.776c8d09.js b/assets/js/52.8189e6c2.js similarity index 99% rename from assets/js/52.776c8d09.js rename to assets/js/52.8189e6c2.js index 609663b715..35a7a67363 100644 --- a/assets/js/52.776c8d09.js +++ b/assets/js/52.8189e6c2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{408: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([[52],{406: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/56.317bef0d.js b/assets/js/56.71c5412d.js similarity index 99% rename from assets/js/56.317bef0d.js rename to assets/js/56.71c5412d.js index 05d2b4e94a..70bce6a4b2 100644 --- a/assets/js/56.317bef0d.js +++ b/assets/js/56.71c5412d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{414:function(e,t,a){"use strict";a.r(t);var o=a(7),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("This post is part 1 of 3 of a series. ("),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"}},[e._v("Part 2")]),e._v(", "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"}},[e._v("Part 3")]),e._v(")")],1),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#introduction-what-is-fee-estimation"}},[e._v("Introduction: what is fee estimation?")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-problem"}},[e._v("The problem")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#the-challenges-and-the-solution"}},[e._v("The challenges and the solution")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-question"}},[e._v("The question")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-data-logger"}},[e._v("The data logger")])])])])]),e._v(" "),t("h2",{attrs:{id:"introduction-what-is-fee-estimation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction-what-is-fee-estimation"}},[e._v("#")]),e._v(" Introduction: what is fee estimation?")]),e._v(" "),t("p",[e._v("Fee estimation is the process of selecting the fee rate"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v(" for a bitcoin transaction being created, according to two main factors:")]),e._v(" "),t("ul",[t("li",[e._v("The current congestion of the Bitcoin network.")]),e._v(" "),t("li",[e._v("The urgency, or lack thereof, for the transaction confirmation, i.e, its inclusion in a block.")])]),e._v(" "),t("p",[e._v("A fee rate should be adequate to the above factors: a fee too high would be a waste of money, because the same result could have been achieved with a lower expense. On the other hand, a fee rate too low would wait for a confirmation longer than planned or, even worse, the transaction could not be confirmed at all.")]),e._v(" "),t("h2",{attrs:{id:"the-problem"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-problem"}},[e._v("#")]),e._v(" The problem")]),e._v(" "),t("p",[e._v("Bitcoin Core offers fee estimation through the "),t("a",{attrs:{href:"https://bitcoincore.org/en/doc/0.20.0/rpc/util/estimatesmartfee/",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("estimatesmartfee")]),t("OutboundLink")],1),e._v(" RPC method, and there are also a lot of third-party "),t("a",{attrs:{href:"https://b10c.me/blog/003-a-list-of-public-bitcoin-feerate-estimation-apis/",target:"_blank",rel:"noopener noreferrer"}},[e._v("fee estimators"),t("OutboundLink")],1),e._v(" online, so do we need yet another estimator?")]),e._v(" "),t("p",[e._v("The model used by Bitcoin Core is not well suited for light-clients such as mobile wallets, even when running in pruned mode. Online estimators are lacking in terms of:")]),e._v(" "),t("ul",[t("li",[e._v("Privacy: Contacting the server leaks your IP (unless you are using Tor or a VPN), and the request timing may be used to correlate the request to a transaction broadcasted to the network soon thereafter.")]),e._v(" "),t("li",[e._v("Security: A malicious estimator could provide a high fee rate leading to a waste of money, or a low fee rate hampering the transaction confirmation.")])]),e._v(" "),t("p",[e._v("Replace By Fee (RBF) and Child Pays For Parent (CPFP) are techniques that can somewhat minimize the fee estimation problem, because one could simply underestimate the fee rate and then raise it when necessary, however:")]),e._v(" "),t("ul",[t("li",[e._v("RBF and CPFP may leak more information, such as patterns that may allow to detect the kind of wallet used, or which one of the transaction outputs is the change.")]),e._v(" "),t("li",[e._v('Requires additional interaction: the client must come back "online" to perform the fee bump. Sometimes this might be impractical or risky, for instance when using an offline signer or a multisignature with geographically distributed keys.')])]),e._v(" "),t("p",[e._v("Thus, this work is an effort to build a "),t("strong",[e._v("good fee estimator for purely peer to peer light clients")]),e._v(" such as "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[e._v("neutrino"),t("OutboundLink")],1),e._v(" based ones, or at least determine whether the approach we take is infeasible and open the discussion\nfor other, better, models.")]),e._v(" "),t("p",[e._v("In the meantime, another sub-goal is pursued: attract the interest of data scientists; Indeed the initial step for this analysis consists in constructing a data set, which could also also help kickstart other studies on fee estimation or, more broadly, on the Bitcoin mempool.")]),e._v(" "),t("h4",{attrs:{id:"the-challenges-and-the-solution"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-challenges-and-the-solution"}},[e._v("#")]),e._v(" The challenges and the solution")]),e._v(" "),t("p",[e._v("The hardest part of doing fee estimation on a light client is the lack of information: for example, Bitcoin Core's "),t("code",[e._v("estimatesmartfee")]),e._v(" uses up to the last 1008 blocks and knows everything about the mempool"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn2",id:"fnref2"}},[e._v("[2]")])]),e._v(", such as the fee rate of every transaction it contains, but a light-client does not.")]),e._v(" "),t("p",[e._v("Also, there are other factors that may help doing fee estimation, such as the day of the week (the mempool usually empties during the "),t("a",{attrs:{href:"https://www.blockchainresearchlab.org/2020/03/30/a-week-with-bitcoin-transaction-timing-and-transaction-fees/",target:"_blank",rel:"noopener noreferrer"}},[e._v("weekend"),t("OutboundLink")],1),e._v(") or the time of the day to anticipate recurring daily events\n(such as the batch of "),t("a",{attrs:{href:"https://b10c.me/mempool-observations/2-bitmex-broadcast-13-utc/",target:"_blank",rel:"noopener noreferrer"}},[e._v("bitmex withdrawals"),t("OutboundLink")],1),e._v(").")]),e._v(" "),t("p",[e._v("The idea is to apply Machine Learning (ML) techniques"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn3",id:"fnref3"}},[e._v("[3]")])]),e._v(" to discover patterns over what a light-client knows and see if they are enough to achieve consistently good estimations.")]),e._v(" "),t("h4",{attrs:{id:"the-question"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-question"}},[e._v("#")]),e._v(" The question")]),e._v(" "),t("p",[e._v('We are going to use a DNN (Deep Neural Network), a ML technique in the supervised learning branch. The "ELI5" is: give a lot of example inputs and the desired output to a black box; if there are correlations between inputs and outputs,\nand there are enough examples, the black box will eventually start predicting the correct output even with inputs it has never seen before.')]),e._v(" "),t("p",[e._v("To define our inputs and outputs, we need to start from the question we want to answer. For a fee estimator this is:")]),e._v(" "),t("p",[t("em",[e._v('"Which minimum fee rate should I use if I want this transaction to be confirmed in at most '),t("code",[e._v("n")]),e._v(' blocks?"')])]),e._v(" "),t("p",[e._v("This can be translated to a table with many rows like:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("confirms_in")]),e._v(" "),t("th",[e._v("other_information")]),e._v(" "),t("th",[e._v("fee_rate")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("1")]),e._v(" "),t("td",[e._v("...")]),e._v(" "),t("td",[e._v("100.34")])]),e._v(" "),t("tr",[t("td",[e._v("2")]),e._v(" "),t("td",[e._v("...")]),e._v(" "),t("td",[e._v("84.33")])]),e._v(" "),t("tr",[t("td",[e._v("10")]),e._v(" "),t("td",[e._v("...")]),e._v(" "),t("td",[e._v("44.44")])])])]),e._v(" "),t("p",[e._v("where the "),t("code",[e._v("fee_rate")]),e._v(' column is the output we want, also called the "'),t("em",[e._v("target")]),e._v('" or "'),t("em",[e._v("label")]),e._v('" in ML terminology, and the other columns are our inputs.')]),e._v(" "),t("p",[e._v("Can we build this table just by looking at the Bitcoin blockchain? Unfortunately, we can't:\nThe main thing that's missing is an indication of when the node first saw a transaction that has been later confirmed in a block. With that knowledge we can say that the fee rate of that transaction was the exact value required to confirm\nwithin the number of blocks it actually took to be confirmed. For instance, if we see transaction "),t("code",[e._v("t")]),e._v(" when the blockchain is at height "),t("code",[e._v("1000")]),e._v(" and then we notice that "),t("code",[e._v("t")]),e._v(" has been included in block "),t("code",[e._v("1006")]),e._v(", we can deduce that the\nfee rate paid by "),t("code",[e._v("t")]),e._v(" was the exact value required to get confirmed within the next "),t("code",[e._v("6")]),e._v(" blocks.")]),e._v(" "),t("p",[e._v("So to build our model, we first need to gather these data, and machine learning needs a "),t("em",[e._v("lot")]),e._v(" of data to work well.")]),e._v(" "),t("h4",{attrs:{id:"the-data-logger"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-data-logger"}},[e._v("#")]),e._v(" The data logger")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://github.com/RCasatta/bitcoin_logger",target:"_blank",rel:"noopener noreferrer"}},[e._v("data logger"),t("OutboundLink")],1),e._v(" is built with the purpose of collecting all the data we need, and it's MIT licensed open source software written in Rust.")]),e._v(" "),t("p",[e._v("We need to register the moment in time when transactions enter in the node's mempool; to be efficient and precise we should not only call the RPC endpoints but listen to "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("ZMQ"),t("OutboundLink")],1),e._v(" events. Luckily, the just released bitcoin core 0.21.0 added a new "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("ZMQ"),t("OutboundLink")],1),e._v(" topic "),t("code",[e._v("zmqpubsequence")]),e._v(" notifying mempool events (and block events). The logger is also listening to "),t("code",[e._v("zmqpubrawtx")]),e._v(" and "),t("code",[e._v("zmqpubrawblock")]),e._v(" topics, to make less RPC calls.")]),e._v(" "),t("p",[e._v("We are not only interested in the timestamp of the transaction entering the mempool, but also how many blocks it will take until the same transaction is confirmed.\nIn the final dataset this field is called "),t("code",[e._v("confirms_in")]),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn4",id:"fnref4"}},[e._v("[4]")])]),e._v("; if "),t("code",[e._v("confirms_in = 1")]),e._v(" it means the transaction is confirmed in the first block created after it has been seen for the first time.")]),e._v(" "),t("p",[e._v("Another critical piece of information logged by the data logger is the "),t("code",[e._v("fee_rate")]),e._v(" of the transaction, since the absolute fee value paid by a bitcoin transaction is not available nor derivable given only the transaction itself, as the inputs don't have explicit amounts.")]),e._v(" "),t("p",[e._v("All these data (apart from the time of the transaction entering in the mempool) can actually be reconstructed simply by looking at the blockchain. However, querying the bitcoin node can be fairly slow, and during the model training iterations we want to recreate the ML dataset rapidly"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn5",id:"fnref5"}},[e._v("[5]")])]),e._v(", for example whenever we need to modify or add a new field.")]),e._v(" "),t("p",[e._v("For these reasons, the logger is split into two parts: a process listening to the events sent by our node, which creates raw logs, and then a second process that uses these logs to create the final CSV dataset.\nRaw logs are self-contained: for example, they contain all the previous transaction output values for every relevant transaction. This causes some redundancy, but in this case it's better to trade some efficiency for more performance\nwhen recreating the dataset.")]),e._v(" "),t("figure",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/high-level-graph.svg",alt:"High level graph"}})]),e._v(" "),t("p",[e._v("My logger instance started collecting data on the 18th of December 2020, and as of today (25th January 2020), the raw logs are about 16GB.")]),e._v(" "),t("p",[e._v("I expect (or at least hope) the raw logs, the CSV dataset, or the data logger will be useful also for other projects as well, like monitoring the propagation of transactions or other works involving raw mempool data. We will share raw logs data through torrent soon.")]),e._v(" "),t("p",[e._v("In the following "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"}},[e._v("Part 2")]),e._v(" we are going to talk about the dataset.")],1),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("The transaction fee rate is the ratio between the absolute fee expressed in satoshi, over the weight of the transaction measured in virtual bytes. The weight of the transaction is similar to the byte size, however a part of the transaction (the segwit part) is discounted, their byte size is considered less because it creates less burden for the network. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn2"}},[t("p",[e._v("mempool is the set of transactions that are valid by consensus rules (for example, they are spending existing bitcoin), broadcasted in the bitcoin peer to peer network, but they are not yet part of the blockchain. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref2"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn3"}},[t("p",[e._v("DISCLAIMER: I am not an expert data-scientist! "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref3"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn4"}},[t("p",[e._v("Conceptually similar to bitcoin core "),t("code",[e._v("estimatesmartfee")]),e._v(' parameter called "blocks target", however, '),t("code",[e._v("confirms_in")]),e._v(" is the real value not the desired target. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref4"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn5"}},[t("p",[e._v("16GB of compressed raw logs are processed and a compressed CSV produced in about 5 minutes. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref5"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{417:function(e,t,a){"use strict";a.r(t);var o=a(7),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("This post is part 1 of 3 of a series. ("),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"}},[e._v("Part 2")]),e._v(", "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"}},[e._v("Part 3")]),e._v(")")],1),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#introduction-what-is-fee-estimation"}},[e._v("Introduction: what is fee estimation?")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-problem"}},[e._v("The problem")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#the-challenges-and-the-solution"}},[e._v("The challenges and the solution")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-question"}},[e._v("The question")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-data-logger"}},[e._v("The data logger")])])])])]),e._v(" "),t("h2",{attrs:{id:"introduction-what-is-fee-estimation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction-what-is-fee-estimation"}},[e._v("#")]),e._v(" Introduction: what is fee estimation?")]),e._v(" "),t("p",[e._v("Fee estimation is the process of selecting the fee rate"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v(" for a bitcoin transaction being created, according to two main factors:")]),e._v(" "),t("ul",[t("li",[e._v("The current congestion of the Bitcoin network.")]),e._v(" "),t("li",[e._v("The urgency, or lack thereof, for the transaction confirmation, i.e, its inclusion in a block.")])]),e._v(" "),t("p",[e._v("A fee rate should be adequate to the above factors: a fee too high would be a waste of money, because the same result could have been achieved with a lower expense. On the other hand, a fee rate too low would wait for a confirmation longer than planned or, even worse, the transaction could not be confirmed at all.")]),e._v(" "),t("h2",{attrs:{id:"the-problem"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-problem"}},[e._v("#")]),e._v(" The problem")]),e._v(" "),t("p",[e._v("Bitcoin Core offers fee estimation through the "),t("a",{attrs:{href:"https://bitcoincore.org/en/doc/0.20.0/rpc/util/estimatesmartfee/",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("estimatesmartfee")]),t("OutboundLink")],1),e._v(" RPC method, and there are also a lot of third-party "),t("a",{attrs:{href:"https://b10c.me/blog/003-a-list-of-public-bitcoin-feerate-estimation-apis/",target:"_blank",rel:"noopener noreferrer"}},[e._v("fee estimators"),t("OutboundLink")],1),e._v(" online, so do we need yet another estimator?")]),e._v(" "),t("p",[e._v("The model used by Bitcoin Core is not well suited for light-clients such as mobile wallets, even when running in pruned mode. Online estimators are lacking in terms of:")]),e._v(" "),t("ul",[t("li",[e._v("Privacy: Contacting the server leaks your IP (unless you are using Tor or a VPN), and the request timing may be used to correlate the request to a transaction broadcasted to the network soon thereafter.")]),e._v(" "),t("li",[e._v("Security: A malicious estimator could provide a high fee rate leading to a waste of money, or a low fee rate hampering the transaction confirmation.")])]),e._v(" "),t("p",[e._v("Replace By Fee (RBF) and Child Pays For Parent (CPFP) are techniques that can somewhat minimize the fee estimation problem, because one could simply underestimate the fee rate and then raise it when necessary, however:")]),e._v(" "),t("ul",[t("li",[e._v("RBF and CPFP may leak more information, such as patterns that may allow to detect the kind of wallet used, or which one of the transaction outputs is the change.")]),e._v(" "),t("li",[e._v('Requires additional interaction: the client must come back "online" to perform the fee bump. Sometimes this might be impractical or risky, for instance when using an offline signer or a multisignature with geographically distributed keys.')])]),e._v(" "),t("p",[e._v("Thus, this work is an effort to build a "),t("strong",[e._v("good fee estimator for purely peer to peer light clients")]),e._v(" such as "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[e._v("neutrino"),t("OutboundLink")],1),e._v(" based ones, or at least determine whether the approach we take is infeasible and open the discussion\nfor other, better, models.")]),e._v(" "),t("p",[e._v("In the meantime, another sub-goal is pursued: attract the interest of data scientists; Indeed the initial step for this analysis consists in constructing a data set, which could also also help kickstart other studies on fee estimation or, more broadly, on the Bitcoin mempool.")]),e._v(" "),t("h4",{attrs:{id:"the-challenges-and-the-solution"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-challenges-and-the-solution"}},[e._v("#")]),e._v(" The challenges and the solution")]),e._v(" "),t("p",[e._v("The hardest part of doing fee estimation on a light client is the lack of information: for example, Bitcoin Core's "),t("code",[e._v("estimatesmartfee")]),e._v(" uses up to the last 1008 blocks and knows everything about the mempool"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn2",id:"fnref2"}},[e._v("[2]")])]),e._v(", such as the fee rate of every transaction it contains, but a light-client does not.")]),e._v(" "),t("p",[e._v("Also, there are other factors that may help doing fee estimation, such as the day of the week (the mempool usually empties during the "),t("a",{attrs:{href:"https://www.blockchainresearchlab.org/2020/03/30/a-week-with-bitcoin-transaction-timing-and-transaction-fees/",target:"_blank",rel:"noopener noreferrer"}},[e._v("weekend"),t("OutboundLink")],1),e._v(") or the time of the day to anticipate recurring daily events\n(such as the batch of "),t("a",{attrs:{href:"https://b10c.me/mempool-observations/2-bitmex-broadcast-13-utc/",target:"_blank",rel:"noopener noreferrer"}},[e._v("bitmex withdrawals"),t("OutboundLink")],1),e._v(").")]),e._v(" "),t("p",[e._v("The idea is to apply Machine Learning (ML) techniques"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn3",id:"fnref3"}},[e._v("[3]")])]),e._v(" to discover patterns over what a light-client knows and see if they are enough to achieve consistently good estimations.")]),e._v(" "),t("h4",{attrs:{id:"the-question"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-question"}},[e._v("#")]),e._v(" The question")]),e._v(" "),t("p",[e._v('We are going to use a DNN (Deep Neural Network), a ML technique in the supervised learning branch. The "ELI5" is: give a lot of example inputs and the desired output to a black box; if there are correlations between inputs and outputs,\nand there are enough examples, the black box will eventually start predicting the correct output even with inputs it has never seen before.')]),e._v(" "),t("p",[e._v("To define our inputs and outputs, we need to start from the question we want to answer. For a fee estimator this is:")]),e._v(" "),t("p",[t("em",[e._v('"Which minimum fee rate should I use if I want this transaction to be confirmed in at most '),t("code",[e._v("n")]),e._v(' blocks?"')])]),e._v(" "),t("p",[e._v("This can be translated to a table with many rows like:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("confirms_in")]),e._v(" "),t("th",[e._v("other_information")]),e._v(" "),t("th",[e._v("fee_rate")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("1")]),e._v(" "),t("td",[e._v("...")]),e._v(" "),t("td",[e._v("100.34")])]),e._v(" "),t("tr",[t("td",[e._v("2")]),e._v(" "),t("td",[e._v("...")]),e._v(" "),t("td",[e._v("84.33")])]),e._v(" "),t("tr",[t("td",[e._v("10")]),e._v(" "),t("td",[e._v("...")]),e._v(" "),t("td",[e._v("44.44")])])])]),e._v(" "),t("p",[e._v("where the "),t("code",[e._v("fee_rate")]),e._v(' column is the output we want, also called the "'),t("em",[e._v("target")]),e._v('" or "'),t("em",[e._v("label")]),e._v('" in ML terminology, and the other columns are our inputs.')]),e._v(" "),t("p",[e._v("Can we build this table just by looking at the Bitcoin blockchain? Unfortunately, we can't:\nThe main thing that's missing is an indication of when the node first saw a transaction that has been later confirmed in a block. With that knowledge we can say that the fee rate of that transaction was the exact value required to confirm\nwithin the number of blocks it actually took to be confirmed. For instance, if we see transaction "),t("code",[e._v("t")]),e._v(" when the blockchain is at height "),t("code",[e._v("1000")]),e._v(" and then we notice that "),t("code",[e._v("t")]),e._v(" has been included in block "),t("code",[e._v("1006")]),e._v(", we can deduce that the\nfee rate paid by "),t("code",[e._v("t")]),e._v(" was the exact value required to get confirmed within the next "),t("code",[e._v("6")]),e._v(" blocks.")]),e._v(" "),t("p",[e._v("So to build our model, we first need to gather these data, and machine learning needs a "),t("em",[e._v("lot")]),e._v(" of data to work well.")]),e._v(" "),t("h4",{attrs:{id:"the-data-logger"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-data-logger"}},[e._v("#")]),e._v(" The data logger")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://github.com/RCasatta/bitcoin_logger",target:"_blank",rel:"noopener noreferrer"}},[e._v("data logger"),t("OutboundLink")],1),e._v(" is built with the purpose of collecting all the data we need, and it's MIT licensed open source software written in Rust.")]),e._v(" "),t("p",[e._v("We need to register the moment in time when transactions enter in the node's mempool; to be efficient and precise we should not only call the RPC endpoints but listen to "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("ZMQ"),t("OutboundLink")],1),e._v(" events. Luckily, the just released bitcoin core 0.21.0 added a new "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("ZMQ"),t("OutboundLink")],1),e._v(" topic "),t("code",[e._v("zmqpubsequence")]),e._v(" notifying mempool events (and block events). The logger is also listening to "),t("code",[e._v("zmqpubrawtx")]),e._v(" and "),t("code",[e._v("zmqpubrawblock")]),e._v(" topics, to make less RPC calls.")]),e._v(" "),t("p",[e._v("We are not only interested in the timestamp of the transaction entering the mempool, but also how many blocks it will take until the same transaction is confirmed.\nIn the final dataset this field is called "),t("code",[e._v("confirms_in")]),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn4",id:"fnref4"}},[e._v("[4]")])]),e._v("; if "),t("code",[e._v("confirms_in = 1")]),e._v(" it means the transaction is confirmed in the first block created after it has been seen for the first time.")]),e._v(" "),t("p",[e._v("Another critical piece of information logged by the data logger is the "),t("code",[e._v("fee_rate")]),e._v(" of the transaction, since the absolute fee value paid by a bitcoin transaction is not available nor derivable given only the transaction itself, as the inputs don't have explicit amounts.")]),e._v(" "),t("p",[e._v("All these data (apart from the time of the transaction entering in the mempool) can actually be reconstructed simply by looking at the blockchain. However, querying the bitcoin node can be fairly slow, and during the model training iterations we want to recreate the ML dataset rapidly"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn5",id:"fnref5"}},[e._v("[5]")])]),e._v(", for example whenever we need to modify or add a new field.")]),e._v(" "),t("p",[e._v("For these reasons, the logger is split into two parts: a process listening to the events sent by our node, which creates raw logs, and then a second process that uses these logs to create the final CSV dataset.\nRaw logs are self-contained: for example, they contain all the previous transaction output values for every relevant transaction. This causes some redundancy, but in this case it's better to trade some efficiency for more performance\nwhen recreating the dataset.")]),e._v(" "),t("figure",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/high-level-graph.svg",alt:"High level graph"}})]),e._v(" "),t("p",[e._v("My logger instance started collecting data on the 18th of December 2020, and as of today (25th January 2020), the raw logs are about 16GB.")]),e._v(" "),t("p",[e._v("I expect (or at least hope) the raw logs, the CSV dataset, or the data logger will be useful also for other projects as well, like monitoring the propagation of transactions or other works involving raw mempool data. We will share raw logs data through torrent soon.")]),e._v(" "),t("p",[e._v("In the following "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"}},[e._v("Part 2")]),e._v(" we are going to talk about the dataset.")],1),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("The transaction fee rate is the ratio between the absolute fee expressed in satoshi, over the weight of the transaction measured in virtual bytes. The weight of the transaction is similar to the byte size, however a part of the transaction (the segwit part) is discounted, their byte size is considered less because it creates less burden for the network. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn2"}},[t("p",[e._v("mempool is the set of transactions that are valid by consensus rules (for example, they are spending existing bitcoin), broadcasted in the bitcoin peer to peer network, but they are not yet part of the blockchain. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref2"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn3"}},[t("p",[e._v("DISCLAIMER: I am not an expert data-scientist! "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref3"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn4"}},[t("p",[e._v("Conceptually similar to bitcoin core "),t("code",[e._v("estimatesmartfee")]),e._v(' parameter called "blocks target", however, '),t("code",[e._v("confirms_in")]),e._v(" is the real value not the desired target. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref4"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn5"}},[t("p",[e._v("16GB of compressed raw logs are processed and a compressed CSV produced in about 5 minutes. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref5"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/57.64bfd1b2.js b/assets/js/57.17897a36.js similarity index 99% rename from assets/js/57.64bfd1b2.js rename to assets/js/57.17897a36.js index 24a089371c..b372e77770 100644 --- a/assets/js/57.64bfd1b2.js +++ b/assets/js/57.17897a36.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{415:function(e,t,a){"use strict";a.r(t);var o=a(7),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("This post is part 2 of 3 of a series. ("),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"}},[e._v("Part 1")]),e._v(", "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"}},[e._v("Part 3")]),e._v(")")],1),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#the-dataset"}},[e._v("The dataset")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#the-mempool"}},[e._v("The mempool")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-outliers"}},[e._v("The outliers")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#recap"}},[e._v("Recap")])])])])]),e._v(" "),t("h2",{attrs:{id:"the-dataset"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-dataset"}},[e._v("#")]),e._v(" The dataset")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://storage.googleapis.com/bitcoin_log/dataset_18.csv.gz",target:"_blank",rel:"noopener noreferrer"}},[e._v("dataset"),t("OutboundLink")],1),e._v(" is publicly available (~500MB gzip compressed, ~2GB as plain CSV).")]),e._v(" "),t("p",[e._v("The output of the model is the fee rate, expressed in "),t("code",[e._v("[satoshi/vbytes]")]),e._v(".")]),e._v(" "),t("p",[e._v("What about the inputs? Generally speaking, we have two main requirements for what can be included as input for our model:")]),e._v(" "),t("ul",[t("li",[e._v("It must be correlated to the output, even with a non-linear relation.")]),e._v(" "),t("li",[e._v("It must be available to a light client: for instance, assuming to have knowledge and an index of the last 1000 blocks is considered too much.")])]),e._v(" "),t("p",[e._v("To evaluate the approach we are taking, we also want to compare our model's results with another available estimation: for this reason the dataset includes data to compute the error agains Bitcoin Core's "),t("code",[e._v("estimatesmartfee")]),e._v(" results, even though we are not going to use it for this model.")]),e._v(" "),t("p",[e._v("The dataset will contain only transactions that spend already confirmed inputs. If we wanted to include transactions with unconfirmed inputs as well, the fee rate would have to be computed as a whole;\nfor example if transaction "),t("code",[e._v("t2")]),e._v(" spends an unconfirmed input from "),t("code",[e._v("t1")]),e._v(" (while "),t("code",[e._v("t1")]),e._v(" only spends confirmed inputs, and all its other outputs are unspent), the aggregated fee rate would have to be used.\nSupposing "),t("code",[e._v("f()")]),e._v(" is extracts the absolute fee and "),t("code",[e._v("w()")]),e._v(" the transaction weight, the aggregated fee rate would be "),t("code",[e._v("(f(t1) + f(t2)) / (w(t1) + w(t2))")]),e._v(". Thus, as already said previously, to keep things simple the model simply discards all the transaction\nthat would need to perform this computation.")]),e._v(" "),t("p",[e._v("For the same reason the dataset has the "),t("code",[e._v("parent_in_cpfp")]),e._v(" flag. When a transaction has inputs confirmed (so it's not excluded by the previous rule) but one or more of its output have been spent by a transaction confirmed in the same block, "),t("code",[e._v("parent_in_cpfp")]),e._v(" is "),t("code",[e._v("1")]),e._v(".\nTransactions with "),t("code",[e._v("parent_in_cpfp = 1")]),e._v(" are included in the dataset but excluded by the current model, since the miner probably considered an aggregated fee rate while picking the transactions to build a block.")]),e._v(" "),t("h4",{attrs:{id:"the-mempool"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-mempool"}},[e._v("#")]),e._v(" The mempool")]),e._v(" "),t("p",[e._v("The most important input of our model is the current "),t("em",[e._v("status")]),e._v(' of the mempool itself. However, we cannot feed the model with a list of the fee rate of every unconfirmed transaction, because this array would have a variable length.\nTo overcome this, the transaction contained in the mempool are grouped in "buckets" which are basically subsets of the mempool where all the transactions contained in a bucket have a similar fee rate. In particular we only care about the\n'),t("em",[e._v("number")]),e._v(" of transaction in every "),t("em",[e._v("bucket")]),e._v(", not which transactions it contains.")]),e._v(" "),t("p",[e._v("The mempool buckets array is defined by two parameters, the "),t("code",[e._v("percentage_increment")]),e._v(" and the "),t("code",[e._v("array_max")]),e._v(" value.\nStarting from the minimum fee rate value "),t("code",[e._v("min_relay_fee=1.0")]),e._v(", the "),t("code",[e._v("ith")]),e._v(" element is: "),t("code",[e._v("a_i=min_relay_fee * (1+percentage_increment)^(i+1)")])]),e._v(" "),t("p",[e._v("For instance, choosing the mempool buckets array to have parameters "),t("code",[e._v("percentage_increment = 50%")]),e._v(" and "),t("code",[e._v("array_max = 500.0 sat/vbytes")]),e._v(" the buckets would be constructed like so:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("bucket")]),e._v(" "),t("th",[e._v("bucket min fee rate")]),e._v(" "),t("th",[e._v("bucket max fee rate")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("a_0")]),e._v(" "),t("td",[e._v("1.0")]),e._v(" "),t("td",[e._v("1.5")])]),e._v(" "),t("tr",[t("td",[e._v("a_1")]),e._v(" "),t("td",[e._v("1.5")]),e._v(" "),t("td",[e._v("2.25")])]),e._v(" "),t("tr",[t("td",[e._v("a_2")]),e._v(" "),t("td",[e._v("2.25")]),e._v(" "),t("td",[e._v("3.375")])]),e._v(" "),t("tr",[t("td",[e._v("a_15")]),e._v(" "),t("td",[e._v("437.89")]),e._v(" "),t("td",[e._v("inf")])])])]),e._v(" "),t("p",[e._v("The array stops at "),t("code",[e._v("a15")]),e._v(" because "),t("code",[e._v("a16")]),e._v(" would have a bucket min greater than "),t("code",[e._v("array_max")]),e._v(".")]),e._v(" "),t("p",[e._v("The model is for light-client such as "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[e._v("neutrino"),t("OutboundLink")],1),e._v(" based ones. In these clients the mempool is already available (it's needed to check for received transactions) but we can't compute fee rates of this transactions because previous confirmed inputs are not in the mempool!")]),e._v(" "),t("p",[e._v("Luckily, "),t("strong",[e._v("thanks to temporal locality "),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v(", an important part of mempool transactions spend outputs created very recently")]),e._v(", for example in the last 6 blocks.\nThe blocks are available through the p2p network, and downloading the last 6 is considered a good compromise between resource consumption and accurate prediction. We need the model to be built with the same data available in the prediction phase, as a consequence "),t("em",[e._v("the mempool data in the dataset refers only to transactions having their inputs in the last 6 blocks")]),e._v(". However the "),t("code",[e._v("bitcoin-csv")]),e._v(" tool inside the "),t("a",{attrs:{href:"https://github.com/RCasatta/bitcoin_logger",target:"_blank",rel:"noopener noreferrer"}},[e._v("data logger"),t("OutboundLink")],1),e._v(" allows to configure this parameter.")]),e._v(" "),t("h4",{attrs:{id:"the-outliers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-outliers"}},[e._v("#")]),e._v(" The outliers")]),e._v(" "),t("p",[e._v("The dataset also contains the block percentile fee rate "),t("code",[e._v("q_k")]),e._v(", considering "),t("code",[e._v("r_i")]),e._v(" to be the rate of the "),t("code",[e._v("ith")]),e._v(" transaction in a block, "),t("code",[e._v("q_k")]),e._v(" is the fee rate value such that for each transaction in a block "),t("code",[e._v("r_i")]),e._v(" < "),t("code",[e._v("q_k")]),e._v(" returns the "),t("code",[e._v("k%")]),e._v(" transactions in the block that are paying lower fees.")]),e._v(" "),t("p",[e._v("Percentiles are not used to feed the model but to filter some outliers tx.\nRemoving this observations is controversial at best and considered cheating at worse. However, it should be considered that Bitcoin Core "),t("code",[e._v("estimatesmartfee")]),e._v(" doesn't even bother to give estimation for the next block, we think this is due to the fact that many transactions that are confirming in the next block are huge overestimation, or clearly errors like "),t("a",{attrs:{href:"https://blockstream.info/tx/33291156ab79e9b4a1019b618b0acfa18cbdf8fa6b71c43a9eed62a849b86f9a",target:"_blank",rel:"noopener noreferrer"}},[e._v("this one"),t("OutboundLink")],1),e._v(" we found when we started logging data.\nThese outliers are several for transactions confirming in the next block ("),t("code",[e._v("confirms_in=1")]),e._v("), less so for "),t("code",[e._v("confirms_in=2")]),e._v(", mostly disappeared for "),t("code",[e._v("confirms_in=3")]),e._v(" or more. It's counterintuitive that overestimation exists for "),t("code",[e._v("confirms_in>1")]),e._v(", by definition an overestimation is a fee rate way higher than needed, so how is possible that an overestimation doesn't enter the very next block? There are a couple of reasons why a block is discovered without containing a transaction with high fee rate:")]),e._v(" "),t("ul",[t("li",[e._v("network latency: my node saw the transaction but the miner didn't see that transaction yet,")]),e._v(" "),t("li",[e._v("block building latency: the miner saw the transaction, but didn't finish to rebuild the block template or decided it's more efficient to finish a cycle on the older block template.")])]),e._v(" "),t("p",[e._v("To keep the model balanced, when overestimation is filtered out, underestimation are filtered out as well. This also has the effect to remove some of the transactions possibly included because a fee is payed out-of-band.\nAnother reason to filter transactions is that the dataset is over-represented by transactions with low "),t("code",[e._v("confirms_in")]),e._v(": more than 50% of transactions get confirmed in the next block, so we think it's good to filter some of these transactions.")]),e._v(" "),t("p",[e._v("The applied filters are the following:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("confirms_in")]),e._v(" "),t("th",[e._v("lower")]),e._v(" "),t("th",[e._v("higher")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("1")]),e._v(" "),t("td",[e._v("q45")]),e._v(" "),t("td",[e._v("q55")])]),e._v(" "),t("tr",[t("td",[e._v("2")]),e._v(" "),t("td",[e._v("q30")]),e._v(" "),t("td",[e._v("q70")])]),e._v(" "),t("tr",[t("td",[e._v("3")]),e._v(" "),t("td",[e._v("q1")]),e._v(" "),t("td",[e._v("q99")])])])]),e._v(" "),t("p",[e._v("Not yet convinced by the removal of these outliers? The "),t("a",{attrs:{href:"https://storage.googleapis.com/bitcoin_log/dataset_18.csv.gz",target:"_blank",rel:"noopener noreferrer"}},[e._v("dataset"),t("OutboundLink")],1),e._v(" contains all the observations, make your model 😃")]),e._v(" "),t("h4",{attrs:{id:"recap"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#recap"}},[e._v("#")]),e._v(" Recap")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("column")]),e._v(" "),t("th",[e._v("used in the model")]),e._v(" "),t("th",[e._v("description")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("txid")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Transaction hash, useful for debugging")])]),e._v(" "),t("tr",[t("td",[e._v("timestamp")]),e._v(" "),t("td",[e._v("converted")]),e._v(" "),t("td",[e._v("The time when the transaction has been added in the mempool, in the model is used in the form "),t("code",[e._v("day_of_week")]),e._v(" and "),t("code",[e._v("hour")])])]),e._v(" "),t("tr",[t("td",[e._v("current_height")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("The blockchain height seen by the node in this moment")])]),e._v(" "),t("tr",[t("td",[e._v("confirms_in")]),e._v(" "),t("td",[e._v("yes")]),e._v(" "),t("td",[e._v("This transaction confirmed at block height "),t("code",[e._v("current_height+confirms_in")])])]),e._v(" "),t("tr",[t("td",[e._v("fee_rate")]),e._v(" "),t("td",[e._v("target")]),e._v(" "),t("td",[e._v("This transaction fee rate measured in "),t("code",[e._v("[sat/vbytes]")])])]),e._v(" "),t("tr",[t("td",[e._v("fee_rate_bytes")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("fee rate in satoshi / bytes, used to check Bitcoin Core "),t("code",[e._v("estimatesmartfee")]),e._v(" predictions")])]),e._v(" "),t("tr",[t("td",[e._v("block_avg_fee")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("block average fee rate "),t("code",[e._v("[sat/vbytes]")]),e._v(" of block "),t("code",[e._v("current_height+confirms_in")])])]),e._v(" "),t("tr",[t("td",[e._v("core_econ")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("bitcoin "),t("code",[e._v("estimatesmartfee")]),e._v(" result for "),t("code",[e._v("confirms_in")]),e._v(" block target and in economic mode. Could be not available "),t("code",[e._v("?")]),e._v(" when a block is connected more recently than the estimation has been requested, estimation are requested every 10 secs.")])]),e._v(" "),t("tr",[t("td",[e._v("core_cons")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Same as above but with conservative mode")])]),e._v(" "),t("tr",[t("td",[e._v("mempool_len")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Sum of the mempool transactions with fee rate available (sum of every "),t("code",[e._v("a*")]),e._v(" field)")])]),e._v(" "),t("tr",[t("td",[e._v("parent_in_cpfp")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("It's 1 when the transaction has outputs that are spent in the same block in which the transaction is confirmed (they are parent in a CPFP relations).")])]),e._v(" "),t("tr",[t("td",[e._v("q1-q30-...")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Transaction confirming fast could be outliers, usually paying a lot more than required, this percentiles are used to filter those transactions,")])]),e._v(" "),t("tr",[t("td",[e._v("a1-a2-...")]),e._v(" "),t("td",[e._v("yes")]),e._v(" "),t("td",[e._v("Contains the number of transaction in the mempool with known fee rate in the ith bucket.")])])])]),e._v(" "),t("p",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/the-good-the-bad-the-ugly.jpg",alt:"The good, the bad and the ugly"}})]),t("div",{attrs:{align:"center"}},[e._v('My biological neural network fired this, I think it\'s because a lot of chapters start with "The"')]),e._v(" "),t("br"),t("br"),t("p"),e._v(" "),t("p",[e._v("In the previous "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"}},[e._v("Part 1")]),e._v(" we talked about the problem.")],1),e._v(" "),t("p",[e._v("In the following "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"}},[e._v("Part 3")]),e._v(" we are going to talk about the model.")],1),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("In computer science temporal locality refers to the tendency to access recent data more often than older data. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{414:function(e,t,a){"use strict";a.r(t);var o=a(7),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("This post is part 2 of 3 of a series. ("),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"}},[e._v("Part 1")]),e._v(", "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"}},[e._v("Part 3")]),e._v(")")],1),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#the-dataset"}},[e._v("The dataset")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#the-mempool"}},[e._v("The mempool")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-outliers"}},[e._v("The outliers")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#recap"}},[e._v("Recap")])])])])]),e._v(" "),t("h2",{attrs:{id:"the-dataset"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-dataset"}},[e._v("#")]),e._v(" The dataset")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://storage.googleapis.com/bitcoin_log/dataset_18.csv.gz",target:"_blank",rel:"noopener noreferrer"}},[e._v("dataset"),t("OutboundLink")],1),e._v(" is publicly available (~500MB gzip compressed, ~2GB as plain CSV).")]),e._v(" "),t("p",[e._v("The output of the model is the fee rate, expressed in "),t("code",[e._v("[satoshi/vbytes]")]),e._v(".")]),e._v(" "),t("p",[e._v("What about the inputs? Generally speaking, we have two main requirements for what can be included as input for our model:")]),e._v(" "),t("ul",[t("li",[e._v("It must be correlated to the output, even with a non-linear relation.")]),e._v(" "),t("li",[e._v("It must be available to a light client: for instance, assuming to have knowledge and an index of the last 1000 blocks is considered too much.")])]),e._v(" "),t("p",[e._v("To evaluate the approach we are taking, we also want to compare our model's results with another available estimation: for this reason the dataset includes data to compute the error agains Bitcoin Core's "),t("code",[e._v("estimatesmartfee")]),e._v(" results, even though we are not going to use it for this model.")]),e._v(" "),t("p",[e._v("The dataset will contain only transactions that spend already confirmed inputs. If we wanted to include transactions with unconfirmed inputs as well, the fee rate would have to be computed as a whole;\nfor example if transaction "),t("code",[e._v("t2")]),e._v(" spends an unconfirmed input from "),t("code",[e._v("t1")]),e._v(" (while "),t("code",[e._v("t1")]),e._v(" only spends confirmed inputs, and all its other outputs are unspent), the aggregated fee rate would have to be used.\nSupposing "),t("code",[e._v("f()")]),e._v(" is extracts the absolute fee and "),t("code",[e._v("w()")]),e._v(" the transaction weight, the aggregated fee rate would be "),t("code",[e._v("(f(t1) + f(t2)) / (w(t1) + w(t2))")]),e._v(". Thus, as already said previously, to keep things simple the model simply discards all the transaction\nthat would need to perform this computation.")]),e._v(" "),t("p",[e._v("For the same reason the dataset has the "),t("code",[e._v("parent_in_cpfp")]),e._v(" flag. When a transaction has inputs confirmed (so it's not excluded by the previous rule) but one or more of its output have been spent by a transaction confirmed in the same block, "),t("code",[e._v("parent_in_cpfp")]),e._v(" is "),t("code",[e._v("1")]),e._v(".\nTransactions with "),t("code",[e._v("parent_in_cpfp = 1")]),e._v(" are included in the dataset but excluded by the current model, since the miner probably considered an aggregated fee rate while picking the transactions to build a block.")]),e._v(" "),t("h4",{attrs:{id:"the-mempool"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-mempool"}},[e._v("#")]),e._v(" The mempool")]),e._v(" "),t("p",[e._v("The most important input of our model is the current "),t("em",[e._v("status")]),e._v(' of the mempool itself. However, we cannot feed the model with a list of the fee rate of every unconfirmed transaction, because this array would have a variable length.\nTo overcome this, the transaction contained in the mempool are grouped in "buckets" which are basically subsets of the mempool where all the transactions contained in a bucket have a similar fee rate. In particular we only care about the\n'),t("em",[e._v("number")]),e._v(" of transaction in every "),t("em",[e._v("bucket")]),e._v(", not which transactions it contains.")]),e._v(" "),t("p",[e._v("The mempool buckets array is defined by two parameters, the "),t("code",[e._v("percentage_increment")]),e._v(" and the "),t("code",[e._v("array_max")]),e._v(" value.\nStarting from the minimum fee rate value "),t("code",[e._v("min_relay_fee=1.0")]),e._v(", the "),t("code",[e._v("ith")]),e._v(" element is: "),t("code",[e._v("a_i=min_relay_fee * (1+percentage_increment)^(i+1)")])]),e._v(" "),t("p",[e._v("For instance, choosing the mempool buckets array to have parameters "),t("code",[e._v("percentage_increment = 50%")]),e._v(" and "),t("code",[e._v("array_max = 500.0 sat/vbytes")]),e._v(" the buckets would be constructed like so:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("bucket")]),e._v(" "),t("th",[e._v("bucket min fee rate")]),e._v(" "),t("th",[e._v("bucket max fee rate")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("a_0")]),e._v(" "),t("td",[e._v("1.0")]),e._v(" "),t("td",[e._v("1.5")])]),e._v(" "),t("tr",[t("td",[e._v("a_1")]),e._v(" "),t("td",[e._v("1.5")]),e._v(" "),t("td",[e._v("2.25")])]),e._v(" "),t("tr",[t("td",[e._v("a_2")]),e._v(" "),t("td",[e._v("2.25")]),e._v(" "),t("td",[e._v("3.375")])]),e._v(" "),t("tr",[t("td",[e._v("a_15")]),e._v(" "),t("td",[e._v("437.89")]),e._v(" "),t("td",[e._v("inf")])])])]),e._v(" "),t("p",[e._v("The array stops at "),t("code",[e._v("a15")]),e._v(" because "),t("code",[e._v("a16")]),e._v(" would have a bucket min greater than "),t("code",[e._v("array_max")]),e._v(".")]),e._v(" "),t("p",[e._v("The model is for light-client such as "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[e._v("neutrino"),t("OutboundLink")],1),e._v(" based ones. In these clients the mempool is already available (it's needed to check for received transactions) but we can't compute fee rates of this transactions because previous confirmed inputs are not in the mempool!")]),e._v(" "),t("p",[e._v("Luckily, "),t("strong",[e._v("thanks to temporal locality "),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v(", an important part of mempool transactions spend outputs created very recently")]),e._v(", for example in the last 6 blocks.\nThe blocks are available through the p2p network, and downloading the last 6 is considered a good compromise between resource consumption and accurate prediction. We need the model to be built with the same data available in the prediction phase, as a consequence "),t("em",[e._v("the mempool data in the dataset refers only to transactions having their inputs in the last 6 blocks")]),e._v(". However the "),t("code",[e._v("bitcoin-csv")]),e._v(" tool inside the "),t("a",{attrs:{href:"https://github.com/RCasatta/bitcoin_logger",target:"_blank",rel:"noopener noreferrer"}},[e._v("data logger"),t("OutboundLink")],1),e._v(" allows to configure this parameter.")]),e._v(" "),t("h4",{attrs:{id:"the-outliers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-outliers"}},[e._v("#")]),e._v(" The outliers")]),e._v(" "),t("p",[e._v("The dataset also contains the block percentile fee rate "),t("code",[e._v("q_k")]),e._v(", considering "),t("code",[e._v("r_i")]),e._v(" to be the rate of the "),t("code",[e._v("ith")]),e._v(" transaction in a block, "),t("code",[e._v("q_k")]),e._v(" is the fee rate value such that for each transaction in a block "),t("code",[e._v("r_i")]),e._v(" < "),t("code",[e._v("q_k")]),e._v(" returns the "),t("code",[e._v("k%")]),e._v(" transactions in the block that are paying lower fees.")]),e._v(" "),t("p",[e._v("Percentiles are not used to feed the model but to filter some outliers tx.\nRemoving this observations is controversial at best and considered cheating at worse. However, it should be considered that Bitcoin Core "),t("code",[e._v("estimatesmartfee")]),e._v(" doesn't even bother to give estimation for the next block, we think this is due to the fact that many transactions that are confirming in the next block are huge overestimation, or clearly errors like "),t("a",{attrs:{href:"https://blockstream.info/tx/33291156ab79e9b4a1019b618b0acfa18cbdf8fa6b71c43a9eed62a849b86f9a",target:"_blank",rel:"noopener noreferrer"}},[e._v("this one"),t("OutboundLink")],1),e._v(" we found when we started logging data.\nThese outliers are several for transactions confirming in the next block ("),t("code",[e._v("confirms_in=1")]),e._v("), less so for "),t("code",[e._v("confirms_in=2")]),e._v(", mostly disappeared for "),t("code",[e._v("confirms_in=3")]),e._v(" or more. It's counterintuitive that overestimation exists for "),t("code",[e._v("confirms_in>1")]),e._v(", by definition an overestimation is a fee rate way higher than needed, so how is possible that an overestimation doesn't enter the very next block? There are a couple of reasons why a block is discovered without containing a transaction with high fee rate:")]),e._v(" "),t("ul",[t("li",[e._v("network latency: my node saw the transaction but the miner didn't see that transaction yet,")]),e._v(" "),t("li",[e._v("block building latency: the miner saw the transaction, but didn't finish to rebuild the block template or decided it's more efficient to finish a cycle on the older block template.")])]),e._v(" "),t("p",[e._v("To keep the model balanced, when overestimation is filtered out, underestimation are filtered out as well. This also has the effect to remove some of the transactions possibly included because a fee is payed out-of-band.\nAnother reason to filter transactions is that the dataset is over-represented by transactions with low "),t("code",[e._v("confirms_in")]),e._v(": more than 50% of transactions get confirmed in the next block, so we think it's good to filter some of these transactions.")]),e._v(" "),t("p",[e._v("The applied filters are the following:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("confirms_in")]),e._v(" "),t("th",[e._v("lower")]),e._v(" "),t("th",[e._v("higher")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("1")]),e._v(" "),t("td",[e._v("q45")]),e._v(" "),t("td",[e._v("q55")])]),e._v(" "),t("tr",[t("td",[e._v("2")]),e._v(" "),t("td",[e._v("q30")]),e._v(" "),t("td",[e._v("q70")])]),e._v(" "),t("tr",[t("td",[e._v("3")]),e._v(" "),t("td",[e._v("q1")]),e._v(" "),t("td",[e._v("q99")])])])]),e._v(" "),t("p",[e._v("Not yet convinced by the removal of these outliers? The "),t("a",{attrs:{href:"https://storage.googleapis.com/bitcoin_log/dataset_18.csv.gz",target:"_blank",rel:"noopener noreferrer"}},[e._v("dataset"),t("OutboundLink")],1),e._v(" contains all the observations, make your model 😃")]),e._v(" "),t("h4",{attrs:{id:"recap"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#recap"}},[e._v("#")]),e._v(" Recap")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("column")]),e._v(" "),t("th",[e._v("used in the model")]),e._v(" "),t("th",[e._v("description")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("txid")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Transaction hash, useful for debugging")])]),e._v(" "),t("tr",[t("td",[e._v("timestamp")]),e._v(" "),t("td",[e._v("converted")]),e._v(" "),t("td",[e._v("The time when the transaction has been added in the mempool, in the model is used in the form "),t("code",[e._v("day_of_week")]),e._v(" and "),t("code",[e._v("hour")])])]),e._v(" "),t("tr",[t("td",[e._v("current_height")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("The blockchain height seen by the node in this moment")])]),e._v(" "),t("tr",[t("td",[e._v("confirms_in")]),e._v(" "),t("td",[e._v("yes")]),e._v(" "),t("td",[e._v("This transaction confirmed at block height "),t("code",[e._v("current_height+confirms_in")])])]),e._v(" "),t("tr",[t("td",[e._v("fee_rate")]),e._v(" "),t("td",[e._v("target")]),e._v(" "),t("td",[e._v("This transaction fee rate measured in "),t("code",[e._v("[sat/vbytes]")])])]),e._v(" "),t("tr",[t("td",[e._v("fee_rate_bytes")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("fee rate in satoshi / bytes, used to check Bitcoin Core "),t("code",[e._v("estimatesmartfee")]),e._v(" predictions")])]),e._v(" "),t("tr",[t("td",[e._v("block_avg_fee")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("block average fee rate "),t("code",[e._v("[sat/vbytes]")]),e._v(" of block "),t("code",[e._v("current_height+confirms_in")])])]),e._v(" "),t("tr",[t("td",[e._v("core_econ")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("bitcoin "),t("code",[e._v("estimatesmartfee")]),e._v(" result for "),t("code",[e._v("confirms_in")]),e._v(" block target and in economic mode. Could be not available "),t("code",[e._v("?")]),e._v(" when a block is connected more recently than the estimation has been requested, estimation are requested every 10 secs.")])]),e._v(" "),t("tr",[t("td",[e._v("core_cons")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Same as above but with conservative mode")])]),e._v(" "),t("tr",[t("td",[e._v("mempool_len")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Sum of the mempool transactions with fee rate available (sum of every "),t("code",[e._v("a*")]),e._v(" field)")])]),e._v(" "),t("tr",[t("td",[e._v("parent_in_cpfp")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("It's 1 when the transaction has outputs that are spent in the same block in which the transaction is confirmed (they are parent in a CPFP relations).")])]),e._v(" "),t("tr",[t("td",[e._v("q1-q30-...")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Transaction confirming fast could be outliers, usually paying a lot more than required, this percentiles are used to filter those transactions,")])]),e._v(" "),t("tr",[t("td",[e._v("a1-a2-...")]),e._v(" "),t("td",[e._v("yes")]),e._v(" "),t("td",[e._v("Contains the number of transaction in the mempool with known fee rate in the ith bucket.")])])])]),e._v(" "),t("p",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/the-good-the-bad-the-ugly.jpg",alt:"The good, the bad and the ugly"}})]),t("div",{attrs:{align:"center"}},[e._v('My biological neural network fired this, I think it\'s because a lot of chapters start with "The"')]),e._v(" "),t("br"),t("br"),t("p"),e._v(" "),t("p",[e._v("In the previous "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"}},[e._v("Part 1")]),e._v(" we talked about the problem.")],1),e._v(" "),t("p",[e._v("In the following "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"}},[e._v("Part 3")]),e._v(" we are going to talk about the model.")],1),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("In computer science temporal locality refers to the tendency to access recent data more often than older data. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/58.de4ccb60.js b/assets/js/58.e54b2b4e.js similarity index 99% rename from assets/js/58.de4ccb60.js rename to assets/js/58.e54b2b4e.js index 9b7103f1c2..f09d479d65 100644 --- a/assets/js/58.de4ccb60.js +++ b/assets/js/58.e54b2b4e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[58],{416:function(e,t,a){"use strict";a.r(t);var n=a(7),s=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 post is part 3 of 3 of a series. ("),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"}},[e._v("Part 1")]),e._v(", "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"}},[e._v("Part 2")]),e._v(")")],1),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#the-model"}},[e._v("The model")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#splitting"}},[e._v("Splitting")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#preprocessing"}},[e._v("Preprocessing")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#build"}},[e._v("Build")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#finally--training"}},[e._v("Finally, training")])])])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-prediction-phase"}},[e._v("The prediction phase")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#conclusion-and-future-development"}},[e._v("Conclusion and future development")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#acknowledgements"}},[e._v("Acknowledgements")])])]),e._v(" "),t("h2",{attrs:{id:"the-model"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-model"}},[e._v("#")]),e._v(" The model")]),e._v(" "),t("p",[e._v("The code building and training the model with "),t("a",{attrs:{href:"https://www.tensorflow.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("tensorflow"),t("OutboundLink")],1),e._v(" is available in "),t("a",{attrs:{href:"https://colab.research.google.com/drive/1yamwh8nE4NhmGButep-pfUT-1uRKs49a?usp=sharing",target:"_blank",rel:"noopener noreferrer"}},[e._v("google colab notebook"),t("OutboundLink")],1),e._v(" (jupyter notebook); you can also download the file as plain python and run it locally. At least 1 hour is needed to train the full model, but it heavily depends on the hardware available.")]),e._v(" "),t("p",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/20210125-091313-confirms_in-fee_rate.png",alt:"graph confirm_in blocks vs fee_rate"}})]),t("div",{attrs:{align:"center"}},[e._v("Do you want to choose the fee without a model? In the last 5 weeks a ~50 sat/vbyte transaction never took more than a day to confirm and a ~10 sat/vbyte never took more than a week")]),t("br"),t("p"),e._v(" "),t("p",[e._v("As a reference, in the code we have a calculation of the bitcoin core "),t("code",[e._v("estimatesmartfee")]),e._v(" MAE"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v(" and drift"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn2",id:"fnref2"}},[e._v("[2]")])]),e._v(".\nMAE is computed as "),t("code",[e._v("avg(abs(fee_rate - core_econ))")]),e._v(" when "),t("code",[e._v("core_econ")]),e._v(" is available (about 1.2M observations, sometime the value is not available when considered too old).")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("estimatesmartfee mode")]),e._v(" "),t("th",[e._v("MAE [satoshi/vbytes]")]),e._v(" "),t("th",[e._v("drift")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("economic")]),e._v(" "),t("td",[e._v("28.77")]),e._v(" "),t("td",[e._v("20.79")])]),e._v(" "),t("tr",[t("td",[e._v("conservative")]),e._v(" "),t("td",[e._v("46.49")]),e._v(" "),t("td",[e._v("44.73")])])])]),e._v(" "),t("p",[e._v("As seen from the table, the error is quite high, but the positive drift suggests "),t("code",[e._v("estimatesmartfee")]),e._v(" prefers to overestimate to avoid transactions not confirming.")]),e._v(" "),t("p",[e._v('As we said in the introduction, network traffic is correlated with time and we have the timestamp of when the transaction has been first seen, however a ML model doesn\'t like plain numbers too much, but it behaves better with "number that repeats", like categories, so we are converting the timestamp in '),t("code",[e._v("day_of_week")]),e._v(" a number from 0 to 6, and "),t("code",[e._v("hours")]),e._v(" a number from 0 to 24.")]),e._v(" "),t("h4",{attrs:{id:"splitting"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#splitting"}},[e._v("#")]),e._v(" Splitting")]),e._v(" "),t("p",[e._v("The dataset is splitted in training and test data with a 80/20 proportion. As the name suggest the training part is used to train the model, the test is composed of other observations to test if the model is good with observations that has never seen (proving the model can generalize, not just memorizing the answer).")]),e._v(" "),t("p",[e._v("During the training the data is splitted again in 80/20 for training and validation respectively, validation is basically testing during training.")]),e._v(" "),t("p",[e._v("During splitting, the dataset is converted from a pandas data frame to tensorflow dataset, decreasing training times.")]),e._v(" "),t("h4",{attrs:{id:"preprocessing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#preprocessing"}},[e._v("#")]),e._v(" Preprocessing")]),e._v(" "),t("p",[e._v("The preprocessing phase is part of the model however it contains transformations without parameters trained by the model.\nThis transformations are useful because model trains better if data are in some format, and having this phase inside the model helps to avoid to prepare the data before feeding the model at prediction phase.")]),e._v(" "),t("p",[e._v("Our model performs 2 kind of preprocessing:")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("Normalization: model trains faster if numerical features have mean 0 and standard deviation equal to 1, so this layer is built by computing the "),t("code",[e._v("mean")]),e._v(" and "),t("code",[e._v("std")]),e._v(" from the series of a feature before training, and the model is feed with "),t("code",[e._v("(feature - mean)/std")]),e._v(". Our model normalize "),t("code",[e._v("confirms_in")]),e._v(" feature and all the buckets "),t("code",[e._v("a*")])])]),e._v(" "),t("li",[t("p",[e._v("one-hot vector: Numerical categories having a small number of different unique values like our "),t("code",[e._v("day_of_week")]),e._v(" and "),t("code",[e._v("hours")]),e._v(" could be trained better/faster by being converted in one hot vector. For example "),t("code",[e._v("day_of_week=6")]),e._v(" (Sunday) is converted in a vector "),t("code",[e._v("['0', '0', '0', '0', '0', '0', '1']")]),e._v(" while "),t("code",[e._v("day_of_week=5")]),e._v(" (Saturday) is converted in the vector "),t("code",[e._v("['0', '0', '0', '0', '0', '1', '0']")])])])]),e._v(" "),t("h4",{attrs:{id:"build"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#build"}},[e._v("#")]),e._v(" Build")]),e._v(" "),t("div",{staticClass:"language-python extra-class"},[t("pre",{pre:!0,attrs:{class:"language-python"}},[t("code",[e._v("all_features "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" tf"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("keras"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("layers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("concatenate"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("encoded_features"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\nx "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" tf"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("keras"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("layers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("Dense"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("64")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" activation"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"relu"')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("all_features"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\nx "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" tf"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("keras"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("layers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("Dense"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("64")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" activation"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"relu"')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("x"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\noutput "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" tf"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("keras"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("layers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("Dense"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" activation"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("clip"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("x"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\nmodel "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" tf"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("keras"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("Model"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("all_inputs"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" output"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\noptimizer "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" tf"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("optimizers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("Adam"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("learning_rate"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("0.01")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\nmodel"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token builtin"}},[e._v("compile")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("loss"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v("'mse'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n optimizer"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("optimizer"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n metrics"),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 string"}},[e._v("'mae'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v("'mse'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n")])])]),t("figure",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/20210125-091313-model.png",alt:"model graph"}})]),e._v(" "),t("p",[e._v("The model is fed with the "),t("code",[e._v("encoded_features")]),e._v(" coming from the processing phase, then there are 2 layers with 64 neurons each followed by one neuron giving the "),t("code",[e._v("fee_rate")]),e._v(" as output.")]),e._v(" "),t("p",[e._v("With this configurations the model has:")]),e._v(" "),t("ul",[t("li",[e._v("Total params: "),t("code",[e._v("7,412")])]),e._v(" "),t("li",[e._v("Trainable params: "),t("code",[e._v("7,361")])]),e._v(" "),t("li",[e._v("Non-trainable params: "),t("code",[e._v("51")])])]),e._v(" "),t("p",[e._v("Non-trainable params comes from the normalization layer and are computed in the pre-processing phase (it contains, for example, the mean of a series). Trainable parameters are values initialized randomly and changed during the training phase. The trainable parameters are "),t("code",[e._v("7,361")]),e._v(", this number comes from the following, every neuron has an associated bias and a weight for every element in the inputs, thus:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("48")]),e._v(" input_values_weights + "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v(" bias"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" * "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("64")]),e._v(" first_layer_neurons"),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 number"}},[e._v("64")]),e._v(" input_values_weights + "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v(" bias"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" * "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("64")]),e._v(" second layer neurons"),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 number"}},[e._v("64")]),e._v(" input values weights + "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v(" bias"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("49")]),e._v("*64+65*64+65 "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("7361")]),e._v("\n")])])]),t("p",[e._v("Honestly, neural network parameters are mostly the one taken from this tensorflow "),t("a",{attrs:{href:"https://www.tensorflow.org/tutorials/keras/regression",target:"_blank",rel:"noopener noreferrer"}},[e._v("example"),t("OutboundLink")],1),e._v(", we even tried to "),t("a",{attrs:{href:"https://www.tensorflow.org/tutorials/keras/keras_tuner",target:"_blank",rel:"noopener noreferrer"}},[e._v("tune hyperparameters"),t("OutboundLink")],1),e._v(", however, we decided to follow this "),t("a",{attrs:{href:"https://www.tensorflow.org/tutorials/keras/overfit_and_underfit#demonstrate_overfitting",target:"_blank",rel:"noopener noreferrer"}},[e._v("advice"),t("OutboundLink")],1),e._v(": "),t("em",[e._v('"The simplest way to prevent overfitting is to start with a small model:"')]),e._v(". We hope this work will attract other data scientists to this bitcoin problem, improving the model. We also think that a longer time for the data collection is needed to capture various situations.")]),e._v(" "),t("p",[e._v("A significant part of a ML model are the activation functions, "),t("code",[e._v("relu")]),e._v(" (Rectified Linear Unit) is one of the most used lately, because it's simple and works well as we learned in this "),t("a",{attrs:{href:"https://youtu.be/aircAruvnKk?t=1035",target:"_blank",rel:"noopener noreferrer"}},[e._v("introducing neural network video"),t("OutboundLink")],1),e._v(". "),t("code",[e._v("relu")]),e._v(" it's equal to zero for negative values and equal to the input for positive values. Being non-linear allows the whole model to be non-linear.")]),e._v(" "),t("p",[e._v("For the last layer it is different: we want to enforce a minimum for the output, which is the minimum relay fee "),t("code",[e._v("1.0")]),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn3",id:"fnref3"}},[e._v("[3]")])]),e._v(". One could not simply cut the output of the model after prediction because all the training would not consider this constraint. So we need to build a custom activation function that the model training will be able to use for the "),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/Gradient_descent#:~:text=Gradient%20descent%20is%20a%20first,the%20direction%20of%20steepest%20descent.",target:"_blank",rel:"noopener noreferrer"}},[e._v("gradient descent"),t("OutboundLink")],1),e._v(" optimization step. Luckily this is very simple using tensorflow primitives:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("def clip(x):\n min = tf.constant(1.0)\n return tf.where(tf.less(x, min), min, x)\n")])])]),t("p",[e._v("Another important part is the optimizer, when we first read the aforementioned "),t("a",{attrs:{href:"https://www.tensorflow.org/tutorials/keras/regression",target:"_blank",rel:"noopener noreferrer"}},[e._v("example"),t("OutboundLink")],1),e._v(" the optimizer used was "),t("code",[e._v("RMSProp")]),e._v(" however the example updated lately and we noticed the optimizer changed in favor of "),t("code",[e._v("Adam")]),e._v(" which we read is the "),t("a",{attrs:{href:"https://towardsdatascience.com/adam-latest-trends-in-deep-learning-optimization-6be9a291375c",target:"_blank",rel:"noopener noreferrer"}},[e._v("latest trend"),t("OutboundLink")],1),e._v(" in data science. We changed the model to use "),t("code",[e._v("Adam")]),e._v(" and effectively the training is faster with "),t("code",[e._v("Adam")]),e._v(" and even slightly lower error is achieved.\nAnother important parameter is the learning rate, which we set to "),t("code",[e._v("0.01")]),e._v(" after manual trials; however there might be space for improvements such as using "),t("a",{attrs:{href:"https://www.tensorflow.org/api_docs/python/tf/compat/v1/train/exponential_decay",target:"_blank",rel:"noopener noreferrer"}},[e._v("exponential decay"),t("OutboundLink")],1),e._v(", starting with an high learning rate and decreasing it through training epochs.")]),e._v(" "),t("p",[e._v('The last part of the model configuration is the loss function: the objective of the training is to find the minimum of this function. Usually for regression problem (the ones having a number as output, not a category) the most used is the Mean squared error (MSE). MSE is measured as the average of squared difference between predictions and actual observations, giving larger penalties to large difference because of the square. An interesting property is that the bigger the error the faster the changes is good at the beginning of the training, while slowing down when the model predicts better is desirable to avoid "jumping out" the local minimum.')]),e._v(" "),t("h4",{attrs:{id:"finally-the-model-training"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#finally-the-model-training"}},[e._v("#")]),e._v(" Finally, the model training")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("PATIENCE = 20\nMAX_EPOCHS = 200\n\ndef train():\n early_stop = keras.callbacks.EarlyStopping(monitor='val_loss', patience=PATIENCE)\n history = model.fit(train_ds, epochs=MAX_EPOCHS, validation_data=val_ds, verbose=1, callbacks=[early_stop])\n return history\n\nhistory = train()\n")])])]),t("p",[e._v("This steps is the core of the neural network, it takes a while, let's analyze the output:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("Epoch 1/200\n7559/7559 [==============================] - 34s 3ms/step - loss: 547.8023 - mae: 16.9547 - mse: 547.8023 - val_loss: 300.5965 - val_ma\ne: 11.9202 - val_mse: 300.5965\n...\nEpoch 158/200\n7559/7559 [==============================] - 31s 3ms/step - loss: 163.2548 - mae: 8.3126 - mse: 163.2548 - val_loss: 164.8296 - val_mae: 8.3402 - val_mse: 164.8296\n")])])]),t("p",[e._v("Training is done in epochs, under every epoch all the training data is iterated and model parameters updated to minimize the loss function.")]),e._v(" "),t("p",[e._v("The number "),t("code",[e._v("7559")]),e._v(" represent the number of steps. Theoretically the whole training data should be processed at once and parameters updated accordingly, however in practice this is infeasible for example for memory resource, thus the training happens in batch. In our case we have "),t("code",[e._v("1,934,999")]),e._v(" observations in the training set and our batch size is "),t("code",[e._v("256")]),e._v(", thus we have "),t("code",[e._v("1,437,841/256=7,558.58")]),e._v(" which by excess result in "),t("code",[e._v("7559")]),e._v(" steps.")]),e._v(" "),t("p",[e._v("The "),t("code",[e._v("~31s")]),e._v(" is the time it takes to process the epoch on a threadripper CPU but GPU or TPU could do better.")]),e._v(" "),t("p",[e._v("The value "),t("code",[e._v("loss")]),e._v(" is the MSE on the training data while "),t("code",[e._v("val_loss")]),e._v(" is the MSE value on the validation data. As far as we understand the separated validation data helps to detect the machine learning enemy, overfitting. Because in case of overfitting the value "),t("code",[e._v("loss")]),e._v(" continue to improve (almost indefinitely) while "),t("code",[e._v("val_loss")]),e._v(" start improving with the loss but a certain point diverge, indicating the network is memorizing the training data to improve "),t("code",[e._v("loss")]),e._v(" but in doing so losing generalizing capabilities.")]),e._v(" "),t("p",[e._v("Our model doesn't look to suffer overfitting cause "),t("code",[e._v("loss")]),e._v(" and "),t("code",[e._v("val_loss")]),e._v(" doesn't diverge during training")]),e._v(" "),t("figure",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/20210125-091313-train-history.png",alt:"train history"}})]),e._v(" "),t("p",[e._v("While we told the training to do 200 epochs, the training stopped at 158 because we added an "),t("code",[e._v("early_stop")]),e._v(" call back with "),t("code",[e._v("20")]),e._v(" as "),t("code",[e._v("PATIENCE")]),e._v(", meaning that after 20 epoch and no improvement in "),t("code",[e._v("val_loss")]),e._v(" the training is halted, saving time and potentially avoiding overfitting.")]),e._v(" "),t("h2",{attrs:{id:"the-prediction-phase"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-prediction-phase"}},[e._v("#")]),e._v(" The prediction phase")]),e._v(" "),t("p",[e._v("A "),t("a",{attrs:{href:"https://github.com/RCasatta/estimate_ml_fee",target:"_blank",rel:"noopener noreferrer"}},[e._v("prediction test tool"),t("OutboundLink")],1),e._v(" is available on github. At the moment it uses a bitcoin core node to provide network data for simplicity, but it queries it only for the mempool and the last 6 blocks, so it's something that also a light-client could do"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn4",id:"fnref4"}},[e._v("[4]")])]),e._v(".")]),e._v(" "),t("p",[e._v("The following chart is probably the best visualization to evaluate the model, on the x axis there is the real fee rate while on the y axis there is the prediction, the more the points are centered on the bisection, the more the model is good.\nWe can see the model is doing quite well, the MAE is 8 which is way lower than "),t("code",[e._v("estimatesmartfee")]),e._v(". However, there are big errors some times, in particular for prediction for fast confirmation ("),t("code",[e._v("confirms_in=1 or confirms_in=2")]),e._v(") as shown by the orange points. Creating a model only for blocks target greater than 2 instead of simply remove some observations may be an option.")]),e._v(" "),t("figure",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/20210125-091313-true-and-predictions.png",alt:"prediction results"}})]),e._v(" "),t("p",[e._v("The following chart is instead a distribution of the errors, which for good model should resemble the normal distribution centered in 0, and it loooks like the model is respecting that.")]),e._v(" "),t("figure",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/20210125-091313-error-distribution.png",alt:"error distribution"}})]),e._v(" "),t("h2",{attrs:{id:"conclusion-and-future-development"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion-and-future-development"}},[e._v("#")]),e._v(" Conclusion and future development")]),e._v(" "),t("p",[e._v("The results have shown deep neural network are a tool capable of good bitcoin transaction fee estimations; this suggests that further ML research in this area might be promising.")]),e._v(" "),t("p",[e._v("This is just a starting point, there are many future improvements such as:")]),e._v(" "),t("ul",[t("li",[e._v("Build a separate model with full knowledge, thus for full, always-connected nodes could be interesting and improve network resource allocation with respect to current estimators.")]),e._v(" "),t("li",[e._v("Tensorflow is a huge dependency, and since it contains all the feature to build and train a model, most of the feature are not needed in the prediction phase. In fact tensorflow lite exists which is specifically created for embedded and mobile devices; the "),t("a",{attrs:{href:"https://github.com/RCasatta/estimate_ml_fee",target:"_blank",rel:"noopener noreferrer"}},[e._v("prediction test tool"),t("OutboundLink")],1),e._v(" and the final integration in "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk"),t("OutboundLink")],1),e._v(" should use it.")]),e._v(" "),t("li",[e._v("Explore other fields to improve model predictions such as:\n"),t("ul",[t("li",[e._v("A bucket array of the transactions in the last 6 blocks with known fee rates. This should in particular help estimations with almost empty mempool.")]),e._v(" "),t("li",[e._v("Transaction weight")]),e._v(" "),t("li",[e._v("Time from last block")])])]),e._v(" "),t("li",[e._v("Some fields are very important and could benefit from pre-processing expansion, for instance applying "),t("a",{attrs:{href:"https://www.tensorflow.org/tutorials/structured_data/feature_columns#hashed_feature_columns",target:"_blank",rel:"noopener noreferrer"}},[e._v("hashed feature columns"),t("OutboundLink")],1),e._v(" to "),t("code",[e._v("confirms_in")]),e._v(".")]),e._v(" "),t("li",[e._v("Bitcoin logger could be improved by a merge command to unify raw logs files, reducing redundancy and consequently disk occupation.")]),e._v(" "),t("li",[e._v("The dataset could be created in multiple files to allow more parallelism and use less memory during training.")]),e._v(" "),t("li",[e._v("Saving the dataset in "),t("a",{attrs:{href:"https://www.tensorflow.org/tutorials/load_data/tfrecord",target:"_blank",rel:"noopener noreferrer"}},[e._v("TFRecord format"),t("OutboundLink")],1),e._v(" instead of CSV")]),e._v(" "),t("li",[e._v("At the moment we are training the model on a threadripper CPU, training the code on GPU or even TPU will be needed to decrease training time, especially because input data will grow.")]),e._v(" "),t("li",[e._v("The "),t("a",{attrs:{href:"https://github.com/RCasatta/estimate_ml_fee",target:"_blank",rel:"noopener noreferrer"}},[e._v("prediction test tool"),t("OutboundLink")],1),e._v(" should estimate only using the p2p bitcoin network, without requiring a node. This work would be propedeutic for "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk"),t("OutboundLink")],1),e._v(" integration")]),e._v(" "),t("li",[e._v("At the moment mempool buckets are multiple inputs "),t("code",[e._v("a*")]),e._v(" as show in the model graph; since they are related, is it possible to merge them in one TensorArray?")]),e._v(" "),t("li",[e._v("Sometimes the model does not learn and "),t("a",{attrs:{href:"https://github.com/RCasatta/bitcoin_logger/blob/master/notes.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("gets stuck"),t("OutboundLink")],1),e._v(". The reason is the "),t("code",[e._v("clip")]),e._v(" function applied in the last layer is constant for a value lower than 1. In this case, the derivative is 0 and the gradient descent doesn't know where to go. Instead of using the "),t("code",[e._v("clip")]),e._v(" function apply penalties to the loss function for values lower than 1.")]),e._v(" "),t("li",[e._v("There are issues regarding dead neurons (going to 0) or neurons with big weight, weight results should be monitored for this events, and also weight decay and L2 regularization should be explored.")]),e._v(" "),t("li",[e._v("Tune hyper-parameters technique should be re-tested.")]),e._v(" "),t("li",[e._v("Predictions should be monotonic decreasing for growing "),t("code",[e._v("confirms_in")]),e._v(" parameter; for obvious reason it doesn't make sense that an higher fee rate will result in a higher confirmation time. But since this is not enforced anywhere in the model, at the moment this could happen.")]),e._v(" "),t("li",[e._v("Since nodes with bloom filter disabled doesn't serve the mempool anymore, a model based only on last blocks should be evaluated.")])]),e._v(" "),t("h2",{attrs:{id:"acknowledgements"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#acknowledgements"}},[e._v("#")]),e._v(" Acknowledgements")]),e._v(" "),t("p",[e._v("Thanks to "),t("a",{attrs:{href:"https://squarecrypto.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Square crypto"),t("OutboundLink")],1),e._v(" for sponsoring this work and thanks to the reviewers: "),t("a",{attrs:{href:"https://twitter.com/LeoComandini",target:"_blank",rel:"noopener noreferrer"}},[e._v("Leonardo Comandini"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://twitter.com/domegabri",target:"_blank",rel:"noopener noreferrer"}},[e._v("Domenico Gabriele"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://twitter.com/afilini",target:"_blank",rel:"noopener noreferrer"}},[e._v("Alekos Filini"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://twitter.com/Ferdinando1970",target:"_blank",rel:"noopener noreferrer"}},[e._v("Ferdinando Ametrano"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("And also this tweet that remembered me "),t("a",{attrs:{href:"https://twitter.com/RCasatta",target:"_blank",rel:"noopener noreferrer"}},[e._v("I"),t("OutboundLink")],1),e._v(" had this work in my TODO list")]),e._v(" "),t("blockquote",{staticClass:"twitter-tweet"},[t("p",{attrs:{lang:"en",dir:"ltr"}},[e._v("I don't understand Machine Learning(ML), but is it horrible to use ML to predict bitcoin fees? "),t("br"),t("br"),e._v('I have heard tales of this "Deep Learning" thing where you throw a bunch of data at it and it gives you good results with high accuracy.')]),e._v("— sanket1729 (@sanket1729) "),t("a",{attrs:{href:"https://twitter.com/sanket1729/status/1336624662365822977?ref_src=twsrc%5Etfw"}},[e._v("December 9, 2020")])]),e._v(" "),t("script",{attrs:{async:"",src:"https://platform.twitter.com/widgets.js",charset:"utf-8"}}),e._v(" "),t("p",[e._v("This is the final part of the series. In the previous "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"}},[e._v("Part 1")]),e._v(" we talked about the problem and in "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"}},[e._v("Part 2")]),e._v(" we talked about the dataset.")],1),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("MAE is Mean Absolute Error, which is the average of the series built by the absolute difference between the real value and the estimation. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn2"}},[t("p",[e._v("drift like MAE, but without the absolute value "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref2"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn3"}},[t("p",[e._v("Most node won't relay transactions with fee lower than the min relay fee, which has a default of "),t("code",[e._v("1.0")]),e._v(" "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref3"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn4"}},[t("p",[e._v("An important issue emerged after the article came out, a bitcoin core client with bloom filter disabled (default as of 0.21) doesn't serve the mempool via p2p. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref4"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[58],{415:function(e,t,a){"use strict";a.r(t);var n=a(7),s=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 post is part 3 of 3 of a series. ("),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"}},[e._v("Part 1")]),e._v(", "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"}},[e._v("Part 2")]),e._v(")")],1),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#the-model"}},[e._v("The model")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#splitting"}},[e._v("Splitting")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#preprocessing"}},[e._v("Preprocessing")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#build"}},[e._v("Build")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#finally--training"}},[e._v("Finally, training")])])])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-prediction-phase"}},[e._v("The prediction phase")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#conclusion-and-future-development"}},[e._v("Conclusion and future development")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#acknowledgements"}},[e._v("Acknowledgements")])])]),e._v(" "),t("h2",{attrs:{id:"the-model"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-model"}},[e._v("#")]),e._v(" The model")]),e._v(" "),t("p",[e._v("The code building and training the model with "),t("a",{attrs:{href:"https://www.tensorflow.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("tensorflow"),t("OutboundLink")],1),e._v(" is available in "),t("a",{attrs:{href:"https://colab.research.google.com/drive/1yamwh8nE4NhmGButep-pfUT-1uRKs49a?usp=sharing",target:"_blank",rel:"noopener noreferrer"}},[e._v("google colab notebook"),t("OutboundLink")],1),e._v(" (jupyter notebook); you can also download the file as plain python and run it locally. At least 1 hour is needed to train the full model, but it heavily depends on the hardware available.")]),e._v(" "),t("p",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/20210125-091313-confirms_in-fee_rate.png",alt:"graph confirm_in blocks vs fee_rate"}})]),t("div",{attrs:{align:"center"}},[e._v("Do you want to choose the fee without a model? In the last 5 weeks a ~50 sat/vbyte transaction never took more than a day to confirm and a ~10 sat/vbyte never took more than a week")]),t("br"),t("p"),e._v(" "),t("p",[e._v("As a reference, in the code we have a calculation of the bitcoin core "),t("code",[e._v("estimatesmartfee")]),e._v(" MAE"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v(" and drift"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn2",id:"fnref2"}},[e._v("[2]")])]),e._v(".\nMAE is computed as "),t("code",[e._v("avg(abs(fee_rate - core_econ))")]),e._v(" when "),t("code",[e._v("core_econ")]),e._v(" is available (about 1.2M observations, sometime the value is not available when considered too old).")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("estimatesmartfee mode")]),e._v(" "),t("th",[e._v("MAE [satoshi/vbytes]")]),e._v(" "),t("th",[e._v("drift")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("economic")]),e._v(" "),t("td",[e._v("28.77")]),e._v(" "),t("td",[e._v("20.79")])]),e._v(" "),t("tr",[t("td",[e._v("conservative")]),e._v(" "),t("td",[e._v("46.49")]),e._v(" "),t("td",[e._v("44.73")])])])]),e._v(" "),t("p",[e._v("As seen from the table, the error is quite high, but the positive drift suggests "),t("code",[e._v("estimatesmartfee")]),e._v(" prefers to overestimate to avoid transactions not confirming.")]),e._v(" "),t("p",[e._v('As we said in the introduction, network traffic is correlated with time and we have the timestamp of when the transaction has been first seen, however a ML model doesn\'t like plain numbers too much, but it behaves better with "number that repeats", like categories, so we are converting the timestamp in '),t("code",[e._v("day_of_week")]),e._v(" a number from 0 to 6, and "),t("code",[e._v("hours")]),e._v(" a number from 0 to 24.")]),e._v(" "),t("h4",{attrs:{id:"splitting"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#splitting"}},[e._v("#")]),e._v(" Splitting")]),e._v(" "),t("p",[e._v("The dataset is splitted in training and test data with a 80/20 proportion. As the name suggest the training part is used to train the model, the test is composed of other observations to test if the model is good with observations that has never seen (proving the model can generalize, not just memorizing the answer).")]),e._v(" "),t("p",[e._v("During the training the data is splitted again in 80/20 for training and validation respectively, validation is basically testing during training.")]),e._v(" "),t("p",[e._v("During splitting, the dataset is converted from a pandas data frame to tensorflow dataset, decreasing training times.")]),e._v(" "),t("h4",{attrs:{id:"preprocessing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#preprocessing"}},[e._v("#")]),e._v(" Preprocessing")]),e._v(" "),t("p",[e._v("The preprocessing phase is part of the model however it contains transformations without parameters trained by the model.\nThis transformations are useful because model trains better if data are in some format, and having this phase inside the model helps to avoid to prepare the data before feeding the model at prediction phase.")]),e._v(" "),t("p",[e._v("Our model performs 2 kind of preprocessing:")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("Normalization: model trains faster if numerical features have mean 0 and standard deviation equal to 1, so this layer is built by computing the "),t("code",[e._v("mean")]),e._v(" and "),t("code",[e._v("std")]),e._v(" from the series of a feature before training, and the model is feed with "),t("code",[e._v("(feature - mean)/std")]),e._v(". Our model normalize "),t("code",[e._v("confirms_in")]),e._v(" feature and all the buckets "),t("code",[e._v("a*")])])]),e._v(" "),t("li",[t("p",[e._v("one-hot vector: Numerical categories having a small number of different unique values like our "),t("code",[e._v("day_of_week")]),e._v(" and "),t("code",[e._v("hours")]),e._v(" could be trained better/faster by being converted in one hot vector. For example "),t("code",[e._v("day_of_week=6")]),e._v(" (Sunday) is converted in a vector "),t("code",[e._v("['0', '0', '0', '0', '0', '0', '1']")]),e._v(" while "),t("code",[e._v("day_of_week=5")]),e._v(" (Saturday) is converted in the vector "),t("code",[e._v("['0', '0', '0', '0', '0', '1', '0']")])])])]),e._v(" "),t("h4",{attrs:{id:"build"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#build"}},[e._v("#")]),e._v(" Build")]),e._v(" "),t("div",{staticClass:"language-python extra-class"},[t("pre",{pre:!0,attrs:{class:"language-python"}},[t("code",[e._v("all_features "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" tf"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("keras"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("layers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("concatenate"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("encoded_features"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\nx "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" tf"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("keras"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("layers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("Dense"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("64")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" activation"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"relu"')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("all_features"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\nx "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" tf"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("keras"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("layers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("Dense"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("64")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" activation"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"relu"')]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("x"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\noutput "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" tf"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("keras"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("layers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("Dense"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" activation"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("clip"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("x"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\nmodel "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" tf"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("keras"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("Model"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("all_inputs"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" output"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\noptimizer "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" tf"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("optimizers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("Adam"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("learning_rate"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("0.01")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\nmodel"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),t("span",{pre:!0,attrs:{class:"token builtin"}},[e._v("compile")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("loss"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v("'mse'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n optimizer"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("optimizer"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n metrics"),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 string"}},[e._v("'mae'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v("'mse'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n")])])]),t("figure",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/20210125-091313-model.png",alt:"model graph"}})]),e._v(" "),t("p",[e._v("The model is fed with the "),t("code",[e._v("encoded_features")]),e._v(" coming from the processing phase, then there are 2 layers with 64 neurons each followed by one neuron giving the "),t("code",[e._v("fee_rate")]),e._v(" as output.")]),e._v(" "),t("p",[e._v("With this configurations the model has:")]),e._v(" "),t("ul",[t("li",[e._v("Total params: "),t("code",[e._v("7,412")])]),e._v(" "),t("li",[e._v("Trainable params: "),t("code",[e._v("7,361")])]),e._v(" "),t("li",[e._v("Non-trainable params: "),t("code",[e._v("51")])])]),e._v(" "),t("p",[e._v("Non-trainable params comes from the normalization layer and are computed in the pre-processing phase (it contains, for example, the mean of a series). Trainable parameters are values initialized randomly and changed during the training phase. The trainable parameters are "),t("code",[e._v("7,361")]),e._v(", this number comes from the following, every neuron has an associated bias and a weight for every element in the inputs, thus:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("48")]),e._v(" input_values_weights + "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v(" bias"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" * "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("64")]),e._v(" first_layer_neurons"),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 number"}},[e._v("64")]),e._v(" input_values_weights + "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v(" bias"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" * "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("64")]),e._v(" second layer neurons"),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 number"}},[e._v("64")]),e._v(" input values weights + "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v(" bias"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("49")]),e._v("*64+65*64+65 "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("7361")]),e._v("\n")])])]),t("p",[e._v("Honestly, neural network parameters are mostly the one taken from this tensorflow "),t("a",{attrs:{href:"https://www.tensorflow.org/tutorials/keras/regression",target:"_blank",rel:"noopener noreferrer"}},[e._v("example"),t("OutboundLink")],1),e._v(", we even tried to "),t("a",{attrs:{href:"https://www.tensorflow.org/tutorials/keras/keras_tuner",target:"_blank",rel:"noopener noreferrer"}},[e._v("tune hyperparameters"),t("OutboundLink")],1),e._v(", however, we decided to follow this "),t("a",{attrs:{href:"https://www.tensorflow.org/tutorials/keras/overfit_and_underfit#demonstrate_overfitting",target:"_blank",rel:"noopener noreferrer"}},[e._v("advice"),t("OutboundLink")],1),e._v(": "),t("em",[e._v('"The simplest way to prevent overfitting is to start with a small model:"')]),e._v(". We hope this work will attract other data scientists to this bitcoin problem, improving the model. We also think that a longer time for the data collection is needed to capture various situations.")]),e._v(" "),t("p",[e._v("A significant part of a ML model are the activation functions, "),t("code",[e._v("relu")]),e._v(" (Rectified Linear Unit) is one of the most used lately, because it's simple and works well as we learned in this "),t("a",{attrs:{href:"https://youtu.be/aircAruvnKk?t=1035",target:"_blank",rel:"noopener noreferrer"}},[e._v("introducing neural network video"),t("OutboundLink")],1),e._v(". "),t("code",[e._v("relu")]),e._v(" it's equal to zero for negative values and equal to the input for positive values. Being non-linear allows the whole model to be non-linear.")]),e._v(" "),t("p",[e._v("For the last layer it is different: we want to enforce a minimum for the output, which is the minimum relay fee "),t("code",[e._v("1.0")]),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn3",id:"fnref3"}},[e._v("[3]")])]),e._v(". One could not simply cut the output of the model after prediction because all the training would not consider this constraint. So we need to build a custom activation function that the model training will be able to use for the "),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/Gradient_descent#:~:text=Gradient%20descent%20is%20a%20first,the%20direction%20of%20steepest%20descent.",target:"_blank",rel:"noopener noreferrer"}},[e._v("gradient descent"),t("OutboundLink")],1),e._v(" optimization step. Luckily this is very simple using tensorflow primitives:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("def clip(x):\n min = tf.constant(1.0)\n return tf.where(tf.less(x, min), min, x)\n")])])]),t("p",[e._v("Another important part is the optimizer, when we first read the aforementioned "),t("a",{attrs:{href:"https://www.tensorflow.org/tutorials/keras/regression",target:"_blank",rel:"noopener noreferrer"}},[e._v("example"),t("OutboundLink")],1),e._v(" the optimizer used was "),t("code",[e._v("RMSProp")]),e._v(" however the example updated lately and we noticed the optimizer changed in favor of "),t("code",[e._v("Adam")]),e._v(" which we read is the "),t("a",{attrs:{href:"https://towardsdatascience.com/adam-latest-trends-in-deep-learning-optimization-6be9a291375c",target:"_blank",rel:"noopener noreferrer"}},[e._v("latest trend"),t("OutboundLink")],1),e._v(" in data science. We changed the model to use "),t("code",[e._v("Adam")]),e._v(" and effectively the training is faster with "),t("code",[e._v("Adam")]),e._v(" and even slightly lower error is achieved.\nAnother important parameter is the learning rate, which we set to "),t("code",[e._v("0.01")]),e._v(" after manual trials; however there might be space for improvements such as using "),t("a",{attrs:{href:"https://www.tensorflow.org/api_docs/python/tf/compat/v1/train/exponential_decay",target:"_blank",rel:"noopener noreferrer"}},[e._v("exponential decay"),t("OutboundLink")],1),e._v(", starting with an high learning rate and decreasing it through training epochs.")]),e._v(" "),t("p",[e._v('The last part of the model configuration is the loss function: the objective of the training is to find the minimum of this function. Usually for regression problem (the ones having a number as output, not a category) the most used is the Mean squared error (MSE). MSE is measured as the average of squared difference between predictions and actual observations, giving larger penalties to large difference because of the square. An interesting property is that the bigger the error the faster the changes is good at the beginning of the training, while slowing down when the model predicts better is desirable to avoid "jumping out" the local minimum.')]),e._v(" "),t("h4",{attrs:{id:"finally-the-model-training"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#finally-the-model-training"}},[e._v("#")]),e._v(" Finally, the model training")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("PATIENCE = 20\nMAX_EPOCHS = 200\n\ndef train():\n early_stop = keras.callbacks.EarlyStopping(monitor='val_loss', patience=PATIENCE)\n history = model.fit(train_ds, epochs=MAX_EPOCHS, validation_data=val_ds, verbose=1, callbacks=[early_stop])\n return history\n\nhistory = train()\n")])])]),t("p",[e._v("This steps is the core of the neural network, it takes a while, let's analyze the output:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("Epoch 1/200\n7559/7559 [==============================] - 34s 3ms/step - loss: 547.8023 - mae: 16.9547 - mse: 547.8023 - val_loss: 300.5965 - val_ma\ne: 11.9202 - val_mse: 300.5965\n...\nEpoch 158/200\n7559/7559 [==============================] - 31s 3ms/step - loss: 163.2548 - mae: 8.3126 - mse: 163.2548 - val_loss: 164.8296 - val_mae: 8.3402 - val_mse: 164.8296\n")])])]),t("p",[e._v("Training is done in epochs, under every epoch all the training data is iterated and model parameters updated to minimize the loss function.")]),e._v(" "),t("p",[e._v("The number "),t("code",[e._v("7559")]),e._v(" represent the number of steps. Theoretically the whole training data should be processed at once and parameters updated accordingly, however in practice this is infeasible for example for memory resource, thus the training happens in batch. In our case we have "),t("code",[e._v("1,934,999")]),e._v(" observations in the training set and our batch size is "),t("code",[e._v("256")]),e._v(", thus we have "),t("code",[e._v("1,437,841/256=7,558.58")]),e._v(" which by excess result in "),t("code",[e._v("7559")]),e._v(" steps.")]),e._v(" "),t("p",[e._v("The "),t("code",[e._v("~31s")]),e._v(" is the time it takes to process the epoch on a threadripper CPU but GPU or TPU could do better.")]),e._v(" "),t("p",[e._v("The value "),t("code",[e._v("loss")]),e._v(" is the MSE on the training data while "),t("code",[e._v("val_loss")]),e._v(" is the MSE value on the validation data. As far as we understand the separated validation data helps to detect the machine learning enemy, overfitting. Because in case of overfitting the value "),t("code",[e._v("loss")]),e._v(" continue to improve (almost indefinitely) while "),t("code",[e._v("val_loss")]),e._v(" start improving with the loss but a certain point diverge, indicating the network is memorizing the training data to improve "),t("code",[e._v("loss")]),e._v(" but in doing so losing generalizing capabilities.")]),e._v(" "),t("p",[e._v("Our model doesn't look to suffer overfitting cause "),t("code",[e._v("loss")]),e._v(" and "),t("code",[e._v("val_loss")]),e._v(" doesn't diverge during training")]),e._v(" "),t("figure",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/20210125-091313-train-history.png",alt:"train history"}})]),e._v(" "),t("p",[e._v("While we told the training to do 200 epochs, the training stopped at 158 because we added an "),t("code",[e._v("early_stop")]),e._v(" call back with "),t("code",[e._v("20")]),e._v(" as "),t("code",[e._v("PATIENCE")]),e._v(", meaning that after 20 epoch and no improvement in "),t("code",[e._v("val_loss")]),e._v(" the training is halted, saving time and potentially avoiding overfitting.")]),e._v(" "),t("h2",{attrs:{id:"the-prediction-phase"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-prediction-phase"}},[e._v("#")]),e._v(" The prediction phase")]),e._v(" "),t("p",[e._v("A "),t("a",{attrs:{href:"https://github.com/RCasatta/estimate_ml_fee",target:"_blank",rel:"noopener noreferrer"}},[e._v("prediction test tool"),t("OutboundLink")],1),e._v(" is available on github. At the moment it uses a bitcoin core node to provide network data for simplicity, but it queries it only for the mempool and the last 6 blocks, so it's something that also a light-client could do"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn4",id:"fnref4"}},[e._v("[4]")])]),e._v(".")]),e._v(" "),t("p",[e._v("The following chart is probably the best visualization to evaluate the model, on the x axis there is the real fee rate while on the y axis there is the prediction, the more the points are centered on the bisection, the more the model is good.\nWe can see the model is doing quite well, the MAE is 8 which is way lower than "),t("code",[e._v("estimatesmartfee")]),e._v(". However, there are big errors some times, in particular for prediction for fast confirmation ("),t("code",[e._v("confirms_in=1 or confirms_in=2")]),e._v(") as shown by the orange points. Creating a model only for blocks target greater than 2 instead of simply remove some observations may be an option.")]),e._v(" "),t("figure",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/20210125-091313-true-and-predictions.png",alt:"prediction results"}})]),e._v(" "),t("p",[e._v("The following chart is instead a distribution of the errors, which for good model should resemble the normal distribution centered in 0, and it loooks like the model is respecting that.")]),e._v(" "),t("figure",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/20210125-091313-error-distribution.png",alt:"error distribution"}})]),e._v(" "),t("h2",{attrs:{id:"conclusion-and-future-development"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion-and-future-development"}},[e._v("#")]),e._v(" Conclusion and future development")]),e._v(" "),t("p",[e._v("The results have shown deep neural network are a tool capable of good bitcoin transaction fee estimations; this suggests that further ML research in this area might be promising.")]),e._v(" "),t("p",[e._v("This is just a starting point, there are many future improvements such as:")]),e._v(" "),t("ul",[t("li",[e._v("Build a separate model with full knowledge, thus for full, always-connected nodes could be interesting and improve network resource allocation with respect to current estimators.")]),e._v(" "),t("li",[e._v("Tensorflow is a huge dependency, and since it contains all the feature to build and train a model, most of the feature are not needed in the prediction phase. In fact tensorflow lite exists which is specifically created for embedded and mobile devices; the "),t("a",{attrs:{href:"https://github.com/RCasatta/estimate_ml_fee",target:"_blank",rel:"noopener noreferrer"}},[e._v("prediction test tool"),t("OutboundLink")],1),e._v(" and the final integration in "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk"),t("OutboundLink")],1),e._v(" should use it.")]),e._v(" "),t("li",[e._v("Explore other fields to improve model predictions such as:\n"),t("ul",[t("li",[e._v("A bucket array of the transactions in the last 6 blocks with known fee rates. This should in particular help estimations with almost empty mempool.")]),e._v(" "),t("li",[e._v("Transaction weight")]),e._v(" "),t("li",[e._v("Time from last block")])])]),e._v(" "),t("li",[e._v("Some fields are very important and could benefit from pre-processing expansion, for instance applying "),t("a",{attrs:{href:"https://www.tensorflow.org/tutorials/structured_data/feature_columns#hashed_feature_columns",target:"_blank",rel:"noopener noreferrer"}},[e._v("hashed feature columns"),t("OutboundLink")],1),e._v(" to "),t("code",[e._v("confirms_in")]),e._v(".")]),e._v(" "),t("li",[e._v("Bitcoin logger could be improved by a merge command to unify raw logs files, reducing redundancy and consequently disk occupation.")]),e._v(" "),t("li",[e._v("The dataset could be created in multiple files to allow more parallelism and use less memory during training.")]),e._v(" "),t("li",[e._v("Saving the dataset in "),t("a",{attrs:{href:"https://www.tensorflow.org/tutorials/load_data/tfrecord",target:"_blank",rel:"noopener noreferrer"}},[e._v("TFRecord format"),t("OutboundLink")],1),e._v(" instead of CSV")]),e._v(" "),t("li",[e._v("At the moment we are training the model on a threadripper CPU, training the code on GPU or even TPU will be needed to decrease training time, especially because input data will grow.")]),e._v(" "),t("li",[e._v("The "),t("a",{attrs:{href:"https://github.com/RCasatta/estimate_ml_fee",target:"_blank",rel:"noopener noreferrer"}},[e._v("prediction test tool"),t("OutboundLink")],1),e._v(" should estimate only using the p2p bitcoin network, without requiring a node. This work would be propedeutic for "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk"),t("OutboundLink")],1),e._v(" integration")]),e._v(" "),t("li",[e._v("At the moment mempool buckets are multiple inputs "),t("code",[e._v("a*")]),e._v(" as show in the model graph; since they are related, is it possible to merge them in one TensorArray?")]),e._v(" "),t("li",[e._v("Sometimes the model does not learn and "),t("a",{attrs:{href:"https://github.com/RCasatta/bitcoin_logger/blob/master/notes.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("gets stuck"),t("OutboundLink")],1),e._v(". The reason is the "),t("code",[e._v("clip")]),e._v(" function applied in the last layer is constant for a value lower than 1. In this case, the derivative is 0 and the gradient descent doesn't know where to go. Instead of using the "),t("code",[e._v("clip")]),e._v(" function apply penalties to the loss function for values lower than 1.")]),e._v(" "),t("li",[e._v("There are issues regarding dead neurons (going to 0) or neurons with big weight, weight results should be monitored for this events, and also weight decay and L2 regularization should be explored.")]),e._v(" "),t("li",[e._v("Tune hyper-parameters technique should be re-tested.")]),e._v(" "),t("li",[e._v("Predictions should be monotonic decreasing for growing "),t("code",[e._v("confirms_in")]),e._v(" parameter; for obvious reason it doesn't make sense that an higher fee rate will result in a higher confirmation time. But since this is not enforced anywhere in the model, at the moment this could happen.")]),e._v(" "),t("li",[e._v("Since nodes with bloom filter disabled doesn't serve the mempool anymore, a model based only on last blocks should be evaluated.")])]),e._v(" "),t("h2",{attrs:{id:"acknowledgements"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#acknowledgements"}},[e._v("#")]),e._v(" Acknowledgements")]),e._v(" "),t("p",[e._v("Thanks to "),t("a",{attrs:{href:"https://squarecrypto.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Square crypto"),t("OutboundLink")],1),e._v(" for sponsoring this work and thanks to the reviewers: "),t("a",{attrs:{href:"https://twitter.com/LeoComandini",target:"_blank",rel:"noopener noreferrer"}},[e._v("Leonardo Comandini"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://twitter.com/domegabri",target:"_blank",rel:"noopener noreferrer"}},[e._v("Domenico Gabriele"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://twitter.com/afilini",target:"_blank",rel:"noopener noreferrer"}},[e._v("Alekos Filini"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://twitter.com/Ferdinando1970",target:"_blank",rel:"noopener noreferrer"}},[e._v("Ferdinando Ametrano"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("And also this tweet that remembered me "),t("a",{attrs:{href:"https://twitter.com/RCasatta",target:"_blank",rel:"noopener noreferrer"}},[e._v("I"),t("OutboundLink")],1),e._v(" had this work in my TODO list")]),e._v(" "),t("blockquote",{staticClass:"twitter-tweet"},[t("p",{attrs:{lang:"en",dir:"ltr"}},[e._v("I don't understand Machine Learning(ML), but is it horrible to use ML to predict bitcoin fees? "),t("br"),t("br"),e._v('I have heard tales of this "Deep Learning" thing where you throw a bunch of data at it and it gives you good results with high accuracy.')]),e._v("— sanket1729 (@sanket1729) "),t("a",{attrs:{href:"https://twitter.com/sanket1729/status/1336624662365822977?ref_src=twsrc%5Etfw"}},[e._v("December 9, 2020")])]),e._v(" "),t("script",{attrs:{async:"",src:"https://platform.twitter.com/widgets.js",charset:"utf-8"}}),e._v(" "),t("p",[e._v("This is the final part of the series. In the previous "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"}},[e._v("Part 1")]),e._v(" we talked about the problem and in "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"}},[e._v("Part 2")]),e._v(" we talked about the dataset.")],1),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("MAE is Mean Absolute Error, which is the average of the series built by the absolute difference between the real value and the estimation. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn2"}},[t("p",[e._v("drift like MAE, but without the absolute value "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref2"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn3"}},[t("p",[e._v("Most node won't relay transactions with fee lower than the min relay fee, which has a default of "),t("code",[e._v("1.0")]),e._v(" "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref3"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn4"}},[t("p",[e._v("An important issue emerged after the article came out, a bitcoin core client with bloom filter disabled (default as of 0.21) doesn't serve the mempool via p2p. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref4"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/59.7e9a8d23.js b/assets/js/59.10a6a8e7.js similarity index 99% rename from assets/js/59.7e9a8d23.js rename to assets/js/59.10a6a8e7.js index 4e9bb3d3ca..e48d0d319a 100644 --- a/assets/js/59.7e9a8d23.js +++ b/assets/js/59.10a6a8e7.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{417: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([[59],{416: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/65.2f993724.js b/assets/js/65.e47b714e.js similarity index 99% rename from assets/js/65.2f993724.js rename to assets/js/65.e47b714e.js index c8c6943d8c..536710ef54 100644 --- a/assets/js/65.2f993724.js +++ b/assets/js/65.e47b714e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[65],{424:function(e,t,o){"use strict";o.r(t);var a=o(7),r=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("BDK relies heavily on the Miniscript language to support arbitrary output descriptors seamlessly.")]),e._v(" "),t("p",[e._v("The Miniscript compiler models arbitrary spending policies and generates an optimized bitcoin script that enforces said policies when executed in the bitcoin network.")]),e._v(" "),t("p",[e._v("Recently a bug has been discovered in the Miniscript type system, which can cause an unsafe bitcoin script to be generated in some cases, described in detail below. Affected UTXOs can be spent by malicious\nminers without providing any valid signature, effectively bypassing all the signature checks in the script.")]),e._v(" "),t("p",[e._v("We analyzed mainnet blocks starting from the beginning of 2020 and "),t("strong",[e._v("found no transaction spending from a script which is affected by this bug")]),e._v(", which leads us to believe that nobody is currenly using this\nstructure in production. Nonetheless, we still recommend upgrading as soon as possible.")]),e._v(" "),t("h2",{attrs:{id:"how-to-check-if-you-are-vulnerable"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#how-to-check-if-you-are-vulnerable"}},[e._v("#")]),e._v(" How to check if you are vulnerable")]),e._v(" "),t("p",[e._v("As a rule of thumb, if your descriptor contains a "),t("code",[e._v("thresh()")]),e._v(" with either an "),t("code",[e._v("older()")]),e._v(" or "),t("code",[e._v("after()")]),e._v(" inside, then you are probably vulnerable.")]),e._v(" "),t("p",[e._v("Specifically, the following conditions must be met for a descriptor to be vulnerable:")]),e._v(" "),t("ol",[t("li",[t("code",[e._v("thresh")]),e._v(" fragment.")]),e._v(" "),t("li",[t("code",[e._v("older")]),e._v(" or "),t("code",[e._v("after")]),e._v(" must be a direct child.")]),e._v(" "),t("li",[t("code",[e._v("older")]),e._v(" must have a wrapper "),t("code",[e._v("d:")]),e._v(" around it.")])]),e._v(" "),t("p",[e._v("Moreover, for a miner to be able to steal the funds from a vulnerable script, the timelock (relative or absolute) must be expired.")]),e._v(" "),t("p",[e._v("For example, the descriptor shown in our "),t("a",{attrs:{href:"/blog/2021/02/spending-policy-demo"}},[e._v("previous blog post")]),e._v(", "),t("code",[e._v("wsh(thresh(3,pk(Alice),s:pk(Bob),s:pk(Carol),sdv:older(2)))")]),e._v(", is actually affected by this vulnerability because it uses a "),t("code",[e._v("thresh()")]),e._v("\ncontaining an "),t("code",[e._v("older()")]),e._v(" with "),t("code",[e._v("sdv:")]),e._v(" wrappers (which is just a shorthand for "),t("code",[e._v("s: d: v:")]),e._v(").")]),e._v(" "),t("p",[e._v("For the technical details check out the "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript/blob/70191e5a32f7c072d32476ba0b8861ca57af3df8/doc/security_report_2022_04_20.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("security advisory"),t("OutboundLink")],1),e._v(" published by the maintainer of "),t("code",[e._v("rust-miniscript")]),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"next-steps"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#next-steps"}},[e._v("#")]),e._v(" Next steps")]),e._v(" "),t("h3",{attrs:{id:"if-you-are-affected"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#if-you-are-affected"}},[e._v("#")]),e._v(" If you are affected")]),e._v(" "),t("p",[e._v("If you are affected by the vulnerability, "),t("strong",[e._v("DO NOT SPEND THE FUNDS")]),e._v(", as they could be stolen by a malicious miner.")]),e._v(" "),t("p",[e._v("We are in contact with a large mining pool that could include your transaction directly without broadcasting it to the network: contact us and we'll help you out.")]),e._v(" "),t("h3",{attrs:{id:"everybody"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#everybody"}},[e._v("#")]),e._v(" Everybody")]),e._v(" "),t("p",[e._v("Even if you are not affected please update BDK, or at least "),t("code",[e._v("rust-miniscript")]),e._v(" as soon as possible.")]),e._v(" "),t("p",[e._v("BDK version "),t("code",[e._v("0.18.0")]),e._v(", released on April 20, addresses this issue by requiring the fixed "),t("code",[e._v("6.1.x")]),e._v(" version of "),t("code",[e._v("rust-miniscript")]),e._v(". If you need to stay on an older version of BDK, you can run "),t("code",[e._v("cargo update")]),e._v(" to update "),t("code",[e._v("rust-miniscript")]),e._v(" to one\nof the non-vulnerable versions:")]),e._v(" "),t("ul",[t("li",[t("code",[e._v("6.1.0")])]),e._v(" "),t("li",[t("code",[e._v("5.2.0")])]),e._v(" "),t("li",[t("code",[e._v("4.1.0")])]),e._v(" "),t("li",[t("code",[e._v("3.1.0")])]),e._v(" "),t("li",[t("code",[e._v("2.1.0")])]),e._v(" "),t("li",[t("code",[e._v("1.1.0")])])]),e._v(" "),t("h2",{attrs:{id:"consequences-of-the-update"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#consequences-of-the-update"}},[e._v("#")]),e._v(" Consequences of the update")]),e._v(" "),t("p",[e._v("Since this bug is in the bitcoin script produced by Miniscript, fixing the vulnerabiliy will also make the bitcoin script change: this means that if you don't see your funds in your wallet after the update\nyour script was vulnerable to this bug. Contact us for help sweeping the funds from the old to the newer script.")]),e._v(" "),t("p",[e._v("Also, if your wallet considers a previously-valid descriptor invalid, it also meant it was vulnerable. It can generally be fixed by adding a "),t("code",[e._v("n:")]),e._v(" wrapper to the timelock (i.e. "),t("code",[e._v("sdv:older()")]),e._v(" would become "),t("code",[e._v("sndv:older()")]),e._v("),\nbut that will cause your script to change.")]),e._v(" "),t("p",[e._v("If you were not using a vulnerable script, then nothing should change for you. Please file an issue if you notice other problems after the upgrade.")]),e._v(" "),t("h2",{attrs:{id:"footnote-how-we-analyzed-the-blockchain"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#footnote-how-we-analyzed-the-blockchain"}},[e._v("#")]),e._v(" Footnote: How we analyzed the blockchain")]),e._v(" "),t("p",[e._v("We used the "),t("a",{attrs:{href:"https://github.com/RCasatta/blocks_iterator",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("blocks_iterator")]),t("OutboundLink")],1),e._v(" crate to analyze bitcoin blocks starting from early 2020 (initial release date of miniscript) looking for transactions spending from vulnerable scripts.\nThe tool we used has been "),t("a",{attrs:{href:"https://github.com/afilini/miniscript-bug-check-blocks",target:"_blank",rel:"noopener noreferrer"}},[e._v("published on GitHub"),t("OutboundLink")],1),e._v(" and can be run by anyone who wants to verify our claim.")]),e._v(" "),t("p",[e._v("We would like to thank "),t("a",{attrs:{href:"https://github.com/sanket1729",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("sanket1729")]),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/RCasatta",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("RCasatta")]),t("OutboundLink")],1),e._v(" for their help implementing and running the tool on the bitcoin mainnet blockchain.")]),e._v(" "),t("h2",{attrs:{id:"correction-2022-04-25"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#correction-2022-04-25"}},[e._v("#")]),e._v(" Correction (2022-04-25)")]),e._v(" "),t("p",[e._v("By re-running the tool on the mainnet blockchain for a second time we were able to find one vulnerable output, created and spent a long time ago (around the initial announcement and release date of Miniscript).")]),e._v(" "),t("p",[e._v("The amount was negligible, so we believe this was a small test performed by somebody to play with Miniscript.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[65],{423:function(e,t,o){"use strict";o.r(t);var a=o(7),r=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("BDK relies heavily on the Miniscript language to support arbitrary output descriptors seamlessly.")]),e._v(" "),t("p",[e._v("The Miniscript compiler models arbitrary spending policies and generates an optimized bitcoin script that enforces said policies when executed in the bitcoin network.")]),e._v(" "),t("p",[e._v("Recently a bug has been discovered in the Miniscript type system, which can cause an unsafe bitcoin script to be generated in some cases, described in detail below. Affected UTXOs can be spent by malicious\nminers without providing any valid signature, effectively bypassing all the signature checks in the script.")]),e._v(" "),t("p",[e._v("We analyzed mainnet blocks starting from the beginning of 2020 and "),t("strong",[e._v("found no transaction spending from a script which is affected by this bug")]),e._v(", which leads us to believe that nobody is currenly using this\nstructure in production. Nonetheless, we still recommend upgrading as soon as possible.")]),e._v(" "),t("h2",{attrs:{id:"how-to-check-if-you-are-vulnerable"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#how-to-check-if-you-are-vulnerable"}},[e._v("#")]),e._v(" How to check if you are vulnerable")]),e._v(" "),t("p",[e._v("As a rule of thumb, if your descriptor contains a "),t("code",[e._v("thresh()")]),e._v(" with either an "),t("code",[e._v("older()")]),e._v(" or "),t("code",[e._v("after()")]),e._v(" inside, then you are probably vulnerable.")]),e._v(" "),t("p",[e._v("Specifically, the following conditions must be met for a descriptor to be vulnerable:")]),e._v(" "),t("ol",[t("li",[t("code",[e._v("thresh")]),e._v(" fragment.")]),e._v(" "),t("li",[t("code",[e._v("older")]),e._v(" or "),t("code",[e._v("after")]),e._v(" must be a direct child.")]),e._v(" "),t("li",[t("code",[e._v("older")]),e._v(" must have a wrapper "),t("code",[e._v("d:")]),e._v(" around it.")])]),e._v(" "),t("p",[e._v("Moreover, for a miner to be able to steal the funds from a vulnerable script, the timelock (relative or absolute) must be expired.")]),e._v(" "),t("p",[e._v("For example, the descriptor shown in our "),t("a",{attrs:{href:"/blog/2021/02/spending-policy-demo"}},[e._v("previous blog post")]),e._v(", "),t("code",[e._v("wsh(thresh(3,pk(Alice),s:pk(Bob),s:pk(Carol),sdv:older(2)))")]),e._v(", is actually affected by this vulnerability because it uses a "),t("code",[e._v("thresh()")]),e._v("\ncontaining an "),t("code",[e._v("older()")]),e._v(" with "),t("code",[e._v("sdv:")]),e._v(" wrappers (which is just a shorthand for "),t("code",[e._v("s: d: v:")]),e._v(").")]),e._v(" "),t("p",[e._v("For the technical details check out the "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript/blob/70191e5a32f7c072d32476ba0b8861ca57af3df8/doc/security_report_2022_04_20.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("security advisory"),t("OutboundLink")],1),e._v(" published by the maintainer of "),t("code",[e._v("rust-miniscript")]),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"next-steps"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#next-steps"}},[e._v("#")]),e._v(" Next steps")]),e._v(" "),t("h3",{attrs:{id:"if-you-are-affected"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#if-you-are-affected"}},[e._v("#")]),e._v(" If you are affected")]),e._v(" "),t("p",[e._v("If you are affected by the vulnerability, "),t("strong",[e._v("DO NOT SPEND THE FUNDS")]),e._v(", as they could be stolen by a malicious miner.")]),e._v(" "),t("p",[e._v("We are in contact with a large mining pool that could include your transaction directly without broadcasting it to the network: contact us and we'll help you out.")]),e._v(" "),t("h3",{attrs:{id:"everybody"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#everybody"}},[e._v("#")]),e._v(" Everybody")]),e._v(" "),t("p",[e._v("Even if you are not affected please update BDK, or at least "),t("code",[e._v("rust-miniscript")]),e._v(" as soon as possible.")]),e._v(" "),t("p",[e._v("BDK version "),t("code",[e._v("0.18.0")]),e._v(", released on April 20, addresses this issue by requiring the fixed "),t("code",[e._v("6.1.x")]),e._v(" version of "),t("code",[e._v("rust-miniscript")]),e._v(". If you need to stay on an older version of BDK, you can run "),t("code",[e._v("cargo update")]),e._v(" to update "),t("code",[e._v("rust-miniscript")]),e._v(" to one\nof the non-vulnerable versions:")]),e._v(" "),t("ul",[t("li",[t("code",[e._v("6.1.0")])]),e._v(" "),t("li",[t("code",[e._v("5.2.0")])]),e._v(" "),t("li",[t("code",[e._v("4.1.0")])]),e._v(" "),t("li",[t("code",[e._v("3.1.0")])]),e._v(" "),t("li",[t("code",[e._v("2.1.0")])]),e._v(" "),t("li",[t("code",[e._v("1.1.0")])])]),e._v(" "),t("h2",{attrs:{id:"consequences-of-the-update"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#consequences-of-the-update"}},[e._v("#")]),e._v(" Consequences of the update")]),e._v(" "),t("p",[e._v("Since this bug is in the bitcoin script produced by Miniscript, fixing the vulnerabiliy will also make the bitcoin script change: this means that if you don't see your funds in your wallet after the update\nyour script was vulnerable to this bug. Contact us for help sweeping the funds from the old to the newer script.")]),e._v(" "),t("p",[e._v("Also, if your wallet considers a previously-valid descriptor invalid, it also meant it was vulnerable. It can generally be fixed by adding a "),t("code",[e._v("n:")]),e._v(" wrapper to the timelock (i.e. "),t("code",[e._v("sdv:older()")]),e._v(" would become "),t("code",[e._v("sndv:older()")]),e._v("),\nbut that will cause your script to change.")]),e._v(" "),t("p",[e._v("If you were not using a vulnerable script, then nothing should change for you. Please file an issue if you notice other problems after the upgrade.")]),e._v(" "),t("h2",{attrs:{id:"footnote-how-we-analyzed-the-blockchain"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#footnote-how-we-analyzed-the-blockchain"}},[e._v("#")]),e._v(" Footnote: How we analyzed the blockchain")]),e._v(" "),t("p",[e._v("We used the "),t("a",{attrs:{href:"https://github.com/RCasatta/blocks_iterator",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("blocks_iterator")]),t("OutboundLink")],1),e._v(" crate to analyze bitcoin blocks starting from early 2020 (initial release date of miniscript) looking for transactions spending from vulnerable scripts.\nThe tool we used has been "),t("a",{attrs:{href:"https://github.com/afilini/miniscript-bug-check-blocks",target:"_blank",rel:"noopener noreferrer"}},[e._v("published on GitHub"),t("OutboundLink")],1),e._v(" and can be run by anyone who wants to verify our claim.")]),e._v(" "),t("p",[e._v("We would like to thank "),t("a",{attrs:{href:"https://github.com/sanket1729",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("sanket1729")]),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/RCasatta",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("RCasatta")]),t("OutboundLink")],1),e._v(" for their help implementing and running the tool on the bitcoin mainnet blockchain.")]),e._v(" "),t("h2",{attrs:{id:"correction-2022-04-25"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#correction-2022-04-25"}},[e._v("#")]),e._v(" Correction (2022-04-25)")]),e._v(" "),t("p",[e._v("By re-running the tool on the mainnet blockchain for a second time we were able to find one vulnerable output, created and spent a long time ago (around the initial announcement and release date of Miniscript).")]),e._v(" "),t("p",[e._v("The amount was negligible, so we believe this was a small test performed by somebody to play with Miniscript.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/66.1ec98713.js b/assets/js/66.62fed6f7.js similarity index 99% rename from assets/js/66.1ec98713.js rename to assets/js/66.62fed6f7.js index dba0b3ab9c..b2b91af1b1 100644 --- a/assets/js/66.1ec98713.js +++ b/assets/js/66.62fed6f7.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[66],{423:function(t,a,e){"use strict";e.r(a);var s=e(7),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("p",[t._v("A new release of BDK is finally out! The "),a("code",[t._v("v0.2.0")]),t._v(" release contains many exciting new features, bug fixes and overall improvements. This release also marks the beginning of our new regular "),a("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/7d6cd6d4f5a26194830f90e6460e0b82bddf9594/DEVELOPMENT_CYCLE.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("release schedule"),a("OutboundLink")],1),t._v(", which will see us pushing\nout a new release every four weeks. We think this is a good compromise to ensure that developers using BDK have access to all the new features and fixes as soon as possible, at least while the library is still evolving very fast as it is\nright now. After "),a("code",[t._v("v1.0.0")]),t._v(" we will increase this time to a more relaxed 6 weeks.")]),t._v(" "),a("p",[t._v("You can find the full "),a("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/7d6cd6d4f5a26194830f90e6460e0b82bddf9594/CHANGELOG.md#v020---010-beta1",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.2.0 changelog"),a("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),a("h2",{attrs:{id:"whats-new-in-v020"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v020"}},[t._v("#")]),t._v(" What's new in v0.2.0")]),t._v(" "),a("p",[t._v("Considering the sheer amount of new things being added we don't have room here to explain every new feature in detail, but below is a quick overview of some you could find useful in your projects.")]),t._v(" "),a("h3",{attrs:{id:"a-new-name"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#a-new-name"}},[t._v("#")]),t._v(" A new name")]),t._v(" "),a("p",[t._v("The "),a("code",[t._v("0.1.0-beta.1")]),t._v(" release was tagged right before the project was renamed "),a("code",[t._v("bdk")]),t._v(': at that time the library was still called "Magical Bitcoin Library", or '),a("code",[t._v("magical")]),t._v(" for short. With this release we have now renamed it to "),a("code",[t._v("bdk")]),t._v(". If you were using the library\nbefore, it should only be a matter of renaming the imports to match the new name. Alternatively you can also rename "),a("code",[t._v("bdk")]),t._v(" to "),a("code",[t._v("magical")]),t._v(" in your Cargo.toml, but you'll still have to do some changes here and there because the APIs have been changed in a few\nplaces.")]),t._v(" "),a("p",[t._v("This release being particularly large contains a few different API-breaking changes: going forward we expect to make the interface more and more stable, which in turn will make applying updates easier.")]),t._v(" "),a("h3",{attrs:{id:"branch-and-bound-coin-selection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#branch-and-bound-coin-selection"}},[t._v("#")]),t._v(" Branch and Bound coin selection")]),t._v(" "),a("p",[t._v('We now support the state-of-the-art coin selection algorithm called "branch and bound", with an implementation derived straight from Bitcoin Core. This algorithm is now enabled by default, but it can be replaced with a different one (either\nthe old default, '),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/coin_selection/struct.LargestFirstCoinSelection.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("LargestFirstCoinSelection")]),a("OutboundLink")],1),t._v(" or a custom "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("CoinSelectionAlgorithm")]),a("OutboundLink")],1),t._v(") by using the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/tx_builder/struct.TxBuilder.html#method.coin_selection",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("TxBuilder::coin_selection()")]),a("OutboundLink")],1),t._v(" option.")]),t._v(" "),a("p",[t._v("Branch and bound works by trying to find a set of inputs that perfectly matches the amount being sent by a transaction, to avoid making an extra change output which takes up more space in the transaction, requires more fees, and in general lowers the privacy\nof a user if the change is later spent together with other outputs.")]),t._v(" "),a("h3",{attrs:{id:"key-generation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#key-generation"}},[t._v("#")]),t._v(" Key generation")]),t._v(" "),a("p",[t._v("If you need to generate a new "),a("code",[t._v("bip32::ExtendedPrivKey")]),t._v(", or perhaps a new BIP39 mnemonic, you can use the unified "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.GeneratableKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("GeneratableKey")]),a("OutboundLink")],1),t._v(" trait to do so: paired with "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.GeneratableDefaultOptions.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("GeneratableDefaultOptions")]),a("OutboundLink")],1),t._v(" they provide many different ways to generate keys,\nwith or without a custom source of entropy, and with or without customized options.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratableKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratableDefaultOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKeyGenerateOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" default_options_key "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_default")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" custom_options_key "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKeyGenerateOptions")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" compressed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"generic-key-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#generic-key-types"}},[t._v("#")]),t._v(" Generic key types")]),t._v(" "),a("p",[t._v("With this update there's now a generalized trait for keys that can be used in descriptors, which is called "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ToDescriptorKey")]),a("OutboundLink")],1),t._v(". This trait is already implemented for the native "),a("code",[t._v("rust-bitcoin")]),t._v(" key types, like "),a("code",[t._v("PrivateKey")]),t._v(", "),a("code",[t._v("PublicKey")]),t._v(", "),a("code",[t._v("bip32::ExtendedPrivKey")]),t._v("\nand "),a("code",[t._v("bip32::ExtendedPubKey")]),t._v(". It's also implemented for BIP39 mnemonic and seeds, when the the opt-in "),a("code",[t._v("keys-bip39")]),t._v(" feature is enabled. As always, being this a public trait, you can also implement it for custom types to better suit your needs.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ScriptContext")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ToDescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyKeyType")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("to_descriptor_key")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom conversion to `bitcoin::PrivateKey`")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" privkey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bitcoin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n privkey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_descriptor_key")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("If your custom key type is simply a different representation of an "),a("code",[t._v("xprv")]),t._v(" or "),a("code",[t._v("xpub")]),t._v(", you can also consider implementing the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.DerivableKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("DerivableKey")]),a("OutboundLink")],1),t._v(" trait instead: for a type "),a("code",[t._v("K")]),t._v(" that implements "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.DerivableKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("DerivableKey")]),a("OutboundLink")],1),t._v(", the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ToDescriptorKey")]),a("OutboundLink")],1),t._v(" trait is automatically\nimplemented for the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html#impl-ToDescriptorKey%3CCtx%3E-for-(T%2C%20DerivationPath)",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("(K, bip32::DerivationPath)")]),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html#impl-ToDescriptorKey%3CCtx%3E-for-(T%2C%20KeySource%2C%20DerivationPath)",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("(K, bip32::KeySource, bip32::DerivationPath)")]),a("OutboundLink")],1),t._v(" tuples.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ScriptContext")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivableKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyKeyType")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("add_metadata")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n origin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Option")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeySource")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n derivation_path"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom conversion to `bip32::ExtendedPrivKey`")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xprv"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bip32"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n xprv"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_metadata")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("origin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" derivation_path"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"descriptor-templates"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-templates"}},[t._v("#")]),t._v(" Descriptor templates")]),t._v(" "),a("p",[t._v("Instead of having to serialize keys to strings using "),a("code",[t._v("format!()")]),t._v(" just to place them somewhere inside a descriptor, you can now use descriptor templates to build a descriptor starting from a key and some other options\nin a couple of lines of code. You can use one of the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/descriptor/template/index.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("provided templates"),a("OutboundLink")],1),t._v(" or make a custom one by implementing the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/descriptor/template/trait.DescriptorTemplate.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("DescriptorTemplate")]),a("OutboundLink")],1),t._v(" trait on a "),a("code",[t._v("struct")]),t._v(" or "),a("code",[t._v("enum")]),t._v(".")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" key "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bip32"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"..."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("OfflineWallet")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("_"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("new_offline")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("BIP84")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("clone")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("External")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("BIP84")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Internal")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"easier-creation-of-blockchain-and-database"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#easier-creation-of-blockchain-and-database"}},[t._v("#")]),t._v(" Easier creation of "),a("code",[t._v("Blockchain")]),t._v(" and "),a("code",[t._v("Database")])]),t._v(" "),a("p",[t._v("We've added a new way to create a "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" instance from a configuration, with the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.ConfigurableBlockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ConfigurableBlockchain")]),a("OutboundLink")],1),t._v(" trait. All the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" types provided by the library implement this trait, which allows you to easily build an\ninstance of them starting from a configuration "),a("code",[t._v("struct")]),t._v(": moreover, the configuration structures implement "),a("code",[t._v("Serialize")]),t._v(" and "),a("code",[t._v("Deserialize")]),t._v(", so that they can be easily stored/loaded using "),a("code",[t._v("serde")]),t._v(".")]),t._v(" "),a("p",[t._v("We've also added a new "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" type called "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/any/enum.AnyBlockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("AnyBlockchain")]),a("OutboundLink")],1),t._v(", which is essentially an "),a("code",[t._v("enum")]),t._v(" that wraps all the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" types exposed by the library. This allows you to build a "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/struct.Wallet.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Wallet")]),a("OutboundLink")],1),t._v(" that always has the same\nRust type, but that can internally use different "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" backends chosen at runtime.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AnyBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AnyBlockchainConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchainConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('r#"{"Electrum":{"url":"ssl://electrum.blockstream.info:50002","socks5":null,"retry":3,"timeout":5}}"#')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("serde_json"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AnyBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("The same is true for "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/database/trait.Database.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Database")]),a("OutboundLink")],1),t._v(" types, thanks to the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/database/trait.ConfigurableDatabase.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ConfigurableDatabase")]),a("OutboundLink")],1),t._v(" trait and the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/database/any/enum.AnyDatabase.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("AnyDatabase")]),a("OutboundLink")],1),t._v(" "),a("code",[t._v("enum")]),t._v(". While we think most people generally prefer to choose a single database type and then stick to it, it's still good\nto offer the choice to switch them at runtime, should somebody need that.")]),t._v(" "),a("h3",{attrs:{id:"descriptor-macro"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-macro"}},[t._v("#")]),t._v(" "),a("code",[t._v("descriptor!()")]),t._v(" macro")]),t._v(" "),a("p",[t._v("If you start writing complex descriptor templates, you'll soon find yourself with the need of building large descriptor syntax trees: you can very easily do that with the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/macro.descriptor.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("descriptor!()")]),a("OutboundLink")],1),t._v(" macro, with the added bonus that some additional checks on the\nsyntax of your descriptor will be performed at compile-time, rather than at runtime by. You can use any type that implements "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ToDescriptorKey")]),a("OutboundLink")],1),t._v(" (even strings!) as keys in "),a("code",[t._v("pk()")]),t._v(", "),a("code",[t._v("multi()")]),t._v(" and "),a("code",[t._v("sortedmulti()")]),t._v(" fragments, and you can even mix\nthem in the same descriptor.")]),t._v(" "),a("p",[t._v("The syntax supported by the macro is almost exactly the same as the standard descriptor syntax we all know, with the only difference that modifiers should be specified individually rather than\ngrouped in a series of characters (see the example below).")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("struct")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[t._v("TimeDecayingMultisig")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n pk_a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n pk_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timelock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("u32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ToDescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplate")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TimeDecayingMultisig")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplateOut")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ok")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("descriptor!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wsh")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("thresh")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pk_a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pk_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("d"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("v"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("older")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("timelock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("map_err")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token closure-params"}},[a("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[t._v("|")]),t._v("e"),a("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[t._v("|")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Message")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("e"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"support-for-sortedmulti"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#support-for-sortedmulti"}},[t._v("#")]),t._v(" Support for "),a("code",[t._v("sortedmulti()")])]),t._v(" "),a("p",[t._v("Thanks to the addition of "),a("code",[t._v("sortedmulti()")]),t._v(" in "),a("code",[t._v("rust-miniscript")]),t._v(", 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.")]),t._v(" "),a("h2",{attrs:{id:"contributors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),a("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),a("p",[t._v("Since the "),a("code",[t._v("0.1.0-beta.1")]),t._v(" release over three months ago, we've had "),a("code",[t._v("213")]),t._v(" new commits made by "),a("code",[t._v("10")]),t._v(" different contributors for a total of "),a("code",[t._v("9990")]),t._v(" additions and "),a("code",[t._v("2993")]),t._v(" deletions. Here's the "),a("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/0.1.0-beta.1...v0.2.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("p",[t._v("A special thanks to the "),a("code",[t._v("7")]),t._v(" new contributors:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://github.com/eupn",target:"_blank",rel:"noopener noreferrer"}},[t._v("@eupn"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/justinmoon",target:"_blank",rel:"noopener noreferrer"}},[t._v("@justinmoon"),a("OutboundLink")],1),t._v(" - Justin Moon")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/Xekyo",target:"_blank",rel:"noopener noreferrer"}},[t._v("@Xekyo"),a("OutboundLink")],1),t._v(" - Mark Erhardt")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/RCasatta",target:"_blank",rel:"noopener noreferrer"}},[t._v("@RCasatta"),a("OutboundLink")],1),t._v(" - Riccardo Casatta")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/ulrichard",target:"_blank",rel:"noopener noreferrer"}},[t._v("@ulrichard"),a("OutboundLink")],1),t._v(" - Richard Ulrich")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/notmandatory",target:"_blank",rel:"noopener noreferrer"}},[t._v("@notmandatory"),a("OutboundLink")],1),t._v(" - Steve Myers")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/willcl-ark",target:"_blank",rel:"noopener noreferrer"}},[t._v("@willcl-ark"),a("OutboundLink")],1),t._v(" - Will Clark")])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[66],{425:function(t,a,e){"use strict";e.r(a);var s=e(7),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("p",[t._v("A new release of BDK is finally out! The "),a("code",[t._v("v0.2.0")]),t._v(" release contains many exciting new features, bug fixes and overall improvements. This release also marks the beginning of our new regular "),a("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/7d6cd6d4f5a26194830f90e6460e0b82bddf9594/DEVELOPMENT_CYCLE.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("release schedule"),a("OutboundLink")],1),t._v(", which will see us pushing\nout a new release every four weeks. We think this is a good compromise to ensure that developers using BDK have access to all the new features and fixes as soon as possible, at least while the library is still evolving very fast as it is\nright now. After "),a("code",[t._v("v1.0.0")]),t._v(" we will increase this time to a more relaxed 6 weeks.")]),t._v(" "),a("p",[t._v("You can find the full "),a("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/7d6cd6d4f5a26194830f90e6460e0b82bddf9594/CHANGELOG.md#v020---010-beta1",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.2.0 changelog"),a("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),a("h2",{attrs:{id:"whats-new-in-v020"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v020"}},[t._v("#")]),t._v(" What's new in v0.2.0")]),t._v(" "),a("p",[t._v("Considering the sheer amount of new things being added we don't have room here to explain every new feature in detail, but below is a quick overview of some you could find useful in your projects.")]),t._v(" "),a("h3",{attrs:{id:"a-new-name"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#a-new-name"}},[t._v("#")]),t._v(" A new name")]),t._v(" "),a("p",[t._v("The "),a("code",[t._v("0.1.0-beta.1")]),t._v(" release was tagged right before the project was renamed "),a("code",[t._v("bdk")]),t._v(': at that time the library was still called "Magical Bitcoin Library", or '),a("code",[t._v("magical")]),t._v(" for short. With this release we have now renamed it to "),a("code",[t._v("bdk")]),t._v(". If you were using the library\nbefore, it should only be a matter of renaming the imports to match the new name. Alternatively you can also rename "),a("code",[t._v("bdk")]),t._v(" to "),a("code",[t._v("magical")]),t._v(" in your Cargo.toml, but you'll still have to do some changes here and there because the APIs have been changed in a few\nplaces.")]),t._v(" "),a("p",[t._v("This release being particularly large contains a few different API-breaking changes: going forward we expect to make the interface more and more stable, which in turn will make applying updates easier.")]),t._v(" "),a("h3",{attrs:{id:"branch-and-bound-coin-selection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#branch-and-bound-coin-selection"}},[t._v("#")]),t._v(" Branch and Bound coin selection")]),t._v(" "),a("p",[t._v('We now support the state-of-the-art coin selection algorithm called "branch and bound", with an implementation derived straight from Bitcoin Core. This algorithm is now enabled by default, but it can be replaced with a different one (either\nthe old default, '),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/coin_selection/struct.LargestFirstCoinSelection.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("LargestFirstCoinSelection")]),a("OutboundLink")],1),t._v(" or a custom "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("CoinSelectionAlgorithm")]),a("OutboundLink")],1),t._v(") by using the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/tx_builder/struct.TxBuilder.html#method.coin_selection",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("TxBuilder::coin_selection()")]),a("OutboundLink")],1),t._v(" option.")]),t._v(" "),a("p",[t._v("Branch and bound works by trying to find a set of inputs that perfectly matches the amount being sent by a transaction, to avoid making an extra change output which takes up more space in the transaction, requires more fees, and in general lowers the privacy\nof a user if the change is later spent together with other outputs.")]),t._v(" "),a("h3",{attrs:{id:"key-generation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#key-generation"}},[t._v("#")]),t._v(" Key generation")]),t._v(" "),a("p",[t._v("If you need to generate a new "),a("code",[t._v("bip32::ExtendedPrivKey")]),t._v(", or perhaps a new BIP39 mnemonic, you can use the unified "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.GeneratableKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("GeneratableKey")]),a("OutboundLink")],1),t._v(" trait to do so: paired with "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.GeneratableDefaultOptions.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("GeneratableDefaultOptions")]),a("OutboundLink")],1),t._v(" they provide many different ways to generate keys,\nwith or without a custom source of entropy, and with or without customized options.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratableKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratableDefaultOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKeyGenerateOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" default_options_key "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_default")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" custom_options_key "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKeyGenerateOptions")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" compressed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"generic-key-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#generic-key-types"}},[t._v("#")]),t._v(" Generic key types")]),t._v(" "),a("p",[t._v("With this update there's now a generalized trait for keys that can be used in descriptors, which is called "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ToDescriptorKey")]),a("OutboundLink")],1),t._v(". This trait is already implemented for the native "),a("code",[t._v("rust-bitcoin")]),t._v(" key types, like "),a("code",[t._v("PrivateKey")]),t._v(", "),a("code",[t._v("PublicKey")]),t._v(", "),a("code",[t._v("bip32::ExtendedPrivKey")]),t._v("\nand "),a("code",[t._v("bip32::ExtendedPubKey")]),t._v(". It's also implemented for BIP39 mnemonic and seeds, when the the opt-in "),a("code",[t._v("keys-bip39")]),t._v(" feature is enabled. As always, being this a public trait, you can also implement it for custom types to better suit your needs.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ScriptContext")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ToDescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyKeyType")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("to_descriptor_key")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom conversion to `bitcoin::PrivateKey`")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" privkey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bitcoin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n privkey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_descriptor_key")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("If your custom key type is simply a different representation of an "),a("code",[t._v("xprv")]),t._v(" or "),a("code",[t._v("xpub")]),t._v(", you can also consider implementing the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.DerivableKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("DerivableKey")]),a("OutboundLink")],1),t._v(" trait instead: for a type "),a("code",[t._v("K")]),t._v(" that implements "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.DerivableKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("DerivableKey")]),a("OutboundLink")],1),t._v(", the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ToDescriptorKey")]),a("OutboundLink")],1),t._v(" trait is automatically\nimplemented for the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html#impl-ToDescriptorKey%3CCtx%3E-for-(T%2C%20DerivationPath)",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("(K, bip32::DerivationPath)")]),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html#impl-ToDescriptorKey%3CCtx%3E-for-(T%2C%20KeySource%2C%20DerivationPath)",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("(K, bip32::KeySource, bip32::DerivationPath)")]),a("OutboundLink")],1),t._v(" tuples.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ScriptContext")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivableKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyKeyType")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("add_metadata")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n origin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Option")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeySource")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n derivation_path"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom conversion to `bip32::ExtendedPrivKey`")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xprv"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bip32"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n xprv"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_metadata")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("origin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" derivation_path"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"descriptor-templates"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-templates"}},[t._v("#")]),t._v(" Descriptor templates")]),t._v(" "),a("p",[t._v("Instead of having to serialize keys to strings using "),a("code",[t._v("format!()")]),t._v(" just to place them somewhere inside a descriptor, you can now use descriptor templates to build a descriptor starting from a key and some other options\nin a couple of lines of code. You can use one of the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/descriptor/template/index.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("provided templates"),a("OutboundLink")],1),t._v(" or make a custom one by implementing the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/descriptor/template/trait.DescriptorTemplate.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("DescriptorTemplate")]),a("OutboundLink")],1),t._v(" trait on a "),a("code",[t._v("struct")]),t._v(" or "),a("code",[t._v("enum")]),t._v(".")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" key "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bip32"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"..."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("OfflineWallet")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("_"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("new_offline")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("BIP84")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("clone")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("External")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("BIP84")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Internal")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"easier-creation-of-blockchain-and-database"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#easier-creation-of-blockchain-and-database"}},[t._v("#")]),t._v(" Easier creation of "),a("code",[t._v("Blockchain")]),t._v(" and "),a("code",[t._v("Database")])]),t._v(" "),a("p",[t._v("We've added a new way to create a "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" instance from a configuration, with the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.ConfigurableBlockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ConfigurableBlockchain")]),a("OutboundLink")],1),t._v(" trait. All the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" types provided by the library implement this trait, which allows you to easily build an\ninstance of them starting from a configuration "),a("code",[t._v("struct")]),t._v(": moreover, the configuration structures implement "),a("code",[t._v("Serialize")]),t._v(" and "),a("code",[t._v("Deserialize")]),t._v(", so that they can be easily stored/loaded using "),a("code",[t._v("serde")]),t._v(".")]),t._v(" "),a("p",[t._v("We've also added a new "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" type called "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/any/enum.AnyBlockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("AnyBlockchain")]),a("OutboundLink")],1),t._v(", which is essentially an "),a("code",[t._v("enum")]),t._v(" that wraps all the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" types exposed by the library. This allows you to build a "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/struct.Wallet.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Wallet")]),a("OutboundLink")],1),t._v(" that always has the same\nRust type, but that can internally use different "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" backends chosen at runtime.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AnyBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AnyBlockchainConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchainConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('r#"{"Electrum":{"url":"ssl://electrum.blockstream.info:50002","socks5":null,"retry":3,"timeout":5}}"#')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("serde_json"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AnyBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("The same is true for "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/database/trait.Database.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Database")]),a("OutboundLink")],1),t._v(" types, thanks to the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/database/trait.ConfigurableDatabase.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ConfigurableDatabase")]),a("OutboundLink")],1),t._v(" trait and the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/database/any/enum.AnyDatabase.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("AnyDatabase")]),a("OutboundLink")],1),t._v(" "),a("code",[t._v("enum")]),t._v(". While we think most people generally prefer to choose a single database type and then stick to it, it's still good\nto offer the choice to switch them at runtime, should somebody need that.")]),t._v(" "),a("h3",{attrs:{id:"descriptor-macro"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-macro"}},[t._v("#")]),t._v(" "),a("code",[t._v("descriptor!()")]),t._v(" macro")]),t._v(" "),a("p",[t._v("If you start writing complex descriptor templates, you'll soon find yourself with the need of building large descriptor syntax trees: you can very easily do that with the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/macro.descriptor.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("descriptor!()")]),a("OutboundLink")],1),t._v(" macro, with the added bonus that some additional checks on the\nsyntax of your descriptor will be performed at compile-time, rather than at runtime by. You can use any type that implements "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ToDescriptorKey")]),a("OutboundLink")],1),t._v(" (even strings!) as keys in "),a("code",[t._v("pk()")]),t._v(", "),a("code",[t._v("multi()")]),t._v(" and "),a("code",[t._v("sortedmulti()")]),t._v(" fragments, and you can even mix\nthem in the same descriptor.")]),t._v(" "),a("p",[t._v("The syntax supported by the macro is almost exactly the same as the standard descriptor syntax we all know, with the only difference that modifiers should be specified individually rather than\ngrouped in a series of characters (see the example below).")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("struct")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[t._v("TimeDecayingMultisig")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n pk_a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n pk_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timelock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("u32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ToDescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplate")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TimeDecayingMultisig")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplateOut")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ok")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("descriptor!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wsh")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("thresh")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pk_a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pk_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("d"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("v"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("older")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("timelock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("map_err")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token closure-params"}},[a("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[t._v("|")]),t._v("e"),a("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[t._v("|")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Message")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("e"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"support-for-sortedmulti"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#support-for-sortedmulti"}},[t._v("#")]),t._v(" Support for "),a("code",[t._v("sortedmulti()")])]),t._v(" "),a("p",[t._v("Thanks to the addition of "),a("code",[t._v("sortedmulti()")]),t._v(" in "),a("code",[t._v("rust-miniscript")]),t._v(", 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.")]),t._v(" "),a("h2",{attrs:{id:"contributors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),a("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),a("p",[t._v("Since the "),a("code",[t._v("0.1.0-beta.1")]),t._v(" release over three months ago, we've had "),a("code",[t._v("213")]),t._v(" new commits made by "),a("code",[t._v("10")]),t._v(" different contributors for a total of "),a("code",[t._v("9990")]),t._v(" additions and "),a("code",[t._v("2993")]),t._v(" deletions. Here's the "),a("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/0.1.0-beta.1...v0.2.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("p",[t._v("A special thanks to the "),a("code",[t._v("7")]),t._v(" new contributors:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://github.com/eupn",target:"_blank",rel:"noopener noreferrer"}},[t._v("@eupn"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/justinmoon",target:"_blank",rel:"noopener noreferrer"}},[t._v("@justinmoon"),a("OutboundLink")],1),t._v(" - Justin Moon")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/Xekyo",target:"_blank",rel:"noopener noreferrer"}},[t._v("@Xekyo"),a("OutboundLink")],1),t._v(" - Mark Erhardt")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/RCasatta",target:"_blank",rel:"noopener noreferrer"}},[t._v("@RCasatta"),a("OutboundLink")],1),t._v(" - Riccardo Casatta")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/ulrichard",target:"_blank",rel:"noopener noreferrer"}},[t._v("@ulrichard"),a("OutboundLink")],1),t._v(" - Richard Ulrich")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/notmandatory",target:"_blank",rel:"noopener noreferrer"}},[t._v("@notmandatory"),a("OutboundLink")],1),t._v(" - Steve Myers")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/willcl-ark",target:"_blank",rel:"noopener noreferrer"}},[t._v("@willcl-ark"),a("OutboundLink")],1),t._v(" - Will Clark")])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/67.2683e61c.js b/assets/js/67.c17340ef.js similarity index 99% rename from assets/js/67.2683e61c.js rename to assets/js/67.c17340ef.js index c3ce826b68..31823d5eae 100644 --- a/assets/js/67.2683e61c.js +++ b/assets/js/67.c17340ef.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[67],{425: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("A new release of BDK is out: the "),s("a",{attrs:{href:"https://crates.io/crates/bdk/0.3.0",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("v0.3.0")]),s("OutboundLink")],1),t._v(" is a relatively small update compared to "),s("code",[t._v("v0.2.0")]),t._v(", but it still brings some nice APIs improvements and general bugfixes.")]),t._v(" "),s("p",[t._v("You can find the full "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/75669049268bbc294564f8c6e0528e07a546258f/CHANGELOG.md#v030---v020",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.3.0 changelog"),s("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),s("h2",{attrs:{id:"whats-new-in-v030"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v030"}},[t._v("#")]),t._v(" What's new in v0.3.0")]),t._v(" "),s("p",[t._v("Below are some highlights of the new improved APIs coming with this release:")]),t._v(" "),s("h3",{attrs:{id:"less-verbosity-when-using-walletnew-offline"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#less-verbosity-when-using-walletnew-offline"}},[t._v("#")]),t._v(" Less verbosity when using "),s("code",[t._v("Wallet::new_offline()")])]),t._v(" "),s("p",[t._v("Now you don't have to explicitly provide the "),s("code",[t._v("OfflineWallet<_>")]),t._v(" type anymore, saving you one import and making it much less verbose to use.")]),t._v(" "),s("p",[t._v("Where before you were doing:")]),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("let")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("OfflineWallet")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[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 function"}},[t._v("new_offline")]),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 operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("Now you can just write:")]),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("let")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[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 function"}},[t._v("new_offline")]),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 operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"no-more-error-conversions-in-descriptortemplate"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#no-more-error-conversions-in-descriptortemplate"}},[t._v("#")]),t._v(" No more error conversions in "),s("code",[t._v("DescriptorTemplate")])]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("DescriptorTemplate")]),t._v(" trait has been updated to return a "),s("a",{attrs:{href:"https://docs.rs/bdk/0.3.0/bdk/descriptor/error/enum.Error.html",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("descriptor::error::Error")]),s("OutboundLink")],1),t._v(" instead of a "),s("code",[t._v("KeyError")]),t._v(". The "),s("a",{attrs:{href:"https://docs.rs/bdk/0.3.0/bdk/macro.descriptor.html",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("descriptor!()")]),s("OutboundLink")],1),t._v(" macro has been updated as well, which means that now you can use the macro inside a "),s("code",[t._v("DescriptorTemplate::build()")]),t._v(" implementation\nwithout having to "),s("RouterLink",{attrs:{to:"/blog/2020/12/release-v0.2.0/#descriptor-macro"}},[t._v("map the error")]),t._v(", like so:")],1),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("struct")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[t._v("TimeDecayingMultisig")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),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 pk_a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n pk_b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timelock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("u32")]),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 class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ToDescriptorKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplate")]),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("TimeDecayingMultisig")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),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("build")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[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("Result")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplateOut")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("descriptor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("error"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Error")]),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 namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("descriptor!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("wsh")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("thresh")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[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("pk_a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[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("pk_b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("d"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("v"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("older")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[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("timelock"),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"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"a-new-repo-for-the-cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#a-new-repo-for-the-cli"}},[t._v("#")]),t._v(" A new repo for the CLI")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("cli")]),t._v(" module (and it's related "),s("code",[t._v("cli-utils")]),t._v(" feature) have been removed from the main BDK repo and moved to their new home, the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-cli"),s("OutboundLink")],1),t._v(" repo. The APIs exposed were mainly used internally, for the "),s("code",[t._v("repl")]),t._v(" and the "),s("a",{attrs:{href:"/bdk-cli/playground"}},[t._v("playground")]),t._v("\nin our website, but in case you were using one of those keep that in mind.")]),t._v(" "),s("h2",{attrs:{id:"contributors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),s("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),s("p",[t._v("Since the "),s("code",[t._v("v0.2.0")]),t._v(" release around a month ago, we've had "),s("code",[t._v("24")]),t._v(" new commits made by "),s("code",[t._v("6")]),t._v(" different contributors for a total of "),s("code",[t._v("404")]),t._v(" additions and "),s("code",[t._v("1243")]),t._v(" deletions. Here's the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.2.0...v0.3.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/tcharding",target:"_blank",rel:"noopener noreferrer"}},[t._v("@tcharding"),s("OutboundLink")],1),t._v(" - Tobin C. Harding")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[67],{424: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("A new release of BDK is out: the "),s("a",{attrs:{href:"https://crates.io/crates/bdk/0.3.0",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("v0.3.0")]),s("OutboundLink")],1),t._v(" is a relatively small update compared to "),s("code",[t._v("v0.2.0")]),t._v(", but it still brings some nice APIs improvements and general bugfixes.")]),t._v(" "),s("p",[t._v("You can find the full "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/75669049268bbc294564f8c6e0528e07a546258f/CHANGELOG.md#v030---v020",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.3.0 changelog"),s("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),s("h2",{attrs:{id:"whats-new-in-v030"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v030"}},[t._v("#")]),t._v(" What's new in v0.3.0")]),t._v(" "),s("p",[t._v("Below are some highlights of the new improved APIs coming with this release:")]),t._v(" "),s("h3",{attrs:{id:"less-verbosity-when-using-walletnew-offline"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#less-verbosity-when-using-walletnew-offline"}},[t._v("#")]),t._v(" Less verbosity when using "),s("code",[t._v("Wallet::new_offline()")])]),t._v(" "),s("p",[t._v("Now you don't have to explicitly provide the "),s("code",[t._v("OfflineWallet<_>")]),t._v(" type anymore, saving you one import and making it much less verbose to use.")]),t._v(" "),s("p",[t._v("Where before you were doing:")]),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("let")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("OfflineWallet")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[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 function"}},[t._v("new_offline")]),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 operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("Now you can just write:")]),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("let")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[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 function"}},[t._v("new_offline")]),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 operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"no-more-error-conversions-in-descriptortemplate"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#no-more-error-conversions-in-descriptortemplate"}},[t._v("#")]),t._v(" No more error conversions in "),s("code",[t._v("DescriptorTemplate")])]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("DescriptorTemplate")]),t._v(" trait has been updated to return a "),s("a",{attrs:{href:"https://docs.rs/bdk/0.3.0/bdk/descriptor/error/enum.Error.html",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("descriptor::error::Error")]),s("OutboundLink")],1),t._v(" instead of a "),s("code",[t._v("KeyError")]),t._v(". The "),s("a",{attrs:{href:"https://docs.rs/bdk/0.3.0/bdk/macro.descriptor.html",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("descriptor!()")]),s("OutboundLink")],1),t._v(" macro has been updated as well, which means that now you can use the macro inside a "),s("code",[t._v("DescriptorTemplate::build()")]),t._v(" implementation\nwithout having to "),s("RouterLink",{attrs:{to:"/blog/2020/12/release-v0.2.0/#descriptor-macro"}},[t._v("map the error")]),t._v(", like so:")],1),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("struct")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[t._v("TimeDecayingMultisig")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),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 pk_a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n pk_b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timelock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("u32")]),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 class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ToDescriptorKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplate")]),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("TimeDecayingMultisig")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),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("build")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[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("Result")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplateOut")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("descriptor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("error"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Error")]),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 namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("descriptor!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("wsh")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("thresh")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[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("pk_a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[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("pk_b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("d"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("v"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("older")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[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("timelock"),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"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"a-new-repo-for-the-cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#a-new-repo-for-the-cli"}},[t._v("#")]),t._v(" A new repo for the CLI")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("cli")]),t._v(" module (and it's related "),s("code",[t._v("cli-utils")]),t._v(" feature) have been removed from the main BDK repo and moved to their new home, the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-cli"),s("OutboundLink")],1),t._v(" repo. The APIs exposed were mainly used internally, for the "),s("code",[t._v("repl")]),t._v(" and the "),s("a",{attrs:{href:"/bdk-cli/playground"}},[t._v("playground")]),t._v("\nin our website, but in case you were using one of those keep that in mind.")]),t._v(" "),s("h2",{attrs:{id:"contributors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),s("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),s("p",[t._v("Since the "),s("code",[t._v("v0.2.0")]),t._v(" release around a month ago, we've had "),s("code",[t._v("24")]),t._v(" new commits made by "),s("code",[t._v("6")]),t._v(" different contributors for a total of "),s("code",[t._v("404")]),t._v(" additions and "),s("code",[t._v("1243")]),t._v(" deletions. Here's the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.2.0...v0.3.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/tcharding",target:"_blank",rel:"noopener noreferrer"}},[t._v("@tcharding"),s("OutboundLink")],1),t._v(" - Tobin C. Harding")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/68.6ceb9679.js b/assets/js/68.ff73e39e.js similarity index 99% rename from assets/js/68.6ceb9679.js rename to assets/js/68.ff73e39e.js index 03cc18d424..5b4cd2b8f5 100644 --- a/assets/js/68.6ceb9679.js +++ b/assets/js/68.ff73e39e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[68],{426: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("p",[t._v("A new release of BDK is out: the "),s("a",{attrs:{href:"https://crates.io/crates/bdk/0.4.0",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("v0.4.0")]),s("OutboundLink")],1),t._v(" release brings updated dependencies, more sanity checks and an overhauled API to build transactions.")]),t._v(" "),s("p",[t._v("You can find the full "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/5e352489a0ac9dd92002a73aa64789a9ae2f0794/CHANGELOG.md#v040---v030",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.4.0 changelog"),s("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),s("h2",{attrs:{id:"whats-new-in-v040"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v040"}},[t._v("#")]),t._v(" What's new in v0.4.0")]),t._v(" "),s("p",[t._v("Below are some highlights of the new improved APIs coming with this release:")]),t._v(" "),s("h3",{attrs:{id:"a-new-api-to-build-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#a-new-api-to-build-transaction"}},[t._v("#")]),t._v(" A new API to build transaction")]),t._v(" "),s("p",[t._v("The star of this release is the new API designed and implemented by "),s("a",{attrs:{href:"https://github.com/llfourn",target:"_blank",rel:"noopener noreferrer"}},[t._v("@llfourn"),s("OutboundLink")],1),t._v(" that brings much more flexibility to the way we create transactions: originally the process of making a transaction involved the creation of a "),s("code",[t._v("TxBuilder")]),t._v(" which was used\nto configure "),s("em",[t._v("how")]),t._v(" the wallet should build the transaction. Things like which outputs to create, what "),s("code",[t._v("nLockTime")]),t._v(" to use, which UTXOs to spend, and much more.")]),t._v(" "),s("p",[t._v("Once fully configured, this builder was then given to the "),s("code",[t._v("Wallet")]),t._v(" itself in a "),s("code",[t._v("Wallet::create_tx()")]),t._v(" or "),s("code",[t._v("Wallet::bump_fee()")]),t._v(" call: the "),s("code",[t._v("Wallet")]),t._v(" would try to follow the "),s("em",[t._v("instructions")]),t._v(" given by the builder, but in\ncase of conflicting or straight-up wrong options it would have to fail and force the user to start over.")]),t._v(" "),s("p",[t._v("The new API maintains the concept of a "),s("em",[t._v("builder")]),t._v(", but it changes the way it's created so that it always contains a reference to the main "),s("code",[t._v("Wallet")]),t._v(" instance. What this means is that most checks can now be performed right\nwhen something is added to the builder, not at the end, allowing the user to recover from errors instead of having to start over.")]),t._v(" "),s("p",[t._v("This also opens the door to even more improvements and additions, such as a way to "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pull/279",target:"_blank",rel:"noopener noreferrer"}},[t._v("spend foreign utxos"),s("OutboundLink")],1),t._v(" in a transaction, or even a way to "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/280",target:"_blank",rel:"noopener noreferrer"}},[t._v("bump the fees of multiple transactions at once"),s("OutboundLink")],1),t._v(" by batching them together, which\nsaves a bit of space and money.")]),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("let")]),t._v(" send_to "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_new_address")]),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 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("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" details"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),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("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" builder "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("build_tx")]),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 builder\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_recipient")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("send_to"),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(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("50_000")]),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("enable_rbf")]),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("do_not_spend_change")]),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("fee_rate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("FeeRate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_sat_per_vb")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5.0")]),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 builder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("finish")]),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 operator"}},[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("h3",{attrs:{id:"upgraded-dependencies"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#upgraded-dependencies"}},[t._v("#")]),t._v(" Upgraded dependencies")]),t._v(" "),s("p",[t._v("This release also brings many updates to our dependencies, including:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("bitcoin")]),t._v(" to "),s("code",[t._v("v0.26")])]),t._v(" "),s("li",[s("code",[t._v("miniscript")]),t._v(" to "),s("code",[t._v("v5.1")])]),t._v(" "),s("li",[s("code",[t._v("electrum-client")]),t._v(" to "),s("code",[t._v("v0.6")])]),t._v(" "),s("li",[s("code",[t._v("tokio")]),t._v(" to "),s("code",[t._v("v1")])]),t._v(" "),s("li",[s("code",[t._v("reqwest")]),t._v(" to "),s("code",[t._v("v0.11")])]),t._v(" "),s("li",[s("code",[t._v("cc")]),t._v(" to "),s("code",[t._v(">= v1.0.64")])])]),t._v(" "),s("h3",{attrs:{id:"compact-filters-example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#compact-filters-example"}},[t._v("#")]),t._v(" Compact Filters example")]),t._v(" "),s("p",[t._v("Thanks to the upgrade to "),s("code",[t._v("bitcoin v0.26")]),t._v(" all the issues related to new networking messages in the P2P Bitcoin network have been fixed, which means that we can finally use our (experimental) compact filters "),s("code",[t._v("Blockchain")]),t._v(" with\nstandard Bitcoin Core 0.21 full nodes.")]),t._v(" "),s("p",[t._v("The following example has also been added to the repository and can be run with "),s("code",[t._v("cargo run --features=compact_filters --example compact_filters_balance")]),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 comment"}},[t._v("/// This will return wallet balance using compact filters")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/// Requires a synced local bitcoin node 0.21 running on testnet with blockfilterindex=1 and peerblockfilters=1")]),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("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(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),s("span",{pre:!0,attrs:{class:"token operator"}},[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(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CompactFiltersError")]),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 namespace"}},[t._v("env_logger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),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 macro property"}},[t._v("info!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"start"')]),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(" num_threads "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),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(" 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 "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" peers "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[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("num_threads"),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("map")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token closure-params"}},[s("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[t._v("|")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token closure-punctuation 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 function"}},[t._v("connect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"localhost:18333"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[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("clone")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("mempool"),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 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(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("collect")]),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 class-name"}},[t._v("Result")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("_"),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 punctuation"}},[t._v("(")]),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("let")]),t._v(" blockchain "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),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("(")]),t._v("peers"),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 operator"}},[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("info!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"done {:?}"')]),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(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" descriptor "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wpkh(tpubD6NzVbkrYhZ4X2yy78HWrr1M9NT8dKeWfzNiQqDdMqqa9UmmGztGGz6TaLFGsLfdft5iu32gxq1T4eMNxExNNWzVCpf9Y6JZi5TnqoC9wJq/*)"')]),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(" database "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),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 keyword"}},[t._v("let")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),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("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("descriptor"),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(" "),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(" database"),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 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(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\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 function"}},[t._v("noop_progress")]),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 class-name"}},[t._v("None")]),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 "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("info!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"balance: {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_balance")]),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 operator"}},[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 class-name"}},[t._v("Ok")]),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")])])]),s("h2",{attrs:{id:"contributors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),s("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),s("p",[t._v("Since the "),s("code",[t._v("v0.3.0")]),t._v(" release around a month ago, we've had "),s("code",[t._v("59")]),t._v(" new commits made by "),s("code",[t._v("8")]),t._v(" different contributors for a total of "),s("code",[t._v("2463")]),t._v(" additions and "),s("code",[t._v("1991")]),t._v(" deletions. Here's the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.3.0...v0.4.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/luckysori",target:"_blank",rel:"noopener noreferrer"}},[t._v("@luckysori"),s("OutboundLink")],1),t._v(" - Lucas Soriano")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[68],{433: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("p",[t._v("A new release of BDK is out: the "),s("a",{attrs:{href:"https://crates.io/crates/bdk/0.4.0",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("v0.4.0")]),s("OutboundLink")],1),t._v(" release brings updated dependencies, more sanity checks and an overhauled API to build transactions.")]),t._v(" "),s("p",[t._v("You can find the full "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/5e352489a0ac9dd92002a73aa64789a9ae2f0794/CHANGELOG.md#v040---v030",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.4.0 changelog"),s("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),s("h2",{attrs:{id:"whats-new-in-v040"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v040"}},[t._v("#")]),t._v(" What's new in v0.4.0")]),t._v(" "),s("p",[t._v("Below are some highlights of the new improved APIs coming with this release:")]),t._v(" "),s("h3",{attrs:{id:"a-new-api-to-build-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#a-new-api-to-build-transaction"}},[t._v("#")]),t._v(" A new API to build transaction")]),t._v(" "),s("p",[t._v("The star of this release is the new API designed and implemented by "),s("a",{attrs:{href:"https://github.com/llfourn",target:"_blank",rel:"noopener noreferrer"}},[t._v("@llfourn"),s("OutboundLink")],1),t._v(" that brings much more flexibility to the way we create transactions: originally the process of making a transaction involved the creation of a "),s("code",[t._v("TxBuilder")]),t._v(" which was used\nto configure "),s("em",[t._v("how")]),t._v(" the wallet should build the transaction. Things like which outputs to create, what "),s("code",[t._v("nLockTime")]),t._v(" to use, which UTXOs to spend, and much more.")]),t._v(" "),s("p",[t._v("Once fully configured, this builder was then given to the "),s("code",[t._v("Wallet")]),t._v(" itself in a "),s("code",[t._v("Wallet::create_tx()")]),t._v(" or "),s("code",[t._v("Wallet::bump_fee()")]),t._v(" call: the "),s("code",[t._v("Wallet")]),t._v(" would try to follow the "),s("em",[t._v("instructions")]),t._v(" given by the builder, but in\ncase of conflicting or straight-up wrong options it would have to fail and force the user to start over.")]),t._v(" "),s("p",[t._v("The new API maintains the concept of a "),s("em",[t._v("builder")]),t._v(", but it changes the way it's created so that it always contains a reference to the main "),s("code",[t._v("Wallet")]),t._v(" instance. What this means is that most checks can now be performed right\nwhen something is added to the builder, not at the end, allowing the user to recover from errors instead of having to start over.")]),t._v(" "),s("p",[t._v("This also opens the door to even more improvements and additions, such as a way to "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pull/279",target:"_blank",rel:"noopener noreferrer"}},[t._v("spend foreign utxos"),s("OutboundLink")],1),t._v(" in a transaction, or even a way to "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/280",target:"_blank",rel:"noopener noreferrer"}},[t._v("bump the fees of multiple transactions at once"),s("OutboundLink")],1),t._v(" by batching them together, which\nsaves a bit of space and money.")]),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("let")]),t._v(" send_to "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_new_address")]),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 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("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" details"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),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("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" builder "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("build_tx")]),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 builder\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_recipient")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("send_to"),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(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("50_000")]),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("enable_rbf")]),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("do_not_spend_change")]),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("fee_rate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("FeeRate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_sat_per_vb")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5.0")]),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 builder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("finish")]),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 operator"}},[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("h3",{attrs:{id:"upgraded-dependencies"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#upgraded-dependencies"}},[t._v("#")]),t._v(" Upgraded dependencies")]),t._v(" "),s("p",[t._v("This release also brings many updates to our dependencies, including:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("bitcoin")]),t._v(" to "),s("code",[t._v("v0.26")])]),t._v(" "),s("li",[s("code",[t._v("miniscript")]),t._v(" to "),s("code",[t._v("v5.1")])]),t._v(" "),s("li",[s("code",[t._v("electrum-client")]),t._v(" to "),s("code",[t._v("v0.6")])]),t._v(" "),s("li",[s("code",[t._v("tokio")]),t._v(" to "),s("code",[t._v("v1")])]),t._v(" "),s("li",[s("code",[t._v("reqwest")]),t._v(" to "),s("code",[t._v("v0.11")])]),t._v(" "),s("li",[s("code",[t._v("cc")]),t._v(" to "),s("code",[t._v(">= v1.0.64")])])]),t._v(" "),s("h3",{attrs:{id:"compact-filters-example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#compact-filters-example"}},[t._v("#")]),t._v(" Compact Filters example")]),t._v(" "),s("p",[t._v("Thanks to the upgrade to "),s("code",[t._v("bitcoin v0.26")]),t._v(" all the issues related to new networking messages in the P2P Bitcoin network have been fixed, which means that we can finally use our (experimental) compact filters "),s("code",[t._v("Blockchain")]),t._v(" with\nstandard Bitcoin Core 0.21 full nodes.")]),t._v(" "),s("p",[t._v("The following example has also been added to the repository and can be run with "),s("code",[t._v("cargo run --features=compact_filters --example compact_filters_balance")]),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 comment"}},[t._v("/// This will return wallet balance using compact filters")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/// Requires a synced local bitcoin node 0.21 running on testnet with blockfilterindex=1 and peerblockfilters=1")]),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("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(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),s("span",{pre:!0,attrs:{class:"token operator"}},[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(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CompactFiltersError")]),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 namespace"}},[t._v("env_logger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),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 macro property"}},[t._v("info!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"start"')]),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(" num_threads "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),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(" 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 "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" peers "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[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("num_threads"),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("map")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token closure-params"}},[s("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[t._v("|")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token closure-punctuation 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 function"}},[t._v("connect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"localhost:18333"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[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("clone")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("mempool"),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 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(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("collect")]),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 class-name"}},[t._v("Result")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("_"),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 punctuation"}},[t._v("(")]),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("let")]),t._v(" blockchain "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),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("(")]),t._v("peers"),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 operator"}},[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("info!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"done {:?}"')]),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(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" descriptor "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wpkh(tpubD6NzVbkrYhZ4X2yy78HWrr1M9NT8dKeWfzNiQqDdMqqa9UmmGztGGz6TaLFGsLfdft5iu32gxq1T4eMNxExNNWzVCpf9Y6JZi5TnqoC9wJq/*)"')]),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(" database "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),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 keyword"}},[t._v("let")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),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("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("descriptor"),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(" "),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(" database"),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 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(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\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 function"}},[t._v("noop_progress")]),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 class-name"}},[t._v("None")]),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 "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("info!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"balance: {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_balance")]),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 operator"}},[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 class-name"}},[t._v("Ok")]),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")])])]),s("h2",{attrs:{id:"contributors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),s("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),s("p",[t._v("Since the "),s("code",[t._v("v0.3.0")]),t._v(" release around a month ago, we've had "),s("code",[t._v("59")]),t._v(" new commits made by "),s("code",[t._v("8")]),t._v(" different contributors for a total of "),s("code",[t._v("2463")]),t._v(" additions and "),s("code",[t._v("1991")]),t._v(" deletions. Here's the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.3.0...v0.4.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/luckysori",target:"_blank",rel:"noopener noreferrer"}},[t._v("@luckysori"),s("OutboundLink")],1),t._v(" - Lucas Soriano")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/69.21c85af3.js b/assets/js/69.21b6270f.js similarity index 98% rename from assets/js/69.21c85af3.js rename to assets/js/69.21b6270f.js index b064b18913..5dbd614eab 100644 --- a/assets/js/69.21c85af3.js +++ b/assets/js/69.21b6270f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[69],{427:function(t,e,n){"use strict";n.r(e);var a=n(7),s=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("p",[t._v("A new release of BDK is out: "),e("a",{attrs:{href:"https://crates.io/crates/bdk/0.5.0",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("v0.5.0")]),e("OutboundLink")],1),t._v(" is our first release licensed under Apache 2.0 and MIT, brings new features, bugfixes and some internal refactoring.")]),t._v(" "),e("p",[t._v("You can find the full "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/f786f0e6241a3df47b96bbb07f1aba374bc73b2f/CHANGELOG.md#v050---v040",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.5.0 changelog"),e("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),e("h2",{attrs:{id:"whats-new-in-v050"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v050"}},[t._v("#")]),t._v(" What's new in v0.5.0")]),t._v(" "),e("p",[t._v("Below are some highlights of the new release:")]),t._v(" "),e("h3",{attrs:{id:"dual-licensing"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#dual-licensing"}},[t._v("#")]),t._v(" Dual Licensing")]),t._v(" "),e("p",[t._v("From now on BDK will be released under both Apache 2.0 and MIT, at your discretion. This change aligns our project with many other Rust crates and reiterates our commitment to a permissive licensing model.")]),t._v(" "),e("h3",{attrs:{id:"spending-foreign-utxos"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#spending-foreign-utxos"}},[t._v("#")]),t._v(" Spending "),e("em",[t._v("foreign")]),t._v(" UTXOs")]),t._v(" "),e("p",[t._v("This release adds a new "),e("code",[t._v("TxBuilder")]),t._v(" method called "),e("a",{attrs:{href:"https://docs.rs/bdk/0.5.0/bdk/wallet/tx_builder/struct.TxBuilder.html#method.add_foreign_utxo",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("add_foreign_utxo()")]),e("OutboundLink")],1),t._v(", which can be used to spend UTXOs that don't belong to the "),e("code",[t._v("Wallet")]),t._v(". We think this is going to be very useful to developers working on multiparty\nprotocols like CoinJoins, Pay Join, etc.")]),t._v(" "),e("p",[t._v("It's as easy as giving the library a PSBT input and the satisfaction cost for that input:")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" builder "),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("build_tx")]),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("\nbuilder\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_recipient")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("addr"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),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(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("60_000")]),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 function"}},[t._v("add_foreign_utxo")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("foreign_utxo"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("outpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" foreign_utxo_psbt_input"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" foreign_utxo_satisfaction_weight"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v("\n")])])]),e("h2",{attrs:{id:"contributors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),e("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),e("p",[t._v("Since the "),e("code",[t._v("v0.4.0")]),t._v(" release around a month ago, we've had "),e("code",[t._v("54")]),t._v(" new commits made by "),e("code",[t._v("7")]),t._v(" different contributors for a total of "),e("code",[t._v("1430")]),t._v(" additions and "),e("code",[t._v("1212")]),t._v(" deletions. Here's the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.4.0...v0.5.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://github.com/davemo88",target:"_blank",rel:"noopener noreferrer"}},[t._v("@davemo88"),e("OutboundLink")],1)])])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[69],{426:function(t,e,n){"use strict";n.r(e);var a=n(7),s=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("p",[t._v("A new release of BDK is out: "),e("a",{attrs:{href:"https://crates.io/crates/bdk/0.5.0",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("v0.5.0")]),e("OutboundLink")],1),t._v(" is our first release licensed under Apache 2.0 and MIT, brings new features, bugfixes and some internal refactoring.")]),t._v(" "),e("p",[t._v("You can find the full "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/f786f0e6241a3df47b96bbb07f1aba374bc73b2f/CHANGELOG.md#v050---v040",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.5.0 changelog"),e("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),e("h2",{attrs:{id:"whats-new-in-v050"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v050"}},[t._v("#")]),t._v(" What's new in v0.5.0")]),t._v(" "),e("p",[t._v("Below are some highlights of the new release:")]),t._v(" "),e("h3",{attrs:{id:"dual-licensing"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#dual-licensing"}},[t._v("#")]),t._v(" Dual Licensing")]),t._v(" "),e("p",[t._v("From now on BDK will be released under both Apache 2.0 and MIT, at your discretion. This change aligns our project with many other Rust crates and reiterates our commitment to a permissive licensing model.")]),t._v(" "),e("h3",{attrs:{id:"spending-foreign-utxos"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#spending-foreign-utxos"}},[t._v("#")]),t._v(" Spending "),e("em",[t._v("foreign")]),t._v(" UTXOs")]),t._v(" "),e("p",[t._v("This release adds a new "),e("code",[t._v("TxBuilder")]),t._v(" method called "),e("a",{attrs:{href:"https://docs.rs/bdk/0.5.0/bdk/wallet/tx_builder/struct.TxBuilder.html#method.add_foreign_utxo",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("add_foreign_utxo()")]),e("OutboundLink")],1),t._v(", which can be used to spend UTXOs that don't belong to the "),e("code",[t._v("Wallet")]),t._v(". We think this is going to be very useful to developers working on multiparty\nprotocols like CoinJoins, Pay Join, etc.")]),t._v(" "),e("p",[t._v("It's as easy as giving the library a PSBT input and the satisfaction cost for that input:")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" builder "),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("build_tx")]),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("\nbuilder\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_recipient")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("addr"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),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(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("60_000")]),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 function"}},[t._v("add_foreign_utxo")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("foreign_utxo"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("outpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" foreign_utxo_psbt_input"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" foreign_utxo_satisfaction_weight"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v("\n")])])]),e("h2",{attrs:{id:"contributors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),e("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),e("p",[t._v("Since the "),e("code",[t._v("v0.4.0")]),t._v(" release around a month ago, we've had "),e("code",[t._v("54")]),t._v(" new commits made by "),e("code",[t._v("7")]),t._v(" different contributors for a total of "),e("code",[t._v("1430")]),t._v(" additions and "),e("code",[t._v("1212")]),t._v(" deletions. Here's the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.4.0...v0.5.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://github.com/davemo88",target:"_blank",rel:"noopener noreferrer"}},[t._v("@davemo88"),e("OutboundLink")],1)])])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/72.1c2cf134.js b/assets/js/72.f0f30dce.js similarity index 99% rename from assets/js/72.1c2cf134.js rename to assets/js/72.f0f30dce.js index f01bdfdea0..d7a9fc898c 100644 --- a/assets/js/72.1c2cf134.js +++ b/assets/js/72.f0f30dce.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[72],{430:function(t,s,a){"use strict";a.r(s);var e=a(7),n=Object(e.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("p",[t._v("A new release of BDK is out: "),s("a",{attrs:{href:"https://crates.io/crates/bdk/0.8.0",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("v0.8.0")]),s("OutboundLink")],1),t._v(" brings new APIs and other minor bugfixes and internal improvements.")]),t._v(" "),s("p",[t._v("You can find the full "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/67714adc80669129eff2cad8991609d3b1c41cb9/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.8.0 changelog"),s("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),s("h2",{attrs:{id:"whats-new-in-v080"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v080"}},[t._v("#")]),t._v(" What's new in v0.8.0")]),t._v(" "),s("p",[t._v("Below are some highlights of the new release:")]),t._v(" "),s("h3",{attrs:{id:"getting-the-derivation-index"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getting-the-derivation-index"}},[t._v("#")]),t._v(" Getting the Derivation Index")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("Wallet::get_address()")]),t._v(" method now returns an "),s("a",{attrs:{href:"https://docs.rs/bdk/0.8.0/bdk/wallet/struct.AddressInfo.html",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("AddressInfo")]),s("OutboundLink")],1),t._v(" structure, rather than a simple "),s("code",[t._v("Address")]),t._v(". This new structure contains the address but also the derivation index, which can be useful in some contexts.")]),t._v(" "),s("p",[t._v("Since the structure implements "),s("code",[t._v("Deref")]),t._v(" it can be used directly as a "),s("code",[t._v("&Address")]),t._v(", which simplifies migrating to this change a little bit.")]),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("let")]),t._v(" address_info "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressInfo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("New")]),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\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Print the address and derivation index")]),t._v("\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('"Address #{}: {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address_info"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("index"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address_info"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),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("// Use the `AddressInfo` structure directly like an `Address`")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" script_pubkey "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" address_info"),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(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"explicitly-enable-non-all-sighashes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explicitly-enable-non-all-sighashes"}},[t._v("#")]),t._v(" Explicitly Enable non-ALL Sighashes")]),t._v(" "),s("p",[t._v("To mitigate potential attacks in multiparty protocols, this release includes a new "),s("a",{attrs:{href:"https://docs.rs/bdk/0.8.0/bdk/wallet/signer/struct.SignOptions.html#structfield.allow_all_sighashes",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("SignOptions::allow_all_sighashes")]),s("OutboundLink")],1),t._v(" option that must be explicitly enabled to let the signers produce signatures\nwith any non-ALL sighash.")]),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("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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 comment"}},[t._v("// Fails if the psbt uses non-ALL sighashes")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" finalized "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),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("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),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 operator"}},[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("// Produces a signature successfully")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" finalized "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),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("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" allow_all_sighashes"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),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 class-name"}},[t._v("Default")]),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(")")]),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 operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h2",{attrs:{id:"contributors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),s("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),s("p",[t._v("Since the "),s("code",[t._v("v0.7.0")]),t._v(" release around a month ago, we've had "),s("code",[t._v("39")]),t._v(" new commits made by "),s("code",[t._v("6")]),t._v(" different contributors for a total of "),s("code",[t._v("1540")]),t._v(" additions and "),s("code",[t._v("1380")]),t._v(" deletions. Here's the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.7.0...v0.8.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),s("ul",[s("li",[t._v("[@futurepaul][@futurepaul] - Paul Miller")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[72],{427:function(t,s,a){"use strict";a.r(s);var e=a(7),n=Object(e.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("p",[t._v("A new release of BDK is out: "),s("a",{attrs:{href:"https://crates.io/crates/bdk/0.8.0",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("v0.8.0")]),s("OutboundLink")],1),t._v(" brings new APIs and other minor bugfixes and internal improvements.")]),t._v(" "),s("p",[t._v("You can find the full "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/67714adc80669129eff2cad8991609d3b1c41cb9/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.8.0 changelog"),s("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),s("h2",{attrs:{id:"whats-new-in-v080"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v080"}},[t._v("#")]),t._v(" What's new in v0.8.0")]),t._v(" "),s("p",[t._v("Below are some highlights of the new release:")]),t._v(" "),s("h3",{attrs:{id:"getting-the-derivation-index"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getting-the-derivation-index"}},[t._v("#")]),t._v(" Getting the Derivation Index")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("Wallet::get_address()")]),t._v(" method now returns an "),s("a",{attrs:{href:"https://docs.rs/bdk/0.8.0/bdk/wallet/struct.AddressInfo.html",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("AddressInfo")]),s("OutboundLink")],1),t._v(" structure, rather than a simple "),s("code",[t._v("Address")]),t._v(". This new structure contains the address but also the derivation index, which can be useful in some contexts.")]),t._v(" "),s("p",[t._v("Since the structure implements "),s("code",[t._v("Deref")]),t._v(" it can be used directly as a "),s("code",[t._v("&Address")]),t._v(", which simplifies migrating to this change a little bit.")]),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("let")]),t._v(" address_info "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressInfo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("New")]),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\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Print the address and derivation index")]),t._v("\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('"Address #{}: {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address_info"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("index"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address_info"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),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("// Use the `AddressInfo` structure directly like an `Address`")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" script_pubkey "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" address_info"),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(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"explicitly-enable-non-all-sighashes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explicitly-enable-non-all-sighashes"}},[t._v("#")]),t._v(" Explicitly Enable non-ALL Sighashes")]),t._v(" "),s("p",[t._v("To mitigate potential attacks in multiparty protocols, this release includes a new "),s("a",{attrs:{href:"https://docs.rs/bdk/0.8.0/bdk/wallet/signer/struct.SignOptions.html#structfield.allow_all_sighashes",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("SignOptions::allow_all_sighashes")]),s("OutboundLink")],1),t._v(" option that must be explicitly enabled to let the signers produce signatures\nwith any non-ALL sighash.")]),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("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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 comment"}},[t._v("// Fails if the psbt uses non-ALL sighashes")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" finalized "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),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("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),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 operator"}},[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("// Produces a signature successfully")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" finalized "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),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("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" allow_all_sighashes"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),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 class-name"}},[t._v("Default")]),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(")")]),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 operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h2",{attrs:{id:"contributors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),s("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),s("p",[t._v("Since the "),s("code",[t._v("v0.7.0")]),t._v(" release around a month ago, we've had "),s("code",[t._v("39")]),t._v(" new commits made by "),s("code",[t._v("6")]),t._v(" different contributors for a total of "),s("code",[t._v("1540")]),t._v(" additions and "),s("code",[t._v("1380")]),t._v(" deletions. Here's the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.7.0...v0.8.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),s("ul",[s("li",[t._v("[@futurepaul][@futurepaul] - Paul Miller")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/73.f2f903e2.js b/assets/js/73.4a70db6f.js similarity index 99% rename from assets/js/73.f2f903e2.js rename to assets/js/73.4a70db6f.js index 6b8c3043bd..51b4a0c51e 100644 --- a/assets/js/73.f2f903e2.js +++ b/assets/js/73.4a70db6f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[73],{431: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("p",[t._v("A new release of BDK is out: "),e("a",{attrs:{href:"https://crates.io/crates/bdk/0.9.0",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("v0.9.0")]),e("OutboundLink")],1),t._v(" brings support for Bitcoin Core backends, more sanity checks and bugfixes.")]),t._v(" "),e("p",[t._v("You can find the full "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/7a9b691f68c41116dc7857bc0267a2e3b2eafdd3/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.9.0 changelog"),e("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),e("h2",{attrs:{id:"whats-new-in-v090"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v090"}},[t._v("#")]),t._v(" What's new in v0.9.0")]),t._v(" "),e("p",[t._v("Below are some highlights of the new release:")]),t._v(" "),e("h2",{attrs:{id:"bitcoin-core-blockchain-backend"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-core-blockchain-backend"}},[t._v("#")]),t._v(" Bitcoin Core "),e("code",[t._v("Blockchain")]),t._v(" Backend")]),t._v(" "),e("p",[t._v("This release finally adds support for using a Bitcoin Core node as the "),e("code",[t._v("Blockchain")]),t._v(" backend for a wallet, through the RPC. This is still considered experimental for the time being, since there are a few missing\nthings that we'd like to add, and adding those could force us to change the API a little.")]),t._v(" "),e("p",[t._v("Nonetheless, if you don't mind a breaking-change later on it's already fully functional.")]),t._v(" "),e("p",[t._v("The backend works by importing addresses in Bitcoin Core using the "),e("code",[t._v("importmulti")]),t._v(" call.")]),t._v(" "),e("p",[t._v("Using it is pretty straightforward, here's a quick example:")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcConfig")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n url"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:18332"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),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("\n auth"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bitcoincore_rpc"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Auth")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CookieFile")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/home/user/.bitcoin/.cookie"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),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 punctuation"}},[t._v(",")]),t._v("\n network"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n wallet_name"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wallet_name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),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("\n skip_blocks"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),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 keyword"}},[t._v("let")]),t._v(" blockchain "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcBlockchain")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("config"),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("Similarly to the compact filters backend, the "),e("code",[t._v("skip_blocks")]),t._v(" field allows for starting a rescan of the blockchain at a given height rather than the genesis, saving some time. The rescan is only performed once, the\nfirst time an address is imported. Afterwards every "),e("code",[t._v("sync()")]),t._v(" call will only perform a few queries on the node and it will be much faster.")]),t._v(" "),e("h2",{attrs:{id:"updated-transactiondetails-struct"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#updated-transactiondetails-struct"}},[t._v("#")]),t._v(" Updated "),e("code",[t._v("TransactionDetails")]),t._v(" Struct")]),t._v(" "),e("p",[t._v("To better accomodate the Bitcoin Core RPC and potentially more future new backends, the "),e("a",{attrs:{href:"https://docs.rs/bdk/0.9.0/bdk/struct.TransactionDetails.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("TransactionDetails")]),e("OutboundLink")],1),t._v(" structure have been updated as follows:")]),t._v(" "),e("ul",[e("li",[t._v("The "),e("code",[t._v("fees")]),t._v(" field has been renamed to "),e("code",[t._v("fee")]),t._v(" and it has been made optional. "),e("code",[t._v("Blockchain")]),t._v(" backends can set this to "),e("code",[t._v("None")]),t._v(" when they have no way of computing the fee of a transaction")]),t._v(" "),e("li",[t._v("The "),e("code",[t._v("timestamp")]),t._v(" and "),e("code",[t._v("height")]),t._v(" fields have been merged into an optional "),e("a",{attrs:{href:"https://docs.rs/bdk/0.9.0/bdk/struct.ConfirmationTime.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("ConfirmationTime")]),e("OutboundLink")],1),t._v(" struct")])]),t._v(" "),e("h2",{attrs:{id:"verify-downloaded-txs"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#verify-downloaded-txs"}},[t._v("#")]),t._v(" Verify Downloaded TXs")]),t._v(" "),e("p",[t._v("This release also introduces an opt-in feature called "),e("code",[t._v("verify")]),t._v(" that can be enabled to verify the unconfirmed transactions that BDK downloads from untrusted sources like Electrum servers.")]),t._v(" "),e("p",[t._v('Verifying the transactions against the consensus rules can be an additional protection against some kind of attacks that could trick a wallet into creating wrong RBF (BIP 125) "bump" transactions. Check out '),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/352",target:"_blank",rel:"noopener noreferrer"}},[t._v("the issue"),e("OutboundLink")],1),t._v("\nfor more details.")]),t._v(" "),e("h2",{attrs:{id:"contributors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),e("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),e("p",[t._v("Since the "),e("code",[t._v("v0.8.0")]),t._v(" release around a month ago, we've had "),e("code",[t._v("45")]),t._v(" new commits made by "),e("code",[t._v("6")]),t._v(" different contributors for a total of "),e("code",[t._v("1336")]),t._v(" additions and "),e("code",[t._v("266")]),t._v(" deletions. Here's the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.8.0...v0.9.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),e("ul",[e("li",[t._v("[@jb55][@jb55] - William Casarin")])])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[73],{432: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("p",[t._v("A new release of BDK is out: "),e("a",{attrs:{href:"https://crates.io/crates/bdk/0.9.0",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("v0.9.0")]),e("OutboundLink")],1),t._v(" brings support for Bitcoin Core backends, more sanity checks and bugfixes.")]),t._v(" "),e("p",[t._v("You can find the full "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/7a9b691f68c41116dc7857bc0267a2e3b2eafdd3/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.9.0 changelog"),e("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),e("h2",{attrs:{id:"whats-new-in-v090"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v090"}},[t._v("#")]),t._v(" What's new in v0.9.0")]),t._v(" "),e("p",[t._v("Below are some highlights of the new release:")]),t._v(" "),e("h2",{attrs:{id:"bitcoin-core-blockchain-backend"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-core-blockchain-backend"}},[t._v("#")]),t._v(" Bitcoin Core "),e("code",[t._v("Blockchain")]),t._v(" Backend")]),t._v(" "),e("p",[t._v("This release finally adds support for using a Bitcoin Core node as the "),e("code",[t._v("Blockchain")]),t._v(" backend for a wallet, through the RPC. This is still considered experimental for the time being, since there are a few missing\nthings that we'd like to add, and adding those could force us to change the API a little.")]),t._v(" "),e("p",[t._v("Nonetheless, if you don't mind a breaking-change later on it's already fully functional.")]),t._v(" "),e("p",[t._v("The backend works by importing addresses in Bitcoin Core using the "),e("code",[t._v("importmulti")]),t._v(" call.")]),t._v(" "),e("p",[t._v("Using it is pretty straightforward, here's a quick example:")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcConfig")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n url"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:18332"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),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("\n auth"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bitcoincore_rpc"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Auth")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CookieFile")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/home/user/.bitcoin/.cookie"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),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 punctuation"}},[t._v(",")]),t._v("\n network"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n wallet_name"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wallet_name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),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("\n skip_blocks"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),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 keyword"}},[t._v("let")]),t._v(" blockchain "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcBlockchain")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("config"),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("Similarly to the compact filters backend, the "),e("code",[t._v("skip_blocks")]),t._v(" field allows for starting a rescan of the blockchain at a given height rather than the genesis, saving some time. The rescan is only performed once, the\nfirst time an address is imported. Afterwards every "),e("code",[t._v("sync()")]),t._v(" call will only perform a few queries on the node and it will be much faster.")]),t._v(" "),e("h2",{attrs:{id:"updated-transactiondetails-struct"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#updated-transactiondetails-struct"}},[t._v("#")]),t._v(" Updated "),e("code",[t._v("TransactionDetails")]),t._v(" Struct")]),t._v(" "),e("p",[t._v("To better accomodate the Bitcoin Core RPC and potentially more future new backends, the "),e("a",{attrs:{href:"https://docs.rs/bdk/0.9.0/bdk/struct.TransactionDetails.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("TransactionDetails")]),e("OutboundLink")],1),t._v(" structure have been updated as follows:")]),t._v(" "),e("ul",[e("li",[t._v("The "),e("code",[t._v("fees")]),t._v(" field has been renamed to "),e("code",[t._v("fee")]),t._v(" and it has been made optional. "),e("code",[t._v("Blockchain")]),t._v(" backends can set this to "),e("code",[t._v("None")]),t._v(" when they have no way of computing the fee of a transaction")]),t._v(" "),e("li",[t._v("The "),e("code",[t._v("timestamp")]),t._v(" and "),e("code",[t._v("height")]),t._v(" fields have been merged into an optional "),e("a",{attrs:{href:"https://docs.rs/bdk/0.9.0/bdk/struct.ConfirmationTime.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("ConfirmationTime")]),e("OutboundLink")],1),t._v(" struct")])]),t._v(" "),e("h2",{attrs:{id:"verify-downloaded-txs"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#verify-downloaded-txs"}},[t._v("#")]),t._v(" Verify Downloaded TXs")]),t._v(" "),e("p",[t._v("This release also introduces an opt-in feature called "),e("code",[t._v("verify")]),t._v(" that can be enabled to verify the unconfirmed transactions that BDK downloads from untrusted sources like Electrum servers.")]),t._v(" "),e("p",[t._v('Verifying the transactions against the consensus rules can be an additional protection against some kind of attacks that could trick a wallet into creating wrong RBF (BIP 125) "bump" transactions. Check out '),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/352",target:"_blank",rel:"noopener noreferrer"}},[t._v("the issue"),e("OutboundLink")],1),t._v("\nfor more details.")]),t._v(" "),e("h2",{attrs:{id:"contributors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),e("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),e("p",[t._v("Since the "),e("code",[t._v("v0.8.0")]),t._v(" release around a month ago, we've had "),e("code",[t._v("45")]),t._v(" new commits made by "),e("code",[t._v("6")]),t._v(" different contributors for a total of "),e("code",[t._v("1336")]),t._v(" additions and "),e("code",[t._v("266")]),t._v(" deletions. Here's the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.8.0...v0.9.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),e("ul",[e("li",[t._v("[@jb55][@jb55] - William Casarin")])])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/74.ae6867a4.js b/assets/js/74.b82270b9.js similarity index 99% rename from assets/js/74.ae6867a4.js rename to assets/js/74.b82270b9.js index 6583740f1b..39edf7d0c1 100644 --- a/assets/js/74.ae6867a4.js +++ b/assets/js/74.b82270b9.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[74],{432:function(e,t,o){"use strict";o.r(t);var a=o(7),i=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("Over the past few months the work on "),t("a",{attrs:{href:"https://github.com/LLFourn/bdk_core_staging",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk_core"),t("OutboundLink")],1),e._v(" quietly continued behind the scenes, and as the time went on it started expanding beyond the scope of just improving the "),t("em",[e._v("syncing")]),e._v(" mechanism of BDK. Being a new fresh\nproject it allowed for iterating much faster, and we soon realized we could make large improvements to the general architecture of BDK to fix many of the issues and shortcomings found over time.")]),e._v(" "),t("p",[e._v("For this reason, we decided to move forward with the project and start planning the integration into BDK itself. This blog post will briefly describe the new concept for how BDK will be structured and lay down a plan\nfor the development in the next few months.")]),e._v(" "),t("h2",{attrs:{id:"goals"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#goals"}},[e._v("#")]),e._v(" Goals")]),e._v(" "),t("p",[e._v("First of all, we should outline at least the main goals of BDK 1.0, ergo what we want to improve over the current state of the project.")]),e._v(" "),t("h3",{attrs:{id:"stable-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#stable-api"}},[e._v("#")]),e._v(" Stable API")]),e._v(" "),t("p",[e._v("Ever since the "),t("code",[e._v("0.1.0")]),e._v(" release of BDK we've always broken the API with each release. Most of the time in minor and very contained ways, but in "),t("em",[e._v("some")]),e._v(" way nonetheless. One of the main sources of breakage have been\nthe "),t("code",[e._v("Blockchain")]),e._v(" and "),t("code",[e._v("Database")]),e._v(" traits. Those two together are used in essentially any operation a user may do on a "),t("code",[e._v("Wallet")]),e._v(", and are thus impacted by any relatively large change or new feature added to the code.")]),e._v(" "),t("p",[e._v("Want to "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pull/515",target:"_blank",rel:"noopener noreferrer"}},[e._v("keep track of whether a UTXO is spent"),t("OutboundLink")],1),e._v("? You need to change the "),t("code",[e._v("Database")]),e._v(" that stores this information. Want to "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pull/669",target:"_blank",rel:"noopener noreferrer"}},[e._v("know the timestamp of the latest block"),t("OutboundLink")],1),e._v("?\nYou need to change the "),t("code",[e._v("Blockchain")]),e._v(" trait to fetch that extra bit of information. And the list goes on and on.")]),e._v(" "),t("p",[e._v("Since making changes to these traits is always so painful for us and our downstream users, this ended up delaying or considerably slowing down the development of new features in BDK.")]),e._v(" "),t("p",[e._v("bdk_core tries to minimize the (ab)use of traits, and this will help immensely when trying to provide a stable API for our users.")]),e._v(" "),t("h3",{attrs:{id:"upstreaming-our-code"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upstreaming-our-code"}},[e._v("#")]),e._v(" Upstreaming our code")]),e._v(" "),t("p",[e._v("BDK internally implements many features that could be useful to other projects as well. While working on this integration we will also try to upstream some of our code to the relevant crates, mainly "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("rust-miniscript")]),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("This has essentially three benefits:")]),e._v(" "),t("ol",[t("li",[e._v("A new set of eyes will take a look at the code, potentially spotting issues or suggesting improvements")]),e._v(" "),t("li",[e._v("This will lower the amount of code that we have to maintain ourselves")]),e._v(" "),t("li",[e._v("Other people can benefit from our code, which was previously tightly integrated into BDK and hard to re-use")])]),e._v(" "),t("h3",{attrs:{id:"partially-syncing-a-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#partially-syncing-a-wallet"}},[e._v("#")]),e._v(" Partially Syncing a Wallet")]),e._v(" "),t("p",[e._v("This single point was the main reason the bdk_core project was kickstarted, and it means giving our users the ability to incrementally sync a wallet over time instead of working in single big batches.")]),e._v(" "),t("p",[e._v("This is explained very well in the "),t("RouterLink",{attrs:{to:"/blog/bdk-core-pt1/"}},[e._v("first bdk_core post")]),e._v(", so I won't go into details here. Think of this as a much more flexible way to sync a wallet, which in turn will allow us to simplify our current implementation\nof blockchain backends like compact block filters, and also offer a better API for our users.")],1),e._v(" "),t("h3",{attrs:{id:"no-std"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#no-std"}},[e._v("#")]),e._v(" "),t("code",[e._v("no_std")])]),e._v(" "),t("p",[e._v("bdk_core is built with "),t("code",[e._v("no_std")]),e._v(" in mind since the beginning, something we've been wanting to support in BDK "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/205",target:"_blank",rel:"noopener noreferrer"}},[e._v("for a long time"),t("OutboundLink")],1),e._v('. Being more modular means the "core" module doesn\'t really need that many dependencies,\nand this really simplifies the '),t("code",[e._v("no_std")]),e._v(" work.")]),e._v(" "),t("p",[e._v("This will allow the main components of BDK to work on embedded hardware as well, making it possible to use the library as a foundation for any Bitcoin hardware device like hardware wallets.")]),e._v(" "),t("h3",{attrs:{id:"lower-msrv"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#lower-msrv"}},[e._v("#")]),e._v(" Lower MSRV")]),e._v(" "),t("p",[e._v("Removing many of our current dependencies from the core components of BDK will also allow us to lower our MSRV considerably, which in turn will allow BDK to compile on older distros or entirely different toolchains like\n"),t("a",{attrs:{href:"https://github.com/thepowersgang/mrustc",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("mrustc")]),t("OutboundLink")],1),e._v(", which usually don't keep up with "),t("code",[e._v("rustc")]),e._v(" in terms of language features.")]),e._v(" "),t("h2",{attrs:{id:"architecture"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#architecture"}},[e._v("#")]),e._v(" Architecture")]),e._v(" "),t("p",[e._v("Roughly speaking, after integrating bdk_core into BDK the architecture will look like this:")]),e._v(" "),t("ul",[t("li",[e._v("bdk_core: this crate will contain all the low level components of a Bitcoin wallet. For example, using this low level API it will be possible to keep track of arbitrary scripts (without the limitations"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v("\nof descriptors) or apply individual blocks to the state of the wallet")]),e._v(" "),t("li",[e._v("bdk_compat: this crate will use the components provided by bdk_core to implement a descriptor-based wallet that supports up to two "),t("em",[e._v("keychains")]),e._v(", like our current "),t("code",[e._v("Wallet")]),e._v(" implementation does. It will allow our\nusers to upgrade to BDK 1.0 with minimal changes to their code, but being a compatibility layer it will probably lack many of the advanced features that bdk_core brings to the table")]),e._v(" "),t("li",[e._v("bdk_"),t("em",[e._v("")]),e._v(": the blockchain backends like Esplora, Electrum, RPC, will be moved into individual separate crates that users can decide to include individually")])]),e._v(" "),t("h2",{attrs:{id:"timeline"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#timeline"}},[e._v("#")]),e._v(" Timeline")]),e._v(" "),t("p",[e._v("We can't provide a precise timeline because it's a big development effort and it also depends on some relatively large PRs making into upstream project. That said, here's our rough plan:")]),e._v(" "),t("ol",[t("li",[e._v("October: during this month we will work on opening a PR to integrate bdk_core into BDK")]),e._v(" "),t("li",[e._v("November: review of the PR, work on upstreaming our code to "),t("code",[e._v("rust-miniscript")])]),e._v(" "),t("li",[e._v("December: finishing touches, examples, documentation")])]),e._v(" "),t("h2",{attrs:{id:"feature-freezing-bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#feature-freezing-bdk"}},[e._v("#")]),e._v(" Feature Freezing BDK")]),e._v(" "),t("p",[e._v("With our focus shifting to bdk_core we are officially "),t("em",[e._v("feature freezing")]),e._v(" BDK starting from release "),t("code",[e._v("0.23")]),e._v(" (which will be published on October 6th). This means that we won't be adding any new features to BDK until the\nintegration is completed, because it takes a lot of effort to implement and/or review them, and there's the risk that most of the code will have to be re-done or thrown away anyway when moving to bdk_core.")]),e._v(" "),t("p",[e._v("A notable exception to this rule will be the upcoming "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pull/770",target:"_blank",rel:"noopener noreferrer"}},[e._v("upgrade to "),t("code",[e._v("rust-bitcoin")]),e._v(" "),t("code",[e._v("0.29")]),t("OutboundLink")],1),e._v(", which is now planned for the release "),t("code",[e._v("0.24")]),e._v(" since "),t("code",[e._v("rust-miniscript")]),e._v(" "),t("code",[e._v("8.0.0")]),e._v(" hasn't been released in time for "),t("code",[e._v("0.23")]),e._v(".")]),e._v(" "),t("p",[e._v("During this feature freeze period we will keep maintaining the library, updating our dependencies, fixing bugs and making releases accordingly.")]),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("This is an exciting new development for BDK, a well needed refresh to an architecture that hasn't changed much over time, but that it's starting to show its age. This integration will open up so many new possibilities\nfor our downstream users, and it's a major step towards our goal of providing simple, yet powerful tools for Bitcoin developers 🚀.")]),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("Not every script can be expressed as descriptor "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[74],{430:function(e,t,o){"use strict";o.r(t);var a=o(7),i=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("Over the past few months the work on "),t("a",{attrs:{href:"https://github.com/LLFourn/bdk_core_staging",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk_core"),t("OutboundLink")],1),e._v(" quietly continued behind the scenes, and as the time went on it started expanding beyond the scope of just improving the "),t("em",[e._v("syncing")]),e._v(" mechanism of BDK. Being a new fresh\nproject it allowed for iterating much faster, and we soon realized we could make large improvements to the general architecture of BDK to fix many of the issues and shortcomings found over time.")]),e._v(" "),t("p",[e._v("For this reason, we decided to move forward with the project and start planning the integration into BDK itself. This blog post will briefly describe the new concept for how BDK will be structured and lay down a plan\nfor the development in the next few months.")]),e._v(" "),t("h2",{attrs:{id:"goals"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#goals"}},[e._v("#")]),e._v(" Goals")]),e._v(" "),t("p",[e._v("First of all, we should outline at least the main goals of BDK 1.0, ergo what we want to improve over the current state of the project.")]),e._v(" "),t("h3",{attrs:{id:"stable-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#stable-api"}},[e._v("#")]),e._v(" Stable API")]),e._v(" "),t("p",[e._v("Ever since the "),t("code",[e._v("0.1.0")]),e._v(" release of BDK we've always broken the API with each release. Most of the time in minor and very contained ways, but in "),t("em",[e._v("some")]),e._v(" way nonetheless. One of the main sources of breakage have been\nthe "),t("code",[e._v("Blockchain")]),e._v(" and "),t("code",[e._v("Database")]),e._v(" traits. Those two together are used in essentially any operation a user may do on a "),t("code",[e._v("Wallet")]),e._v(", and are thus impacted by any relatively large change or new feature added to the code.")]),e._v(" "),t("p",[e._v("Want to "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pull/515",target:"_blank",rel:"noopener noreferrer"}},[e._v("keep track of whether a UTXO is spent"),t("OutboundLink")],1),e._v("? You need to change the "),t("code",[e._v("Database")]),e._v(" that stores this information. Want to "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pull/669",target:"_blank",rel:"noopener noreferrer"}},[e._v("know the timestamp of the latest block"),t("OutboundLink")],1),e._v("?\nYou need to change the "),t("code",[e._v("Blockchain")]),e._v(" trait to fetch that extra bit of information. And the list goes on and on.")]),e._v(" "),t("p",[e._v("Since making changes to these traits is always so painful for us and our downstream users, this ended up delaying or considerably slowing down the development of new features in BDK.")]),e._v(" "),t("p",[e._v("bdk_core tries to minimize the (ab)use of traits, and this will help immensely when trying to provide a stable API for our users.")]),e._v(" "),t("h3",{attrs:{id:"upstreaming-our-code"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upstreaming-our-code"}},[e._v("#")]),e._v(" Upstreaming our code")]),e._v(" "),t("p",[e._v("BDK internally implements many features that could be useful to other projects as well. While working on this integration we will also try to upstream some of our code to the relevant crates, mainly "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("rust-miniscript")]),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("This has essentially three benefits:")]),e._v(" "),t("ol",[t("li",[e._v("A new set of eyes will take a look at the code, potentially spotting issues or suggesting improvements")]),e._v(" "),t("li",[e._v("This will lower the amount of code that we have to maintain ourselves")]),e._v(" "),t("li",[e._v("Other people can benefit from our code, which was previously tightly integrated into BDK and hard to re-use")])]),e._v(" "),t("h3",{attrs:{id:"partially-syncing-a-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#partially-syncing-a-wallet"}},[e._v("#")]),e._v(" Partially Syncing a Wallet")]),e._v(" "),t("p",[e._v("This single point was the main reason the bdk_core project was kickstarted, and it means giving our users the ability to incrementally sync a wallet over time instead of working in single big batches.")]),e._v(" "),t("p",[e._v("This is explained very well in the "),t("RouterLink",{attrs:{to:"/blog/bdk-core-pt1/"}},[e._v("first bdk_core post")]),e._v(", so I won't go into details here. Think of this as a much more flexible way to sync a wallet, which in turn will allow us to simplify our current implementation\nof blockchain backends like compact block filters, and also offer a better API for our users.")],1),e._v(" "),t("h3",{attrs:{id:"no-std"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#no-std"}},[e._v("#")]),e._v(" "),t("code",[e._v("no_std")])]),e._v(" "),t("p",[e._v("bdk_core is built with "),t("code",[e._v("no_std")]),e._v(" in mind since the beginning, something we've been wanting to support in BDK "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/205",target:"_blank",rel:"noopener noreferrer"}},[e._v("for a long time"),t("OutboundLink")],1),e._v('. Being more modular means the "core" module doesn\'t really need that many dependencies,\nand this really simplifies the '),t("code",[e._v("no_std")]),e._v(" work.")]),e._v(" "),t("p",[e._v("This will allow the main components of BDK to work on embedded hardware as well, making it possible to use the library as a foundation for any Bitcoin hardware device like hardware wallets.")]),e._v(" "),t("h3",{attrs:{id:"lower-msrv"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#lower-msrv"}},[e._v("#")]),e._v(" Lower MSRV")]),e._v(" "),t("p",[e._v("Removing many of our current dependencies from the core components of BDK will also allow us to lower our MSRV considerably, which in turn will allow BDK to compile on older distros or entirely different toolchains like\n"),t("a",{attrs:{href:"https://github.com/thepowersgang/mrustc",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("mrustc")]),t("OutboundLink")],1),e._v(", which usually don't keep up with "),t("code",[e._v("rustc")]),e._v(" in terms of language features.")]),e._v(" "),t("h2",{attrs:{id:"architecture"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#architecture"}},[e._v("#")]),e._v(" Architecture")]),e._v(" "),t("p",[e._v("Roughly speaking, after integrating bdk_core into BDK the architecture will look like this:")]),e._v(" "),t("ul",[t("li",[e._v("bdk_core: this crate will contain all the low level components of a Bitcoin wallet. For example, using this low level API it will be possible to keep track of arbitrary scripts (without the limitations"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v("\nof descriptors) or apply individual blocks to the state of the wallet")]),e._v(" "),t("li",[e._v("bdk_compat: this crate will use the components provided by bdk_core to implement a descriptor-based wallet that supports up to two "),t("em",[e._v("keychains")]),e._v(", like our current "),t("code",[e._v("Wallet")]),e._v(" implementation does. It will allow our\nusers to upgrade to BDK 1.0 with minimal changes to their code, but being a compatibility layer it will probably lack many of the advanced features that bdk_core brings to the table")]),e._v(" "),t("li",[e._v("bdk_"),t("em",[e._v("")]),e._v(": the blockchain backends like Esplora, Electrum, RPC, will be moved into individual separate crates that users can decide to include individually")])]),e._v(" "),t("h2",{attrs:{id:"timeline"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#timeline"}},[e._v("#")]),e._v(" Timeline")]),e._v(" "),t("p",[e._v("We can't provide a precise timeline because it's a big development effort and it also depends on some relatively large PRs making into upstream project. That said, here's our rough plan:")]),e._v(" "),t("ol",[t("li",[e._v("October: during this month we will work on opening a PR to integrate bdk_core into BDK")]),e._v(" "),t("li",[e._v("November: review of the PR, work on upstreaming our code to "),t("code",[e._v("rust-miniscript")])]),e._v(" "),t("li",[e._v("December: finishing touches, examples, documentation")])]),e._v(" "),t("h2",{attrs:{id:"feature-freezing-bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#feature-freezing-bdk"}},[e._v("#")]),e._v(" Feature Freezing BDK")]),e._v(" "),t("p",[e._v("With our focus shifting to bdk_core we are officially "),t("em",[e._v("feature freezing")]),e._v(" BDK starting from release "),t("code",[e._v("0.23")]),e._v(" (which will be published on October 6th). This means that we won't be adding any new features to BDK until the\nintegration is completed, because it takes a lot of effort to implement and/or review them, and there's the risk that most of the code will have to be re-done or thrown away anyway when moving to bdk_core.")]),e._v(" "),t("p",[e._v("A notable exception to this rule will be the upcoming "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pull/770",target:"_blank",rel:"noopener noreferrer"}},[e._v("upgrade to "),t("code",[e._v("rust-bitcoin")]),e._v(" "),t("code",[e._v("0.29")]),t("OutboundLink")],1),e._v(", which is now planned for the release "),t("code",[e._v("0.24")]),e._v(" since "),t("code",[e._v("rust-miniscript")]),e._v(" "),t("code",[e._v("8.0.0")]),e._v(" hasn't been released in time for "),t("code",[e._v("0.23")]),e._v(".")]),e._v(" "),t("p",[e._v("During this feature freeze period we will keep maintaining the library, updating our dependencies, fixing bugs and making releases accordingly.")]),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("This is an exciting new development for BDK, a well needed refresh to an architecture that hasn't changed much over time, but that it's starting to show its age. This integration will open up so many new possibilities\nfor our downstream users, and it's a major step towards our goal of providing simple, yet powerful tools for Bitcoin developers 🚀.")]),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("Not every script can be expressed as descriptor "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/75.fc268886.js b/assets/js/75.2f95f709.js similarity index 99% rename from assets/js/75.fc268886.js rename to assets/js/75.2f95f709.js index 546ed83973..9538a441cb 100644 --- a/assets/js/75.fc268886.js +++ b/assets/js/75.2f95f709.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[75],{433:function(a,s,t){"use strict";t.r(s);var e=t(7),n=Object(e.a)({},(function(){var a=this,s=a._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),s("p",[a._v("In this post we will use the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[a._v("bdk-cli"),s("OutboundLink")],1),a._v(" tool to demonstrate how to use the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[a._v("bdk"),s("OutboundLink")],1),a._v(" library to:")]),a._v(" "),s("ol",[s("li",[a._v("generate "),s("em",[a._v("testnet")]),a._v(" public and private keys")]),a._v(" "),s("li",[a._v("create "),s("a",{attrs:{href:"https://bitcoinops.org/en/topics/psbt/",target:"_blank",rel:"noopener noreferrer"}},[a._v("PSBT"),s("OutboundLink")],1),a._v("s that can be spent based on different "),s("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/",target:"_blank",rel:"noopener noreferrer"}},[a._v("miniscript spending policies"),s("OutboundLink")],1)]),a._v(" "),s("li",[a._v("cooperatively sign and finalize the resulting PSBTs")]),a._v(" "),s("li",[a._v("broadcast and confirm spending transactions")])]),a._v(" "),s("p",[a._v("The scenario we will simulate is a wallet with two spending policies:")]),a._v(" "),s("p",[a._v("A. "),s("strong",[a._v("three")]),a._v(" out of "),s("strong",[a._v("three")]),a._v(" signers must sign spending transaction input "),s("a",{attrs:{href:"https://developer.bitcoin.org/glossary.html",target:"_blank",rel:"noopener noreferrer"}},[a._v("UTXO"),s("OutboundLink")],1),a._v("s, "),s("strong",[a._v("OR")])]),a._v(" "),s("p",[a._v("B. "),s("strong",[a._v("two")]),a._v(" out of "),s("strong",[a._v("three")]),a._v(" signers must sign "),s("strong",[a._v("AND")]),a._v(" the input UTXOs must be a relative number of blocks older than the spending transaction's block")]),a._v(" "),s("p",[a._v("In a real-world wallet a longer relative time-lock would probably be used, but we chose a two block time-lock to make testing easier.")]),a._v(" "),s("p",[s("em",[a._v("Note: If you repeat these instructions on your own your extended keys, addresses, and other values will be different than shown in this post, but the end results should be the same.")])]),a._v(" "),s("h2",{attrs:{id:"initial-setup"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#initial-setup"}},[a._v("#")]),a._v(" Initial Setup")]),a._v(" "),s("h3",{attrs:{id:"step-0-install-a-recent-version-bdk-cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-0-install-a-recent-version-bdk-cli"}},[a._v("#")]),a._v(" Step 0: Install a recent version "),s("code",[a._v("bdk-cli")])]),a._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"}},[a._v("cargo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" bdk-cli "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--features")]),a._v(" electrum\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# confirm bdk-cli is installed")]),a._v("\nbdk-cli "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--version")]),a._v("\nBDK CLI "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0.4")]),a._v(".0\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# bdk-cli usage can be explored with the `help` sub-command")]),a._v("\nbdk-cli "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("help")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-1-generate-private-extended-keys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-1-generate-private-extended-keys"}},[a._v("#")]),a._v(" Step 1: Generate private extended keys")]),a._v(" "),s("p",[a._v("Generate new extended private keys for each of our wallet participants:")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli key generate "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("tee")]),a._v(" alice-key.json\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5adb4683"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"mnemonic"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"witness poverty pulse crush era item game rose bargain quantum spawn sure way behave also basket journey worry stem entry toddler floor way bone"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"xprv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tprv8ZgxMBicQKsPeAuGznXJZwfWHgWo86dFuufRBZN7ZT44UzoNG2cYmZLNLrnsm7eXhGSeccRU2nTtxunT11UkpqrRhJQefBnFJeHBddF68bg"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli key generate "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("tee")]),a._v(" bob-key.json\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5fdec309"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"mnemonic"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"shiver atom february jealous spy gallery upset height captain snake tooth master ugly orbit amazing nice parrot elevator own olympic great relief ozone violin"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"xprv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tprv8ZgxMBicQKsPei56wJPNt9u2132Ynncp2qXdfSHszobnyjaGjQwxQBGASUidc1unmEmpyMQ9XzLgvbN36MDW7LNziVFdXVGMrx6ckMHuRmd"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli key generate "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("tee")]),a._v(" carol-key.json\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"de41e56d"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"mnemonic"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"upon bridge side tool style lounge need faculty middle nation armed corn valve that undo ribbon rent digital adapt capable embody zero shiver carpet"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"xprv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tprv8ZgxMBicQKsPf2edJLnXsF2AKwkCshCy2Z7fQD6FxiNVGsbkvpLRfxM8FSKrLqqpLFzLzVUBwgE9F5MQASrbedKCrGk1NG8oJgqYtmTLQEU"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-2-extract-private-extended-keys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-2-extract-private-extended-keys"}},[a._v("#")]),a._v(" Step 2: Extract private extended keys")]),a._v(" "),s("p",[a._v("Here we use the "),s("code",[a._v("jq")]),a._v(" Unix command to parse the json output of the "),s("code",[a._v("bdk-cli")]),a._v(" commands.")]),a._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 builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_XPRV")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cat")]),a._v(" alice-key.json "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BOB_XPRV")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cat")]),a._v(" bob-key.json "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("CAROL_XPRV")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cat")]),a._v(" carol-key.json "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])]),s("h3",{attrs:{id:"step-3-derive-public-extended-keys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-3-derive-public-extended-keys"}},[a._v("#")]),a._v(" Step 3: Derive public extended keys")]),a._v(" "),s("p",[a._v("For this example we are using the "),s("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP-84"),s("OutboundLink")],1),a._v(" key path: "),s("code",[a._v("m/84h/1h/0h/0/*")]),a._v(" to derive extended public keys to share with other wallet participants.")]),a._v(" "),s("p",[a._v("Note that the "),s("code",[a._v("key derive")]),a._v(" sub-command will generate a tpub for the last hardened node in the given derivation path. You'll also notice that "),s("code",[a._v("bdk-cli")]),a._v(" will returns our tpub with the key origin (fingerprint/path) added to it (the metadata part that looks like "),s("code",[a._v("[5adb4683/84'/1'/0']")]),a._v(" right before the tpub). This key origin information is not necessary in order to use a tpub and generate addresses, but it's good practice to include it because some signers require it.")]),a._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 builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_XPUB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $ALICE_XPRV "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"m/84'/1'/0'/0\"")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".xpub"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPUB")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"\n'),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"[5adb4683/84'/1'/0']tpubDCyRBuncqwyAjSNiw1GWLmwQsWyhgPMEBpx3ZNpnCwZwf3HXerspTpaneN81KRxkwj8vjqH9pNWEPgNhen7dfE212SHfxBBbsCywxQGxvvu/0/*\"")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BOB_XPUB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $BOB_XPRV "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"m/84'/1'/0'/0\"")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".xpub"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPUB")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"\n'),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"[5fdec309/84'/1'/0']tpubDDQcUeBH9JFtgZEsHZBhmRu8AuZ8ceJY1umnipPVEg1had2coGMCWdFBXNnZWKoCPic3EMgDZTdmkAVNoakwNZu2ESSW36rQvts6VXGx4bU/0/*\"")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("CAROL_XPUB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $CAROL_XPRV "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"m/84'/1'/0'/0\"")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".xpub"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPUB")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"\n'),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"[de41e56d/84'/1'/0']tpubDCdxmvzJ5QBjTN8oCjjyT2V58AyZvA1fkmCeZRC75QMoaHcVP2m45Bv3hmnR7ttAwkb2UNYyoXdHVt4gwBqRrJqLUU2JrM43HippxiWpHra/0/*\"")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-4-create-wallet-descriptors-for-each-participant"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-4-create-wallet-descriptors-for-each-participant"}},[a._v("#")]),a._v(" Step 4: Create wallet descriptors for each participant")]),a._v(" "),s("p",[a._v("We used the "),s("a",{attrs:{href:"https://bitcoindevkit.org/bdk-cli/playground/",target:"_blank",rel:"noopener noreferrer"}},[a._v("BDK Playground Policy Compiler"),s("OutboundLink")],1),a._v(" to compile the "),s("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/",target:"_blank",rel:"noopener noreferrer"}},[a._v("miniscript"),s("OutboundLink")],1),a._v(" policy:")]),a._v(" "),s("p",[s("code",[a._v("thresh(3,pk(Alice),pk(Bob),pk(Carol),older(2))")])]),a._v(" "),s("p",[a._v("To the "),s("a",{attrs:{href:"https://bitcoindevkit.org/descriptors/",target:"_blank",rel:"noopener noreferrer"}},[a._v("output descriptor"),s("OutboundLink")],1),a._v(":")]),a._v(" "),s("p",[s("code",[a._v("wsh(thresh(3,pk(Alice),s:pk(Bob),s:pk(Carol),sdv:older(2)))")])]),a._v(" "),s("p",[a._v("This descriptor requires spending transaction inputs must be signed by all three signers, or by two signers and the spent UTXOs must be older than two blocks.")]),a._v(" "),s("p",[a._v("Each participant's descriptor only uses their own XPRV key plus the XPUB keys of the other participants.")]),a._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 builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_DESCRIPTOR")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wsh(thresh(3,pk('),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPRV")]),a._v("/84'/1'/0'/0/*),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPUB")]),a._v('),snl:older(2)))"')]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BOB_DESCRIPTOR")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wsh(thresh(3,pk('),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPRV")]),a._v("/84'/1'/0'/0/*),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPUB")]),a._v('),snl:older(2)))"')]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("CAROL_DESCRIPTOR")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wsh(thresh(3,pk('),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPRV")]),a._v("/84'/1'/0'/0/*),snl:older(2)))\"")]),a._v("\n")])])]),s("h2",{attrs:{id:"policy-a-three-signatures"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#policy-a-three-signatures"}},[a._v("#")]),a._v(" Policy A. Three signatures")]),a._v(" "),s("h3",{attrs:{id:"step-1a-create-a-testnet-segwit0-receive-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-1a-create-a-testnet-segwit0-receive-address"}},[a._v("#")]),a._v(" Step 1a: Create a testnet "),s("a",{attrs:{href:"https://en.bitcoin.it/wiki/Segregated_Witness",target:"_blank",rel:"noopener noreferrer"}},[a._v("segwit0"),s("OutboundLink")],1),a._v(" receive address")]),a._v(" "),s("p",[a._v("This step can be done independently by Alice, Bob, or Carol.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" get_new_address\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"address"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tb1qpqglt6yntay0se5vj3a7g36rql5pyzzp0w6jknfch2c0unwphsxs22g96e"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-2a-send-testnet-bitcoin-from-a-faucet-to-receive-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-2a-send-testnet-bitcoin-from-a-faucet-to-receive-address"}},[a._v("#")]),a._v(" Step 2a: Send testnet bitcoin from a faucet to receive address")]),a._v(" "),s("p",[a._v("After a faucet payment is sent, use a testnet block explorer to confirm the transaction was included in a block.")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/address/tb1qpqglt6yntay0se5vj3a7g36rql5pyzzp0w6jknfch2c0unwphsxs22g96e",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/address/tb1qpqglt6yntay0se5vj3a7g36rql5pyzzp0w6jknfch2c0unwphsxs22g96e"),s("OutboundLink")],1)]),a._v(" "),s("h3",{attrs:{id:"step-3a-sync-participant-wallets-and-confirm-balance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-3a-sync-participant-wallets-and-confirm-balance"}},[a._v("#")]),a._v(" Step 3a: Sync participant wallets and confirm balance")]),a._v(" "),s("p",[a._v("This step must be done by Alice, Bob, and Carol so their individual descriptor wallets know about the faucet transaction they will later be spending the output of.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-4a-view-wallet-spending-policies"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-4a-view-wallet-spending-policies"}},[a._v("#")]),a._v(" Step 4a: View wallet spending policies")]),a._v(" "),s("p",[a._v("This can also be done by any wallet participant, as long as they have the same descriptor and extended public keys from the other particpants..")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" policies\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"external"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"conditions"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"csv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"items"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("3")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"m"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("3")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"n"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("4")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"PARTIAL"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ydtnup84"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"items"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"condition"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"COMPLETE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5adb4683"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"uyxvyzqt"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"SIGNATURE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5fdec309"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dzkmxcgu"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"SIGNATURE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"de41e56d"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ekfu5uaw"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"SIGNATURE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"condition"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"csv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"COMPLETE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"8kel7sdw"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"RELATIVETIMELOCK"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"value"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"threshold"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("3")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"THRESH"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"internal"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-5a-create-spending-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-5a-create-spending-transaction"}},[a._v("#")]),a._v(" Step 5a: Create spending transaction")]),a._v(" "),s("p",[a._v("The transaction can also be created by Alice, Bob, or Carol, or even an untrusted coordinator that only has all three tpubs.")]),a._v(" "),s("p",[a._v("Note that the argument provided to the --external_policy flag contains the id retrieved from the "),s("code",[a._v("policies")]),a._v(" subcommand in the above step, in this case "),s("code",[a._v("ydtnup84")]),a._v(".")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,2]}"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"details"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fees"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("169")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"height"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"received"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"sent"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"timestamp"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("1614058791")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"transaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"psbt"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"cHNidP8BAFIBAAAAAYx7T0cL7EoUYBEU0mSL6+DS4VQafUzJgAf0Ftlbkya5AQAAAAD/////AWcmAAAAAAAAFgAU3RacollkleIxk+lz8my/mLCXiH0AAAAAAAEBKxAnAAAAAAAAIgAgCBH16JNfSPhmjJR75EdDB+gSCEF7tStNOLqw/k3BvA0BBXchA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxrHwhA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mrJN8IQIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOKyTfHZjUrJpaJNThyIGAi82No/6bA0LQO2BoHoQ0H8M8+VtQNHr41nhLDTvSPM4DO66tnIAAAAAAAAAACIGA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxGFrbRoNUAACAAQAAgAAAAIAAAAAAAAAAACIGA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mDEMxpeYAAAAAAAAAAAAA"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("UNSIGNED_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,2]}"')]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])]),s("h3",{attrs:{id:"step-6a-sign-and-finalize-psbts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-6a-sign-and-finalize-psbts"}},[a._v("#")]),a._v(" Step 6a: Sign and finalize PSBTs")]),a._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 comment"}},[a._v("# ALICE SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_SIGNED_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $UNSIGNED_PSBT "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# BOB SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_BOB_SIGNED_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $BOB_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $ALICE_SIGNED_PSBT "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# CAROL SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("FINAL_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $CAROL_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $ALICE_BOB_SIGNED_PSBT "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("## PSBT is finalized")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_BOB_SIGNED_PSBT")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"is_finalized"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" true,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"psbt"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"cHNidP8BAFIBAAAAAYx7T0cL7EoUYBEU0mSL6+DS4VQafUzJgAf0Ftlbkya5AQAAAAD/////AWcmAAAAAAAAFgAU3RacollkleIxk+lz8my/mLCXiH0AAAAAAAEBKxAnAAAAAAAAIgAgCBH16JNfSPhmjJR75EdDB+gSCEF7tStNOLqw/k3BvA0iAgIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOEcwRAIgRPXSwFLfzD1YQzw5FGYA0TgiQ+D88hSOVDbvyUZDiPUCIAbguaSGgCbBAXo5sIxpZ4c1dcGkYyrrqnDjc1jcdJ1CASICA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxSDBFAiEA0kdkvlA+k5kUBWVUM8SkR4Ua9pnXF66ECVwIM1l0doACIF0aMiORVC35+M3GHF2Vl8Q7t455mebrr1HuLaAyxBOYASICA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mRzBEAiBPJlQEnuVDHgfgOdTZNlIcRZz2iqHoMWfDmLMFqJSOQAIgCuOcTKp/VaaqwIjnYfMKO3eQ1k9pOygSWt6teT1o13QBAQV3IQN3NQJNpHBjszoenkVxSn6Z6cz9Zc33FyGIcRRmRudZsax8IQO+WA10Swy7fnl+VLBNN5iBlErED9jKyfZZte3Blw8NpqyTfCECLzY2j/psDQtA7YGgehDQfwzz5W1A0evjWeEsNO9I8zisk3x2Y1KyaWiTU4ciBgIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOBjeQeVtVAAAgAEAAIAAAACAAAAAAAAAAAAiBgN3NQJNpHBjszoenkVxSn6Z6cz9Zc33FyGIcRRmRudZsQwpbm6KAAAAAAAAAAAiBgO+WA10Swy7fnl+VLBNN5iBlErED9jKyfZZte3Blw8NpgxDMaXmAAAAAAAAAAABBwABCP1TAQUARzBEAiBE9dLAUt/MPVhDPDkUZgDROCJD4PzyFI5UNu/JRkOI9QIgBuC5pIaAJsEBejmwjGlnhzV1waRjKuuqcONzWNx0nUIBRzBEAiBPJlQEnuVDHgfgOdTZNlIcRZz2iqHoMWfDmLMFqJSOQAIgCuOcTKp/VaaqwIjnYfMKO3eQ1k9pOygSWt6teT1o13QBSDBFAiEA0kdkvlA+k5kUBWVUM8SkR4Ua9pnXF66ECVwIM1l0doACIF0aMiORVC35+M3GHF2Vl8Q7t455mebrr1HuLaAyxBOYAXchA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxrHwhA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mrJN8IQIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOKyTfHZjUrJpaJNThwAA"')]),a._v("\n")])])]),s("h3",{attrs:{id:"step-7a-broadcast-finalized-psbt"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-7a-broadcast-finalized-psbt"}},[a._v("#")]),a._v(" Step 7a: Broadcast finalized PSBT")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" broadcast "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$FINAL_PSBT")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-8a-confirm-transaction-included-in-a-testnet-block"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-8a-confirm-transaction-included-in-a-testnet-block"}},[a._v("#")]),a._v(" Step 8a: Confirm transaction included in a testnet block")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/tx/3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/tx/3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e"),s("OutboundLink")],1)]),a._v(" "),s("p",[a._v("And new wallet balance is now zero.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h4",{attrs:{id:"done-"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#done-"}},[a._v("#")]),a._v(" DONE!")]),a._v(" "),s("h2",{attrs:{id:"policy-b-two-signatures-after-a-relative-time-lock"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#policy-b-two-signatures-after-a-relative-time-lock"}},[a._v("#")]),a._v(" Policy B. Two signatures after a relative time lock")]),a._v(" "),s("p",[a._v("Now we will use the same extended private and public keys, and the same descriptors to receive and spend testnet bitcoin using only two of our participants signatures after the transaction input's relative time-lock has expired.")]),a._v(" "),s("h3",{attrs:{id:"step-1b-create-a-new-testnet-receive-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-1b-create-a-new-testnet-receive-address"}},[a._v("#")]),a._v(" Step 1b: Create a new testnet receive address")]),a._v(" "),s("p",[a._v("The receive address can still be generated by Alice, Bob, or Carol.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_new_address\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"address"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tb1q886w2zmtakwxpngs9kn7y0a7tvd6e24u58sse2sv92zrjpnenfhqtfnmw9"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-2b-fund-new-address-from-testnet-faucet"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-2b-fund-new-address-from-testnet-faucet"}},[a._v("#")]),a._v(" Step 2b: Fund new address from testnet faucet")]),a._v(" "),s("p",[a._v("After the faucet payment is sent, confirm using a testnet block explorer to verify the transaction was included in a block.")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/address/tb1q886w2zmtakwxpngs9kn7y0a7tvd6e24u58sse2sv92zrjpnenfhqtfnmw9",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/address/tb1q886w2zmtakwxpngs9kn7y0a7tvd6e24u58sse2sv92zrjpnenfhqtfnmw9"),s("OutboundLink")],1)]),a._v(" "),s("h3",{attrs:{id:"step-3b-sync-wallet-and-confirm-wallet-balance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-3b-sync-wallet-and-confirm-wallet-balance"}},[a._v("#")]),a._v(" Step 3b: Sync wallet and confirm wallet balance")]),a._v(" "),s("p",[a._v("This step must be done by Alice and Bob so their individual descriptor wallets know about the faucet transaction they will later be spending the output of.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# NO CAROL SHE LOST HER KEY!")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-4b-create-spending-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-4b-create-spending-transaction"}},[a._v("#")]),a._v(" Step 4b: Create spending transaction")]),a._v(" "),s("p",[a._v("This spending transaction uses Alice and Bob's keys plus a two block relative time-lock, see above "),s("a",{attrs:{href:"#step-4a-view-wallet-spending-policies"}},[a._v("Step 4a")]),a._v(" for the policy id. The transaction can be created by Alice or Bob.")]),a._v(" "),s("p",[a._v("A time based relative time-lock can be used instead of one based on blocks but is slightly more complicated to calculate. See\n"),s("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki#specification",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP-68"),s("OutboundLink")],1),a._v(" for the details.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,3]}"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"details"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fees"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("169")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"height"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"received"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"sent"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"timestamp"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("1614059434")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"transaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"psbt"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"cHNidP8BAFICAAAAAYmc6mhj4Cf4pcJyBvxSbCd9IB1yDGs+plzb95t7++v0AAAAAAACAAAAAWcmAAAAAAAAFgAU3RacollkleIxk+lz8my/mLCXiH0AAAAAAAEBKxAnAAAAAAAAIgAgOfTlC2vtnGDNEC2n4j++Wxusqryh4QyqDCqEOQZ5mm4BBXchAlUVWMkNwGkCxDe4ZAcyz7HI+Vpmo4A5//OvkV33PCpprHwhAq9NOHBbPEdKr8IzYEomNTk1eokAkLQ9+ZMuS/OlX+nFrJN8IQOrU70B/wo/oUUCKFQ2cIsBxx6SysE7uVwxyu0ozM4zYqyTfHZjUrJpaJNThyIGAlUVWMkNwGkCxDe4ZAcyz7HI+Vpmo4A5//OvkV33PCppGFrbRoNUAACAAQAAgAAAAIAAAAAAAQAAACIGAq9NOHBbPEdKr8IzYEomNTk1eokAkLQ9+ZMuS/OlX+nFDEMxpeYAAAAAAQAAACIGA6tTvQH/Cj+hRQIoVDZwiwHHHpLKwTu5XDHK7SjMzjNiDO66tnIAAAAAAQAAAAAA"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("UNSIGNED_PSBT2")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,3]}"')]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])]),s("h3",{attrs:{id:"step-5b-sign-and-finalize-psbts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-5b-sign-and-finalize-psbts"}},[a._v("#")]),a._v(" Step 5b: Sign and finalize PSBTs")]),a._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 comment"}},[a._v("# ALICE SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_SIGNED_PSBT2")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $UNSIGNED_PSBT2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# BOB SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("FINAL_PSBT2")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $BOB_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $ALICE_SIGNED_PSBT2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# CAROL DOES *NOT* SIGN")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-6b-broadcast-finalized-psbt"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-6b-broadcast-finalized-psbt"}},[a._v("#")]),a._v(" Step 6b: Broadcast finalized PSBT")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" broadcast "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$FINAL_PSBT2")]),a._v("\nthread "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'main'")]),a._v(" panicked at "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('\'called `Result::unwrap()` on an `Err` value: Electrum(Protocol(String("sendrawtransaction RPC error: {\\"code\\":-26,\\"message\\":\\"non-BIP68-final\\"}")))\'')]),a._v(", src/bdk_cli.rs:168:50\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Oops we didn't wait long enough for the relative time lock to expire")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Try again in ~20 mins and it is successfully broadcast")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" broadcast "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$FINAL_PSBT2")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-7b-view-confirmed-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-7b-view-confirmed-transaction"}},[a._v("#")]),a._v(" Step 7b: View confirmed transaction")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/tx/6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/tx/6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28"),s("OutboundLink")],1)]),a._v(" "),s("p",[a._v("And wallet balance is again zero")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h4",{attrs:{id:"done-again-"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#done-again-"}},[a._v("#")]),a._v(" Done again!")]),a._v(" "),s("p",[a._v("In this demo we showed how to receive and spend bitcoin using two different descriptor wallet policies using the "),s("code",[a._v("bdk")]),a._v(" library and "),s("code",[a._v("bdk-cli")]),a._v(" wallet tool.")])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[75],{431:function(a,s,t){"use strict";t.r(s);var e=t(7),n=Object(e.a)({},(function(){var a=this,s=a._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),s("p",[a._v("In this post we will use the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[a._v("bdk-cli"),s("OutboundLink")],1),a._v(" tool to demonstrate how to use the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[a._v("bdk"),s("OutboundLink")],1),a._v(" library to:")]),a._v(" "),s("ol",[s("li",[a._v("generate "),s("em",[a._v("testnet")]),a._v(" public and private keys")]),a._v(" "),s("li",[a._v("create "),s("a",{attrs:{href:"https://bitcoinops.org/en/topics/psbt/",target:"_blank",rel:"noopener noreferrer"}},[a._v("PSBT"),s("OutboundLink")],1),a._v("s that can be spent based on different "),s("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/",target:"_blank",rel:"noopener noreferrer"}},[a._v("miniscript spending policies"),s("OutboundLink")],1)]),a._v(" "),s("li",[a._v("cooperatively sign and finalize the resulting PSBTs")]),a._v(" "),s("li",[a._v("broadcast and confirm spending transactions")])]),a._v(" "),s("p",[a._v("The scenario we will simulate is a wallet with two spending policies:")]),a._v(" "),s("p",[a._v("A. "),s("strong",[a._v("three")]),a._v(" out of "),s("strong",[a._v("three")]),a._v(" signers must sign spending transaction input "),s("a",{attrs:{href:"https://developer.bitcoin.org/glossary.html",target:"_blank",rel:"noopener noreferrer"}},[a._v("UTXO"),s("OutboundLink")],1),a._v("s, "),s("strong",[a._v("OR")])]),a._v(" "),s("p",[a._v("B. "),s("strong",[a._v("two")]),a._v(" out of "),s("strong",[a._v("three")]),a._v(" signers must sign "),s("strong",[a._v("AND")]),a._v(" the input UTXOs must be a relative number of blocks older than the spending transaction's block")]),a._v(" "),s("p",[a._v("In a real-world wallet a longer relative time-lock would probably be used, but we chose a two block time-lock to make testing easier.")]),a._v(" "),s("p",[s("em",[a._v("Note: If you repeat these instructions on your own your extended keys, addresses, and other values will be different than shown in this post, but the end results should be the same.")])]),a._v(" "),s("h2",{attrs:{id:"initial-setup"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#initial-setup"}},[a._v("#")]),a._v(" Initial Setup")]),a._v(" "),s("h3",{attrs:{id:"step-0-install-a-recent-version-bdk-cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-0-install-a-recent-version-bdk-cli"}},[a._v("#")]),a._v(" Step 0: Install a recent version "),s("code",[a._v("bdk-cli")])]),a._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"}},[a._v("cargo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" bdk-cli "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--features")]),a._v(" electrum\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# confirm bdk-cli is installed")]),a._v("\nbdk-cli "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--version")]),a._v("\nBDK CLI "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0.4")]),a._v(".0\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# bdk-cli usage can be explored with the `help` sub-command")]),a._v("\nbdk-cli "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("help")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-1-generate-private-extended-keys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-1-generate-private-extended-keys"}},[a._v("#")]),a._v(" Step 1: Generate private extended keys")]),a._v(" "),s("p",[a._v("Generate new extended private keys for each of our wallet participants:")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli key generate "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("tee")]),a._v(" alice-key.json\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5adb4683"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"mnemonic"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"witness poverty pulse crush era item game rose bargain quantum spawn sure way behave also basket journey worry stem entry toddler floor way bone"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"xprv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tprv8ZgxMBicQKsPeAuGznXJZwfWHgWo86dFuufRBZN7ZT44UzoNG2cYmZLNLrnsm7eXhGSeccRU2nTtxunT11UkpqrRhJQefBnFJeHBddF68bg"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli key generate "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("tee")]),a._v(" bob-key.json\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5fdec309"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"mnemonic"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"shiver atom february jealous spy gallery upset height captain snake tooth master ugly orbit amazing nice parrot elevator own olympic great relief ozone violin"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"xprv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tprv8ZgxMBicQKsPei56wJPNt9u2132Ynncp2qXdfSHszobnyjaGjQwxQBGASUidc1unmEmpyMQ9XzLgvbN36MDW7LNziVFdXVGMrx6ckMHuRmd"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli key generate "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("tee")]),a._v(" carol-key.json\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"de41e56d"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"mnemonic"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"upon bridge side tool style lounge need faculty middle nation armed corn valve that undo ribbon rent digital adapt capable embody zero shiver carpet"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"xprv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tprv8ZgxMBicQKsPf2edJLnXsF2AKwkCshCy2Z7fQD6FxiNVGsbkvpLRfxM8FSKrLqqpLFzLzVUBwgE9F5MQASrbedKCrGk1NG8oJgqYtmTLQEU"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-2-extract-private-extended-keys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-2-extract-private-extended-keys"}},[a._v("#")]),a._v(" Step 2: Extract private extended keys")]),a._v(" "),s("p",[a._v("Here we use the "),s("code",[a._v("jq")]),a._v(" Unix command to parse the json output of the "),s("code",[a._v("bdk-cli")]),a._v(" commands.")]),a._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 builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_XPRV")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cat")]),a._v(" alice-key.json "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BOB_XPRV")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cat")]),a._v(" bob-key.json "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("CAROL_XPRV")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cat")]),a._v(" carol-key.json "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])]),s("h3",{attrs:{id:"step-3-derive-public-extended-keys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-3-derive-public-extended-keys"}},[a._v("#")]),a._v(" Step 3: Derive public extended keys")]),a._v(" "),s("p",[a._v("For this example we are using the "),s("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP-84"),s("OutboundLink")],1),a._v(" key path: "),s("code",[a._v("m/84h/1h/0h/0/*")]),a._v(" to derive extended public keys to share with other wallet participants.")]),a._v(" "),s("p",[a._v("Note that the "),s("code",[a._v("key derive")]),a._v(" sub-command will generate a tpub for the last hardened node in the given derivation path. You'll also notice that "),s("code",[a._v("bdk-cli")]),a._v(" will returns our tpub with the key origin (fingerprint/path) added to it (the metadata part that looks like "),s("code",[a._v("[5adb4683/84'/1'/0']")]),a._v(" right before the tpub). This key origin information is not necessary in order to use a tpub and generate addresses, but it's good practice to include it because some signers require it.")]),a._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 builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_XPUB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $ALICE_XPRV "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"m/84'/1'/0'/0\"")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".xpub"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPUB")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"\n'),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"[5adb4683/84'/1'/0']tpubDCyRBuncqwyAjSNiw1GWLmwQsWyhgPMEBpx3ZNpnCwZwf3HXerspTpaneN81KRxkwj8vjqH9pNWEPgNhen7dfE212SHfxBBbsCywxQGxvvu/0/*\"")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BOB_XPUB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $BOB_XPRV "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"m/84'/1'/0'/0\"")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".xpub"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPUB")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"\n'),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"[5fdec309/84'/1'/0']tpubDDQcUeBH9JFtgZEsHZBhmRu8AuZ8ceJY1umnipPVEg1had2coGMCWdFBXNnZWKoCPic3EMgDZTdmkAVNoakwNZu2ESSW36rQvts6VXGx4bU/0/*\"")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("CAROL_XPUB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $CAROL_XPRV "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"m/84'/1'/0'/0\"")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".xpub"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPUB")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"\n'),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"[de41e56d/84'/1'/0']tpubDCdxmvzJ5QBjTN8oCjjyT2V58AyZvA1fkmCeZRC75QMoaHcVP2m45Bv3hmnR7ttAwkb2UNYyoXdHVt4gwBqRrJqLUU2JrM43HippxiWpHra/0/*\"")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-4-create-wallet-descriptors-for-each-participant"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-4-create-wallet-descriptors-for-each-participant"}},[a._v("#")]),a._v(" Step 4: Create wallet descriptors for each participant")]),a._v(" "),s("p",[a._v("We used the "),s("a",{attrs:{href:"https://bitcoindevkit.org/bdk-cli/playground/",target:"_blank",rel:"noopener noreferrer"}},[a._v("BDK Playground Policy Compiler"),s("OutboundLink")],1),a._v(" to compile the "),s("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/",target:"_blank",rel:"noopener noreferrer"}},[a._v("miniscript"),s("OutboundLink")],1),a._v(" policy:")]),a._v(" "),s("p",[s("code",[a._v("thresh(3,pk(Alice),pk(Bob),pk(Carol),older(2))")])]),a._v(" "),s("p",[a._v("To the "),s("a",{attrs:{href:"https://bitcoindevkit.org/descriptors/",target:"_blank",rel:"noopener noreferrer"}},[a._v("output descriptor"),s("OutboundLink")],1),a._v(":")]),a._v(" "),s("p",[s("code",[a._v("wsh(thresh(3,pk(Alice),s:pk(Bob),s:pk(Carol),sdv:older(2)))")])]),a._v(" "),s("p",[a._v("This descriptor requires spending transaction inputs must be signed by all three signers, or by two signers and the spent UTXOs must be older than two blocks.")]),a._v(" "),s("p",[a._v("Each participant's descriptor only uses their own XPRV key plus the XPUB keys of the other participants.")]),a._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 builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_DESCRIPTOR")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wsh(thresh(3,pk('),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPRV")]),a._v("/84'/1'/0'/0/*),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPUB")]),a._v('),snl:older(2)))"')]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BOB_DESCRIPTOR")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wsh(thresh(3,pk('),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPRV")]),a._v("/84'/1'/0'/0/*),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPUB")]),a._v('),snl:older(2)))"')]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("CAROL_DESCRIPTOR")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wsh(thresh(3,pk('),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPRV")]),a._v("/84'/1'/0'/0/*),snl:older(2)))\"")]),a._v("\n")])])]),s("h2",{attrs:{id:"policy-a-three-signatures"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#policy-a-three-signatures"}},[a._v("#")]),a._v(" Policy A. Three signatures")]),a._v(" "),s("h3",{attrs:{id:"step-1a-create-a-testnet-segwit0-receive-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-1a-create-a-testnet-segwit0-receive-address"}},[a._v("#")]),a._v(" Step 1a: Create a testnet "),s("a",{attrs:{href:"https://en.bitcoin.it/wiki/Segregated_Witness",target:"_blank",rel:"noopener noreferrer"}},[a._v("segwit0"),s("OutboundLink")],1),a._v(" receive address")]),a._v(" "),s("p",[a._v("This step can be done independently by Alice, Bob, or Carol.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" get_new_address\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"address"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tb1qpqglt6yntay0se5vj3a7g36rql5pyzzp0w6jknfch2c0unwphsxs22g96e"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-2a-send-testnet-bitcoin-from-a-faucet-to-receive-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-2a-send-testnet-bitcoin-from-a-faucet-to-receive-address"}},[a._v("#")]),a._v(" Step 2a: Send testnet bitcoin from a faucet to receive address")]),a._v(" "),s("p",[a._v("After a faucet payment is sent, use a testnet block explorer to confirm the transaction was included in a block.")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/address/tb1qpqglt6yntay0se5vj3a7g36rql5pyzzp0w6jknfch2c0unwphsxs22g96e",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/address/tb1qpqglt6yntay0se5vj3a7g36rql5pyzzp0w6jknfch2c0unwphsxs22g96e"),s("OutboundLink")],1)]),a._v(" "),s("h3",{attrs:{id:"step-3a-sync-participant-wallets-and-confirm-balance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-3a-sync-participant-wallets-and-confirm-balance"}},[a._v("#")]),a._v(" Step 3a: Sync participant wallets and confirm balance")]),a._v(" "),s("p",[a._v("This step must be done by Alice, Bob, and Carol so their individual descriptor wallets know about the faucet transaction they will later be spending the output of.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-4a-view-wallet-spending-policies"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-4a-view-wallet-spending-policies"}},[a._v("#")]),a._v(" Step 4a: View wallet spending policies")]),a._v(" "),s("p",[a._v("This can also be done by any wallet participant, as long as they have the same descriptor and extended public keys from the other particpants..")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" policies\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"external"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"conditions"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"csv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"items"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("3")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"m"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("3")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"n"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("4")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"PARTIAL"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ydtnup84"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"items"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"condition"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"COMPLETE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5adb4683"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"uyxvyzqt"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"SIGNATURE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5fdec309"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dzkmxcgu"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"SIGNATURE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"de41e56d"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ekfu5uaw"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"SIGNATURE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"condition"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"csv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"COMPLETE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"8kel7sdw"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"RELATIVETIMELOCK"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"value"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"threshold"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("3")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"THRESH"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"internal"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-5a-create-spending-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-5a-create-spending-transaction"}},[a._v("#")]),a._v(" Step 5a: Create spending transaction")]),a._v(" "),s("p",[a._v("The transaction can also be created by Alice, Bob, or Carol, or even an untrusted coordinator that only has all three tpubs.")]),a._v(" "),s("p",[a._v("Note that the argument provided to the --external_policy flag contains the id retrieved from the "),s("code",[a._v("policies")]),a._v(" subcommand in the above step, in this case "),s("code",[a._v("ydtnup84")]),a._v(".")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,2]}"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"details"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fees"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("169")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"height"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"received"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"sent"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"timestamp"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("1614058791")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"transaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"psbt"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"cHNidP8BAFIBAAAAAYx7T0cL7EoUYBEU0mSL6+DS4VQafUzJgAf0Ftlbkya5AQAAAAD/////AWcmAAAAAAAAFgAU3RacollkleIxk+lz8my/mLCXiH0AAAAAAAEBKxAnAAAAAAAAIgAgCBH16JNfSPhmjJR75EdDB+gSCEF7tStNOLqw/k3BvA0BBXchA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxrHwhA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mrJN8IQIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOKyTfHZjUrJpaJNThyIGAi82No/6bA0LQO2BoHoQ0H8M8+VtQNHr41nhLDTvSPM4DO66tnIAAAAAAAAAACIGA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxGFrbRoNUAACAAQAAgAAAAIAAAAAAAAAAACIGA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mDEMxpeYAAAAAAAAAAAAA"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("UNSIGNED_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,2]}"')]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])]),s("h3",{attrs:{id:"step-6a-sign-and-finalize-psbts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-6a-sign-and-finalize-psbts"}},[a._v("#")]),a._v(" Step 6a: Sign and finalize PSBTs")]),a._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 comment"}},[a._v("# ALICE SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_SIGNED_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $UNSIGNED_PSBT "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# BOB SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_BOB_SIGNED_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $BOB_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $ALICE_SIGNED_PSBT "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# CAROL SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("FINAL_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $CAROL_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $ALICE_BOB_SIGNED_PSBT "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("## PSBT is finalized")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_BOB_SIGNED_PSBT")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"is_finalized"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" true,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"psbt"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"cHNidP8BAFIBAAAAAYx7T0cL7EoUYBEU0mSL6+DS4VQafUzJgAf0Ftlbkya5AQAAAAD/////AWcmAAAAAAAAFgAU3RacollkleIxk+lz8my/mLCXiH0AAAAAAAEBKxAnAAAAAAAAIgAgCBH16JNfSPhmjJR75EdDB+gSCEF7tStNOLqw/k3BvA0iAgIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOEcwRAIgRPXSwFLfzD1YQzw5FGYA0TgiQ+D88hSOVDbvyUZDiPUCIAbguaSGgCbBAXo5sIxpZ4c1dcGkYyrrqnDjc1jcdJ1CASICA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxSDBFAiEA0kdkvlA+k5kUBWVUM8SkR4Ua9pnXF66ECVwIM1l0doACIF0aMiORVC35+M3GHF2Vl8Q7t455mebrr1HuLaAyxBOYASICA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mRzBEAiBPJlQEnuVDHgfgOdTZNlIcRZz2iqHoMWfDmLMFqJSOQAIgCuOcTKp/VaaqwIjnYfMKO3eQ1k9pOygSWt6teT1o13QBAQV3IQN3NQJNpHBjszoenkVxSn6Z6cz9Zc33FyGIcRRmRudZsax8IQO+WA10Swy7fnl+VLBNN5iBlErED9jKyfZZte3Blw8NpqyTfCECLzY2j/psDQtA7YGgehDQfwzz5W1A0evjWeEsNO9I8zisk3x2Y1KyaWiTU4ciBgIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOBjeQeVtVAAAgAEAAIAAAACAAAAAAAAAAAAiBgN3NQJNpHBjszoenkVxSn6Z6cz9Zc33FyGIcRRmRudZsQwpbm6KAAAAAAAAAAAiBgO+WA10Swy7fnl+VLBNN5iBlErED9jKyfZZte3Blw8NpgxDMaXmAAAAAAAAAAABBwABCP1TAQUARzBEAiBE9dLAUt/MPVhDPDkUZgDROCJD4PzyFI5UNu/JRkOI9QIgBuC5pIaAJsEBejmwjGlnhzV1waRjKuuqcONzWNx0nUIBRzBEAiBPJlQEnuVDHgfgOdTZNlIcRZz2iqHoMWfDmLMFqJSOQAIgCuOcTKp/VaaqwIjnYfMKO3eQ1k9pOygSWt6teT1o13QBSDBFAiEA0kdkvlA+k5kUBWVUM8SkR4Ua9pnXF66ECVwIM1l0doACIF0aMiORVC35+M3GHF2Vl8Q7t455mebrr1HuLaAyxBOYAXchA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxrHwhA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mrJN8IQIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOKyTfHZjUrJpaJNThwAA"')]),a._v("\n")])])]),s("h3",{attrs:{id:"step-7a-broadcast-finalized-psbt"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-7a-broadcast-finalized-psbt"}},[a._v("#")]),a._v(" Step 7a: Broadcast finalized PSBT")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" broadcast "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$FINAL_PSBT")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-8a-confirm-transaction-included-in-a-testnet-block"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-8a-confirm-transaction-included-in-a-testnet-block"}},[a._v("#")]),a._v(" Step 8a: Confirm transaction included in a testnet block")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/tx/3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/tx/3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e"),s("OutboundLink")],1)]),a._v(" "),s("p",[a._v("And new wallet balance is now zero.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h4",{attrs:{id:"done-"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#done-"}},[a._v("#")]),a._v(" DONE!")]),a._v(" "),s("h2",{attrs:{id:"policy-b-two-signatures-after-a-relative-time-lock"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#policy-b-two-signatures-after-a-relative-time-lock"}},[a._v("#")]),a._v(" Policy B. Two signatures after a relative time lock")]),a._v(" "),s("p",[a._v("Now we will use the same extended private and public keys, and the same descriptors to receive and spend testnet bitcoin using only two of our participants signatures after the transaction input's relative time-lock has expired.")]),a._v(" "),s("h3",{attrs:{id:"step-1b-create-a-new-testnet-receive-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-1b-create-a-new-testnet-receive-address"}},[a._v("#")]),a._v(" Step 1b: Create a new testnet receive address")]),a._v(" "),s("p",[a._v("The receive address can still be generated by Alice, Bob, or Carol.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_new_address\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"address"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tb1q886w2zmtakwxpngs9kn7y0a7tvd6e24u58sse2sv92zrjpnenfhqtfnmw9"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-2b-fund-new-address-from-testnet-faucet"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-2b-fund-new-address-from-testnet-faucet"}},[a._v("#")]),a._v(" Step 2b: Fund new address from testnet faucet")]),a._v(" "),s("p",[a._v("After the faucet payment is sent, confirm using a testnet block explorer to verify the transaction was included in a block.")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/address/tb1q886w2zmtakwxpngs9kn7y0a7tvd6e24u58sse2sv92zrjpnenfhqtfnmw9",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/address/tb1q886w2zmtakwxpngs9kn7y0a7tvd6e24u58sse2sv92zrjpnenfhqtfnmw9"),s("OutboundLink")],1)]),a._v(" "),s("h3",{attrs:{id:"step-3b-sync-wallet-and-confirm-wallet-balance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-3b-sync-wallet-and-confirm-wallet-balance"}},[a._v("#")]),a._v(" Step 3b: Sync wallet and confirm wallet balance")]),a._v(" "),s("p",[a._v("This step must be done by Alice and Bob so their individual descriptor wallets know about the faucet transaction they will later be spending the output of.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# NO CAROL SHE LOST HER KEY!")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-4b-create-spending-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-4b-create-spending-transaction"}},[a._v("#")]),a._v(" Step 4b: Create spending transaction")]),a._v(" "),s("p",[a._v("This spending transaction uses Alice and Bob's keys plus a two block relative time-lock, see above "),s("a",{attrs:{href:"#step-4a-view-wallet-spending-policies"}},[a._v("Step 4a")]),a._v(" for the policy id. The transaction can be created by Alice or Bob.")]),a._v(" "),s("p",[a._v("A time based relative time-lock can be used instead of one based on blocks but is slightly more complicated to calculate. See\n"),s("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki#specification",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP-68"),s("OutboundLink")],1),a._v(" for the details.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,3]}"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"details"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fees"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("169")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"height"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"received"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"sent"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"timestamp"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("1614059434")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"transaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"psbt"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"cHNidP8BAFICAAAAAYmc6mhj4Cf4pcJyBvxSbCd9IB1yDGs+plzb95t7++v0AAAAAAACAAAAAWcmAAAAAAAAFgAU3RacollkleIxk+lz8my/mLCXiH0AAAAAAAEBKxAnAAAAAAAAIgAgOfTlC2vtnGDNEC2n4j++Wxusqryh4QyqDCqEOQZ5mm4BBXchAlUVWMkNwGkCxDe4ZAcyz7HI+Vpmo4A5//OvkV33PCpprHwhAq9NOHBbPEdKr8IzYEomNTk1eokAkLQ9+ZMuS/OlX+nFrJN8IQOrU70B/wo/oUUCKFQ2cIsBxx6SysE7uVwxyu0ozM4zYqyTfHZjUrJpaJNThyIGAlUVWMkNwGkCxDe4ZAcyz7HI+Vpmo4A5//OvkV33PCppGFrbRoNUAACAAQAAgAAAAIAAAAAAAQAAACIGAq9NOHBbPEdKr8IzYEomNTk1eokAkLQ9+ZMuS/OlX+nFDEMxpeYAAAAAAQAAACIGA6tTvQH/Cj+hRQIoVDZwiwHHHpLKwTu5XDHK7SjMzjNiDO66tnIAAAAAAQAAAAAA"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("UNSIGNED_PSBT2")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,3]}"')]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])]),s("h3",{attrs:{id:"step-5b-sign-and-finalize-psbts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-5b-sign-and-finalize-psbts"}},[a._v("#")]),a._v(" Step 5b: Sign and finalize PSBTs")]),a._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 comment"}},[a._v("# ALICE SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_SIGNED_PSBT2")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $UNSIGNED_PSBT2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# BOB SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("FINAL_PSBT2")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $BOB_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $ALICE_SIGNED_PSBT2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# CAROL DOES *NOT* SIGN")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-6b-broadcast-finalized-psbt"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-6b-broadcast-finalized-psbt"}},[a._v("#")]),a._v(" Step 6b: Broadcast finalized PSBT")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" broadcast "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$FINAL_PSBT2")]),a._v("\nthread "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'main'")]),a._v(" panicked at "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('\'called `Result::unwrap()` on an `Err` value: Electrum(Protocol(String("sendrawtransaction RPC error: {\\"code\\":-26,\\"message\\":\\"non-BIP68-final\\"}")))\'')]),a._v(", src/bdk_cli.rs:168:50\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Oops we didn't wait long enough for the relative time lock to expire")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Try again in ~20 mins and it is successfully broadcast")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" broadcast "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$FINAL_PSBT2")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-7b-view-confirmed-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-7b-view-confirmed-transaction"}},[a._v("#")]),a._v(" Step 7b: View confirmed transaction")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/tx/6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/tx/6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28"),s("OutboundLink")],1)]),a._v(" "),s("p",[a._v("And wallet balance is again zero")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h4",{attrs:{id:"done-again-"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#done-again-"}},[a._v("#")]),a._v(" Done again!")]),a._v(" "),s("p",[a._v("In this demo we showed how to receive and spend bitcoin using two different descriptor wallet policies using the "),s("code",[a._v("bdk")]),a._v(" library and "),s("code",[a._v("bdk-cli")]),a._v(" wallet tool.")])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/77.c32ccfd5.js b/assets/js/77.e41bb48e.js similarity index 98% rename from assets/js/77.c32ccfd5.js rename to assets/js/77.e41bb48e.js index 631b3d3cbe..3c32507c5c 100644 --- a/assets/js/77.c32ccfd5.js +++ b/assets/js/77.e41bb48e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{435:function(e,t,i){"use strict";i.r(t);var a=i(7),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("This article explores the reasons why the Bitcoin Dev Kit Foundation supports a number of language bindings libraries as part of its core offering, and the challenges and decision tradeoffs we face along the way.")]),e._v(" "),t("p",[e._v('We build language bindings for a number of use cases. One of the most common of those rests on a belief that as time goes on, applications of all kinds will need to interact with the bitcoin protocol. Many of those will be applications that are not "bitcoin-first" like wallets, but rather other kinds of applications that simply wish to integrate payments for their users (games, chat applications, content creation, etc.). These applications already have well-developed codebases and teams, seldom built entirely in Rust (BDK\'s first and core language). Our goal is to offer these teams and applications an all-inclusive dependency they can add to whatever technology stack they are using in production, and allow the integration of bitcoin-related capabilities without the need to completely change their tech stack or require the hire of full-time bitcoin experts.')]),e._v(" "),t("p",[e._v("Why not simply use libraries that are available in the specific languages? We think the bitcoin development kit is special (of course we do!) for a few reasons:")]),e._v(" "),t("ol",[t("li",[e._v("The level of review and number of in-production applications in bitcoin that use the Rust bitcoin ecosystem of libraries is unparalleled (rust-bitcoin, rust-miniscript, and bdk).")]),e._v(" "),t("li",[e._v("For the reason above, it is most often the case that new features and BIPs are available in Rust first (taproot, miniscript, etc.) and take years to appear on other tech stacks.")])]),e._v(" "),t("h2",{attrs:{id:"awesome-producing-bindings-must-be-easy-right"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#awesome-producing-bindings-must-be-easy-right"}},[e._v("#")]),e._v(" Awesome! Producing Bindings Must Be Easy Right?")]),e._v(" "),t("p",[e._v("Along the way, "),t("em",[e._v("actually")]),e._v(" producing language bindings for a variety of languages is no easy feat. Here are some of the challenges we face:")]),e._v(" "),t("ol",[t("li",[e._v("We create bindings for many languages in one fell swoop with a Rust tool called "),t("a",{attrs:{href:"https://github.com/mozilla/uniffi-rs",target:"_blank",rel:"noopener noreferrer"}},[e._v("uniffi"),t("OutboundLink")],1),e._v(". The result is that for the work of 1 language, we actually get a few: Swift, Kotlin (works for JVM server-side and on Android), Java, Python. The Kotlin and Swift languages can in turn be combined to create React Native and Flutter libraries.")]),e._v(" "),t("li",[e._v("The goal of the bindings is not to provide all the complexity available in the Rust libraries (this would simply be out-of-scope for us). We basically need to strike a balance and generate a unified API that contains and combines 8 Rust libraries: rust-bitcoin, rust-miniscript, bdk_wallet, bdk_chain, bdk_file_store, and the electrum-client, esplora-client, and rpc-client libraries). This is required because it is impractical to produce bindings libraries for all of the above individually. The final bindings libraries are centered around the bdk_wallet API, and supporting its most common use cases for mobile clients.")]),e._v(" "),t("li",[e._v("Point 2 above has interesting implications: while developers using Rust can simply import any number of those libraries in their projects, we must expose as much (and as little) as is required.")]),e._v(" "),t("li",[e._v("A few caveats give us interesting puzzles we need to juggle with as we design and develop the language bindings libraries:\n"),t("ul",[t("li",[e._v('We cannot expose Rust generics using uniffi. This means that in practice, we need to remove all generics from the Rust API (either by not exposing the underlying construct or by exposing all—or the most important—of its variants as concrete structs). In this process, some of the complexity and beauty of the Rust language and Rust-based codebases is "erased".')]),e._v(" "),t("li",[e._v("Because the Rust code must be exposed in a variety of languages, some of the most Rust-specific constructs cannot be expressed in the bindings libraries. Things like functions that return tuples and tuple structs do not have Kotlin/Swift/Python equivalents, and must therefore be wrapped in some way, changing the shape of the Rust API slightly.")])])])]),e._v(" "),t("p",[t("em",[e._v("Note:")]),e._v(" The "),t("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-rn"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-flutter"),t("OutboundLink")],1),e._v(" are closely related projects. The React Native library uses the bdk-swift and bdk-android libraries and simply wraps them in a way that allows React Native users to leverage them, while the bdk-flutter library is build using a separate tool called "),t("a",{attrs:{href:""}},[e._v("rust-flutter-bridge")]),e._v(", and is not a direct descendant of the uniffi-based libraries, although it follows a similar API.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{437:function(e,t,i){"use strict";i.r(t);var a=i(7),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("This article explores the reasons why the Bitcoin Dev Kit Foundation supports a number of language bindings libraries as part of its core offering, and the challenges and decision tradeoffs we face along the way.")]),e._v(" "),t("p",[e._v('We build language bindings for a number of use cases. One of the most common of those rests on a belief that as time goes on, applications of all kinds will need to interact with the bitcoin protocol. Many of those will be applications that are not "bitcoin-first" like wallets, but rather other kinds of applications that simply wish to integrate payments for their users (games, chat applications, content creation, etc.). These applications already have well-developed codebases and teams, seldom built entirely in Rust (BDK\'s first and core language). Our goal is to offer these teams and applications an all-inclusive dependency they can add to whatever technology stack they are using in production, and allow the integration of bitcoin-related capabilities without the need to completely change their tech stack or require the hire of full-time bitcoin experts.')]),e._v(" "),t("p",[e._v("Why not simply use libraries that are available in the specific languages? We think the bitcoin development kit is special (of course we do!) for a few reasons:")]),e._v(" "),t("ol",[t("li",[e._v("The level of review and number of in-production applications in bitcoin that use the Rust bitcoin ecosystem of libraries is unparalleled (rust-bitcoin, rust-miniscript, and bdk).")]),e._v(" "),t("li",[e._v("For the reason above, it is most often the case that new features and BIPs are available in Rust first (taproot, miniscript, etc.) and take years to appear on other tech stacks.")])]),e._v(" "),t("h2",{attrs:{id:"awesome-producing-bindings-must-be-easy-right"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#awesome-producing-bindings-must-be-easy-right"}},[e._v("#")]),e._v(" Awesome! Producing Bindings Must Be Easy Right?")]),e._v(" "),t("p",[e._v("Along the way, "),t("em",[e._v("actually")]),e._v(" producing language bindings for a variety of languages is no easy feat. Here are some of the challenges we face:")]),e._v(" "),t("ol",[t("li",[e._v("We create bindings for many languages in one fell swoop with a Rust tool called "),t("a",{attrs:{href:"https://github.com/mozilla/uniffi-rs",target:"_blank",rel:"noopener noreferrer"}},[e._v("uniffi"),t("OutboundLink")],1),e._v(". The result is that for the work of 1 language, we actually get a few: Swift, Kotlin (works for JVM server-side and on Android), Java, Python. The Kotlin and Swift languages can in turn be combined to create React Native and Flutter libraries.")]),e._v(" "),t("li",[e._v("The goal of the bindings is not to provide all the complexity available in the Rust libraries (this would simply be out-of-scope for us). We basically need to strike a balance and generate a unified API that contains and combines 8 Rust libraries: rust-bitcoin, rust-miniscript, bdk_wallet, bdk_chain, bdk_file_store, and the electrum-client, esplora-client, and rpc-client libraries). This is required because it is impractical to produce bindings libraries for all of the above individually. The final bindings libraries are centered around the bdk_wallet API, and supporting its most common use cases for mobile clients.")]),e._v(" "),t("li",[e._v("Point 2 above has interesting implications: while developers using Rust can simply import any number of those libraries in their projects, we must expose as much (and as little) as is required.")]),e._v(" "),t("li",[e._v("A few caveats give us interesting puzzles we need to juggle with as we design and develop the language bindings libraries:\n"),t("ul",[t("li",[e._v('We cannot expose Rust generics using uniffi. This means that in practice, we need to remove all generics from the Rust API (either by not exposing the underlying construct or by exposing all—or the most important—of its variants as concrete structs). In this process, some of the complexity and beauty of the Rust language and Rust-based codebases is "erased".')]),e._v(" "),t("li",[e._v("Because the Rust code must be exposed in a variety of languages, some of the most Rust-specific constructs cannot be expressed in the bindings libraries. Things like functions that return tuples and tuple structs do not have Kotlin/Swift/Python equivalents, and must therefore be wrapped in some way, changing the shape of the Rust API slightly.")])])])]),e._v(" "),t("p",[t("em",[e._v("Note:")]),e._v(" The "),t("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-rn"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-flutter"),t("OutboundLink")],1),e._v(" are closely related projects. The React Native library uses the bdk-swift and bdk-android libraries and simply wraps them in a way that allows React Native users to leverage them, while the bdk-flutter library is build using a separate tool called "),t("a",{attrs:{href:""}},[e._v("rust-flutter-bridge")]),e._v(", and is not a direct descendant of the uniffi-based libraries, although it follows a similar API.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/87.2900bc6c.js b/assets/js/87.835c1f1b.js similarity index 98% rename from assets/js/87.2900bc6c.js rename to assets/js/87.835c1f1b.js index 6e7ae7634f..a7f4720643 100644 --- a/assets/js/87.2900bc6c.js +++ b/assets/js/87.835c1f1b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[87],{452:function(t,e,a){"use strict";a.r(e);var r=a(7),o=Object(r.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"examples"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[t._v("#")]),t._v(" Examples")]),t._v(" "),e("p",[t._v("Click the links below and learn from community-built example projects.")]),t._v(" "),e("h2",{attrs:{id:"bdk-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bdk-cli"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[t._v("BDK-CLI"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("A command line interface to experiment with the bitcoindevkit.")]),t._v(" "),e("h2",{attrs:{id:"devkitwallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#devkitwallet"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/thunderbiscuit/devkit-wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("DevkitWallet"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("A demo app for the bitcoindevkit on Android using "),e("code",[t._v("bdk-kotlin")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"padawan-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#padawan-wallet"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/thunderbiscuit/padawan-wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("Padawan Wallet"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("A testnet-only bitcoin wallet full of tutorials on how to use bitcoin wallets.")]),t._v(" "),e("h2",{attrs:{id:"bdkswiftexamplewallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bdkswiftexamplewallet"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/reez/BDKSwiftExampleWallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("BDKSwiftExampleWallet"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("An example iOS app using "),e("code",[t._v("bdk-swift")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"tatooine"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tatooine"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/thunderbiscuit/tatooine",target:"_blank",rel:"noopener noreferrer"}},[t._v("Tatooine"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("Tatooine is a small bitcoin testnet faucet built with Ktor, a Kotlin asynchronous framework for creating microservices and web applications.")]),t._v(" "),e("h2",{attrs:{id:"seba-bank-proof-of-reserves"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#seba-bank-proof-of-reserves"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-reserves",target:"_blank",rel:"noopener noreferrer"}},[t._v("SEBA Bank Proof of reserves"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("bdk")]),t._v(" library aims to be the core building block for Bitcoin wallets of any kind. The "),e("code",[t._v("bdk-reserves")]),t._v(" library provides an implementation of "),e("code",[t._v("proof-of-reserves")]),t._v(" for bdk.")]),t._v(" "),e("h2",{attrs:{id:"stackmate"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#stackmate"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/StackmateNetwork/the-stackmate",target:"_blank",rel:"noopener noreferrer"}},[t._v("Stackmate"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("A multi-purpose Bitcoin Wallet.")]),t._v(" "),e("h2",{attrs:{id:"spotbit"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#spotbit"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank",rel:"noopener noreferrer"}},[t._v("Spotbit"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("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.")])])}),[],!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[87],{453:function(t,e,a){"use strict";a.r(e);var r=a(7),o=Object(r.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"examples"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[t._v("#")]),t._v(" Examples")]),t._v(" "),e("p",[t._v("Click the links below and learn from community-built example projects.")]),t._v(" "),e("h2",{attrs:{id:"bdk-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bdk-cli"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[t._v("BDK-CLI"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("A command line interface to experiment with the bitcoindevkit.")]),t._v(" "),e("h2",{attrs:{id:"devkitwallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#devkitwallet"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/thunderbiscuit/devkit-wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("DevkitWallet"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("A demo app for the bitcoindevkit on Android using "),e("code",[t._v("bdk-kotlin")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"padawan-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#padawan-wallet"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/thunderbiscuit/padawan-wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("Padawan Wallet"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("A testnet-only bitcoin wallet full of tutorials on how to use bitcoin wallets.")]),t._v(" "),e("h2",{attrs:{id:"bdkswiftexamplewallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bdkswiftexamplewallet"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/reez/BDKSwiftExampleWallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("BDKSwiftExampleWallet"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("An example iOS app using "),e("code",[t._v("bdk-swift")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"tatooine"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tatooine"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/thunderbiscuit/tatooine",target:"_blank",rel:"noopener noreferrer"}},[t._v("Tatooine"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("Tatooine is a small bitcoin testnet faucet built with Ktor, a Kotlin asynchronous framework for creating microservices and web applications.")]),t._v(" "),e("h2",{attrs:{id:"seba-bank-proof-of-reserves"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#seba-bank-proof-of-reserves"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-reserves",target:"_blank",rel:"noopener noreferrer"}},[t._v("SEBA Bank Proof of reserves"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("bdk")]),t._v(" library aims to be the core building block for Bitcoin wallets of any kind. The "),e("code",[t._v("bdk-reserves")]),t._v(" library provides an implementation of "),e("code",[t._v("proof-of-reserves")]),t._v(" for bdk.")]),t._v(" "),e("h2",{attrs:{id:"stackmate"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#stackmate"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/StackmateNetwork/the-stackmate",target:"_blank",rel:"noopener noreferrer"}},[t._v("Stackmate"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("A multi-purpose Bitcoin Wallet.")]),t._v(" "),e("h2",{attrs:{id:"spotbit"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#spotbit"}},[t._v("#")]),t._v(" "),e("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank",rel:"noopener noreferrer"}},[t._v("Spotbit"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("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.")])])}),[],!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/88.253a71ec.js b/assets/js/88.ba813683.js similarity index 97% rename from assets/js/88.253a71ec.js rename to assets/js/88.ba813683.js index ea67c4da85..801cb47730 100644 --- a/assets/js/88.253a71ec.js +++ b/assets/js/88.ba813683.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[88],{453:function(e,t,o){"use strict";o.r(t);var r=o(7),a=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"bitcoin-dev-kit-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-dev-kit-foundation"}},[e._v("#")]),e._v(" Bitcoin Dev Kit Foundation")]),e._v(" "),t("p",[e._v("The Bitcoin Dev Kit Foundation (EIN 93-2023051) is established as a US non-profit corporation to promote the development of, public access to and adoption of the free and open source Bitcoin Dev Kit (BDK) library software.")]),e._v(" "),t("p",[e._v("The Foundation aims to achieve this mission by funding the developers who contribute to and maintain the Bitcoin Dev Kit software libraries, documentation, and related infrastructure. We independently raise funds on behalf of the development team, and recruit for, fund, and operate the grant program.")]),e._v(" "),t("h2",{attrs:{id:"board"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#board"}},[e._v("#")]),e._v(" Board")]),e._v(" "),t("p",[e._v("The current BDK Foundation board is made up of five directors. The board members are all unpaid volunteer positions. All board members are long-time contributors and supporters of the BDK project:")]),e._v(" "),t("ul",[t("li",[e._v("Riccardo Casatta")]),e._v(" "),t("li",[e._v("Alekos Filini")]),e._v(" "),t("li",[e._v("Lloyd Fournier")]),e._v(" "),t("li",[e._v("Steve Lee")]),e._v(" "),t("li",[e._v("Steve Myers")])]),e._v(" "),t("h2",{attrs:{id:"operations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#operations"}},[e._v("#")]),e._v(" Operations")]),e._v(" "),t("p",[e._v("Our operations team handles the day-to-day operations of the Foundation and reports to the board of directors. Our officers are all also active contributors to the development of the software. The five current officers are:")]),e._v(" "),t("ul",[t("li",[e._v("Steve Myers, President")]),e._v(" "),t("li",[e._v("Daniela Brozzoni, Vice-President")]),e._v(" "),t("li",[e._v("Joe Wood, Treasurer")]),e._v(" "),t("li",[e._v("thunderbiscuit, Secretary")]),e._v(" "),t("li",[e._v("Evan Lin, At-large")])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[88],{454:function(e,t,o){"use strict";o.r(t);var r=o(7),a=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"bitcoin-dev-kit-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-dev-kit-foundation"}},[e._v("#")]),e._v(" Bitcoin Dev Kit Foundation")]),e._v(" "),t("p",[e._v("The Bitcoin Dev Kit Foundation (EIN 93-2023051) is established as a US non-profit corporation to promote the development of, public access to and adoption of the free and open source Bitcoin Dev Kit (BDK) library software.")]),e._v(" "),t("p",[e._v("The Foundation aims to achieve this mission by funding the developers who contribute to and maintain the Bitcoin Dev Kit software libraries, documentation, and related infrastructure. We independently raise funds on behalf of the development team, and recruit for, fund, and operate the grant program.")]),e._v(" "),t("h2",{attrs:{id:"board"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#board"}},[e._v("#")]),e._v(" Board")]),e._v(" "),t("p",[e._v("The current BDK Foundation board is made up of five directors. The board members are all unpaid volunteer positions. All board members are long-time contributors and supporters of the BDK project:")]),e._v(" "),t("ul",[t("li",[e._v("Riccardo Casatta")]),e._v(" "),t("li",[e._v("Alekos Filini")]),e._v(" "),t("li",[e._v("Lloyd Fournier")]),e._v(" "),t("li",[e._v("Steve Lee")]),e._v(" "),t("li",[e._v("Steve Myers")])]),e._v(" "),t("h2",{attrs:{id:"operations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#operations"}},[e._v("#")]),e._v(" Operations")]),e._v(" "),t("p",[e._v("Our operations team handles the day-to-day operations of the Foundation and reports to the board of directors. Our officers are all also active contributors to the development of the software. The five current officers are:")]),e._v(" "),t("ul",[t("li",[e._v("Steve Myers, President")]),e._v(" "),t("li",[e._v("Daniela Brozzoni, Vice-President")]),e._v(" "),t("li",[e._v("Joe Wood, Treasurer")]),e._v(" "),t("li",[e._v("thunderbiscuit, Secretary")]),e._v(" "),t("li",[e._v("Evan Lin, At-large")])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/89.0372536c.js b/assets/js/89.416c2e8b.js similarity index 99% rename from assets/js/89.0372536c.js rename to assets/js/89.416c2e8b.js index 606e9b47ca..9ee589beb9 100644 --- a/assets/js/89.0372536c.js +++ b/assets/js/89.416c2e8b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[89],{454:function(t,e,a){"use strict";a.r(e);var i=a(7),n=Object(i.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"current-grantees-full-time"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#current-grantees-full-time"}},[t._v("#")]),t._v(" Current Grantees (Full-Time)")]),t._v(" "),e("h2",{attrs:{id:"evan-lin"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#evan-lin"}},[t._v("#")]),t._v(" Evan Lin")]),t._v(" "),e("p",[t._v("Evan Lin (林志宇) is a Rust/Golang developer who has been contributing to BDK since 2022. Before working on bitcoin-related projects, his professional career started in 2017 where he led various umbrella projects for an altcoin. After discovering the importance of bitcoin, he started contributing to various projects (including BDK, Fedimint and Utreexo) and was eventually taken under the wing of and mentored by Lloyd Fournier.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/evanlinjin",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/evanlinjin",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub1kysd8m44dhv7ywa75u5z7w2w0gs4t6qzhgvjp555gfknasy3krlqfxde60",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"thunderbiscuit"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#thunderbiscuit"}},[t._v("#")]),t._v(" thunderbiscuit")]),t._v(" "),e("p",[t._v("Thunderbiscuit is an Android engineer who's has been working on the project for over 3 years, leading the work on the language bindings for BDK. He's using BDK in production with "),e("a",{attrs:{href:"https://padawanwallet.com/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Padawan Wallet"),e("OutboundLink")],1),t._v(". He's also in charge of the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-kotlin-example-wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("BDK Kotlin Example Wallet"),e("OutboundLink")],1),t._v(", the sample native Android wallet for BDK, and the "),e("a",{attrs:{href:"https://bitcoindevkit.github.io/book-of-bdk/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Book of BDK"),e("OutboundLink")],1),t._v(" project, working on building walkthrough documentation for the BDK ecosystem.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/thunderB__",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/thunderbiscuit",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub1thunderat5g552cuy7umk624ct5xe4tpgwr2jcjjq2gc0567wgrqnya79l",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://thunderbiscuit.com",target:"_blank"}},[e("img",{staticStyle:{width:"24px"},attrs:{src:"/img/www.png"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"matthew-ramsden"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#matthew-ramsden"}},[t._v("#")]),t._v(" Matthew Ramsden")]),t._v(" "),e("p",[t._v("Matthew is an experienced iOS engineer who has picked up Rust along the way to expand his contributions to the bitcoin ecosystem. His primary focus is maintaining the bdk-ffi Rust bindings, contributing features, and ensuring the library's robustness, along with leading the development of the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/BDKSwiftExampleWallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("BDK Swift Example Wallet"),e("OutboundLink")],1),t._v(" which is an example iOS wallet built on BDK.")]),t._v(" "),e("p",[t._v("He also created the Lightning iOS app "),e("a",{attrs:{href:"https://github.com/reez/Monday",target:"_blank",rel:"noopener noreferrer"}},[t._v("Monday"),e("OutboundLink")],1),t._v(", the native iOS implementation of Bitcoin UI Kit "),e("a",{attrs:{href:"https://github.com/reez/BitcoinUI",target:"_blank",rel:"noopener noreferrer"}},[t._v("BitcoinUI"),e("OutboundLink")],1),t._v(", the iOS app "),e("a",{attrs:{href:"https://apps.apple.com/us/app/block-screen/id1533333210",target:"_blank",rel:"noopener noreferrer"}},[t._v("Block Screen"),e("OutboundLink")],1),t._v(", and co-organizes NashBitDevs.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/matthewramsden",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/reez",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub1reezn2ctrrg736uqj7mva9lsuwv0kr5asj4vvkwxnrwlhvxf98tsq99ty4",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"valuedmammal"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#valuedmammal"}},[t._v("#")]),t._v(" ValuedMammal")]),t._v(" "),e("p",[t._v("ValuedMammal is a Rust developer and node operator whose work includes research in the areas of mempool and p2p. He's interested in bitcoin payment solutions, problems around fee estimation, and innovations in bitcoin Script. In 2021 he managed Tangerine node on the lightning network and was active in the PLEBNET community. He started contributing to BDK out of a belief that modern wallets should be built with modern tools and sought out a team that makes no compromises when it comes to quality and correctness and who share a mission to master the fundamentals while providing convenient abstractions to developers. His unorthodox path into software development came as a byproduct of his own bitcoin journey and continues to grow more fulfilling each day. As a result, his natural environment is in a terminal managing a server or database, and of course writing code. ValuedMammal studied Biological Science at university, and outside of bitcoin he's a writer and educator who likes music, travel, and foreign languages.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/valuedmammal",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/ValuedMammal",target:"_blank"}},[e("img",{staticStyle:{width:"24px"},attrs:{src:"/img/github-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h1",{attrs:{id:"current-grantees-project-grants"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#current-grantees-project-grants"}},[t._v("#")]),t._v(" Current Grantees (Project Grants)")]),t._v(" "),e("h2",{attrs:{id:"wei-chen"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#wei-chen"}},[t._v("#")]),t._v(" Wei Chen")]),t._v(" "),e("p",[t._v("Wei Chen has been contributing to BDK since late 2023 and was formerly a full stack Java developer based in Washington D.C. with ten years of experience. He was introduced to BDK as a result of Evan Lin, whom he met when taking Mandarin lessons in Taipei. The focus of his contributions will be towards assisting with the restructuring of the electrum crate, reengineering of the TxGraph data components to simplify the tracking of lineal conflicts, as well as focusing on performance optimization and the continued debugging of BDK, which includes the maintenance of the TestEnv crate. Outside of code contributions to the project, Wei Chen will be also assisting Evan Lin with various bitcoin events or workshops to improve understanding towards BDK.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://github.com/LagginTimes",target:"_blank"}},[e("img",{staticStyle:{width:"24px"},attrs:{src:"/img/github-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"manuel-gatti"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#manuel-gatti"}},[t._v("#")]),t._v(" Manuel Gatti")]),t._v(" "),e("p",[t._v("Manuel Gatti is a Product/Project Manager who has worked for about 3 and a half years as a functional analyst/project manager in the IT consultancy sector and for the last year as a Product Owner in a non-bitcoin-related software company. He is involved in some educational projects related to bitcoin in Italy and hosts an italian podcast about libertarian philosophy with episodes dedicated to bitcoin as a tool for freedom.")]),t._v(" "),e("p",[t._v("He has been contributing to BDK since April 2023 mostly on the project management side (holding calls, helping with triage and prioritization, updating stakeholders). Since April 2024, he has started conducting user interviews in order to get feedback on BDK usage and possible pain points with the aim to help the team with the definition and prioritization of the development activities. In May 2024 he started collaborating as a product/project manager with Wizard Sardine (users of BDK) and in particular to the development and go-to-market strategy of Liana Wallet.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/nondiremanuel",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/nondiremanuel",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub10znwkv69vus58rrqydwfzy3tuljhqn5plec84y0v2pa5n85xfwnqaft2sl",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})])]),t._v(" "),e("br")])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[89],{452:function(t,e,a){"use strict";a.r(e);var i=a(7),n=Object(i.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"current-grantees-full-time"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#current-grantees-full-time"}},[t._v("#")]),t._v(" Current Grantees (Full-Time)")]),t._v(" "),e("h2",{attrs:{id:"evan-lin"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#evan-lin"}},[t._v("#")]),t._v(" Evan Lin")]),t._v(" "),e("p",[t._v("Evan Lin (林志宇) is a Rust/Golang developer who has been contributing to BDK since 2022. Before working on bitcoin-related projects, his professional career started in 2017 where he led various umbrella projects for an altcoin. After discovering the importance of bitcoin, he started contributing to various projects (including BDK, Fedimint and Utreexo) and was eventually taken under the wing of and mentored by Lloyd Fournier.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/evanlinjin",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/evanlinjin",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub1kysd8m44dhv7ywa75u5z7w2w0gs4t6qzhgvjp555gfknasy3krlqfxde60",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"thunderbiscuit"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#thunderbiscuit"}},[t._v("#")]),t._v(" thunderbiscuit")]),t._v(" "),e("p",[t._v("Thunderbiscuit is an Android engineer who's has been working on the project for over 3 years, leading the work on the language bindings for BDK. He's using BDK in production with "),e("a",{attrs:{href:"https://padawanwallet.com/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Padawan Wallet"),e("OutboundLink")],1),t._v(". He's also in charge of the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-kotlin-example-wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("BDK Kotlin Example Wallet"),e("OutboundLink")],1),t._v(", the sample native Android wallet for BDK, and the "),e("a",{attrs:{href:"https://bitcoindevkit.github.io/book-of-bdk/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Book of BDK"),e("OutboundLink")],1),t._v(" project, working on building walkthrough documentation for the BDK ecosystem.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/thunderB__",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/thunderbiscuit",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub1thunderat5g552cuy7umk624ct5xe4tpgwr2jcjjq2gc0567wgrqnya79l",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://thunderbiscuit.com",target:"_blank"}},[e("img",{staticStyle:{width:"24px"},attrs:{src:"/img/www.png"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"matthew-ramsden"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#matthew-ramsden"}},[t._v("#")]),t._v(" Matthew Ramsden")]),t._v(" "),e("p",[t._v("Matthew is an experienced iOS engineer who has picked up Rust along the way to expand his contributions to the bitcoin ecosystem. His primary focus is maintaining the bdk-ffi Rust bindings, contributing features, and ensuring the library's robustness, along with leading the development of the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/BDKSwiftExampleWallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("BDK Swift Example Wallet"),e("OutboundLink")],1),t._v(" which is an example iOS wallet built on BDK.")]),t._v(" "),e("p",[t._v("He also created the Lightning iOS app "),e("a",{attrs:{href:"https://github.com/reez/Monday",target:"_blank",rel:"noopener noreferrer"}},[t._v("Monday"),e("OutboundLink")],1),t._v(", the native iOS implementation of Bitcoin UI Kit "),e("a",{attrs:{href:"https://github.com/reez/BitcoinUI",target:"_blank",rel:"noopener noreferrer"}},[t._v("BitcoinUI"),e("OutboundLink")],1),t._v(", the iOS app "),e("a",{attrs:{href:"https://apps.apple.com/us/app/block-screen/id1533333210",target:"_blank",rel:"noopener noreferrer"}},[t._v("Block Screen"),e("OutboundLink")],1),t._v(", and co-organizes NashBitDevs.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/matthewramsden",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/reez",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub1reezn2ctrrg736uqj7mva9lsuwv0kr5asj4vvkwxnrwlhvxf98tsq99ty4",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"valuedmammal"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#valuedmammal"}},[t._v("#")]),t._v(" ValuedMammal")]),t._v(" "),e("p",[t._v("ValuedMammal is a Rust developer and node operator whose work includes research in the areas of mempool and p2p. He's interested in bitcoin payment solutions, problems around fee estimation, and innovations in bitcoin Script. In 2021 he managed Tangerine node on the lightning network and was active in the PLEBNET community. He started contributing to BDK out of a belief that modern wallets should be built with modern tools and sought out a team that makes no compromises when it comes to quality and correctness and who share a mission to master the fundamentals while providing convenient abstractions to developers. His unorthodox path into software development came as a byproduct of his own bitcoin journey and continues to grow more fulfilling each day. As a result, his natural environment is in a terminal managing a server or database, and of course writing code. ValuedMammal studied Biological Science at university, and outside of bitcoin he's a writer and educator who likes music, travel, and foreign languages.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/valuedmammal",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/ValuedMammal",target:"_blank"}},[e("img",{staticStyle:{width:"24px"},attrs:{src:"/img/github-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h1",{attrs:{id:"current-grantees-project-grants"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#current-grantees-project-grants"}},[t._v("#")]),t._v(" Current Grantees (Project Grants)")]),t._v(" "),e("h2",{attrs:{id:"wei-chen"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#wei-chen"}},[t._v("#")]),t._v(" Wei Chen")]),t._v(" "),e("p",[t._v("Wei Chen has been contributing to BDK since late 2023 and was formerly a full stack Java developer based in Washington D.C. with ten years of experience. He was introduced to BDK as a result of Evan Lin, whom he met when taking Mandarin lessons in Taipei. The focus of his contributions will be towards assisting with the restructuring of the electrum crate, reengineering of the TxGraph data components to simplify the tracking of lineal conflicts, as well as focusing on performance optimization and the continued debugging of BDK, which includes the maintenance of the TestEnv crate. Outside of code contributions to the project, Wei Chen will be also assisting Evan Lin with various bitcoin events or workshops to improve understanding towards BDK.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://github.com/LagginTimes",target:"_blank"}},[e("img",{staticStyle:{width:"24px"},attrs:{src:"/img/github-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"manuel-gatti"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#manuel-gatti"}},[t._v("#")]),t._v(" Manuel Gatti")]),t._v(" "),e("p",[t._v("Manuel Gatti is a Product/Project Manager who has worked for about 3 and a half years as a functional analyst/project manager in the IT consultancy sector and for the last year as a Product Owner in a non-bitcoin-related software company. He is involved in some educational projects related to bitcoin in Italy and hosts an italian podcast about libertarian philosophy with episodes dedicated to bitcoin as a tool for freedom.")]),t._v(" "),e("p",[t._v("He has been contributing to BDK since April 2023 mostly on the project management side (holding calls, helping with triage and prioritization, updating stakeholders). Since April 2024, he has started conducting user interviews in order to get feedback on BDK usage and possible pain points with the aim to help the team with the definition and prioritization of the development activities. In May 2024 he started collaborating as a product/project manager with Wizard Sardine (users of BDK) and in particular to the development and go-to-market strategy of Liana Wallet.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/nondiremanuel",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/nondiremanuel",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub10znwkv69vus58rrqydwfzy3tuljhqn5plec84y0v2pa5n85xfwnqaft2sl",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})])]),t._v(" "),e("br")])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/app.088ca7ca.js b/assets/js/app.cd33d89c.js similarity index 56% rename from assets/js/app.088ca7ca.js rename to assets/js/app.cd33d89c.js index 5dd4e73714..dd25fdbab5 100644 --- a/assets/js/app.088ca7ca.js +++ b/assets/js/app.cd33d89c.js @@ -1,4 +1,4 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(t){function e(e){for(var o,a,c=e[0],l=e[1],s=e[2],d=0,u=[];d
'};function i(t,e,n){return tn?n:t}function r(t){return 100*(-1+t)}n.configure=function(t){var e,n;for(e in t)void 0!==(n=t[e])&&t.hasOwnProperty(e)&&(o[e]=n);return this},n.status=null,n.set=function(t){var e=n.isStarted();t=i(t,o.minimum,1),n.status=1===t?null:t;var l=n.render(!e),s=l.querySelector(o.barSelector),p=o.speed,d=o.easing;return l.offsetWidth,a((function(e){""===o.positionUsing&&(o.positionUsing=n.getPositioningCSS()),c(s,function(t,e,n){var i;return(i="translate3d"===o.positionUsing?{transform:"translate3d("+r(t)+"%,0,0)"}:"translate"===o.positionUsing?{transform:"translate("+r(t)+"%,0)"}:{"margin-left":r(t)+"%"}).transition="all "+e+"ms "+n,i}(t,p,d)),1===t?(c(l,{transition:"none",opacity:1}),l.offsetWidth,setTimeout((function(){c(l,{transition:"all "+p+"ms linear",opacity:0}),setTimeout((function(){n.remove(),e()}),p)}),p)):setTimeout(e,p)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var t=function(){setTimeout((function(){n.status&&(n.trickle(),t())}),o.trickleSpeed)};return o.trickle&&t(),this},n.done=function(t){return t||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(t){var e=n.status;return e?("number"!=typeof t&&(t=(1-e)*i(Math.random()*e,.1,.95)),e=i(e+t,0,.994),n.set(e)):n.start()},n.trickle=function(){return n.inc(Math.random()*o.trickleRate)},t=0,e=0,n.promise=function(o){return o&&"resolved"!==o.state()?(0===e&&n.start(),t++,e++,o.always((function(){0==--e?(t=0,n.done()):n.set((t-e)/t)})),this):this},n.render=function(t){if(n.isRendered())return document.getElementById("nprogress");s(document.documentElement,"nprogress-busy");var e=document.createElement("div");e.id="nprogress",e.innerHTML=o.template;var i,a=e.querySelector(o.barSelector),l=t?"-100":r(n.status||0),p=document.querySelector(o.parent);return c(a,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),o.showSpinner||(i=e.querySelector(o.spinnerSelector))&&u(i),p!=document.body&&s(p,"nprogress-custom-parent"),p.appendChild(e),e},n.remove=function(){p(document.documentElement,"nprogress-busy"),p(document.querySelector(o.parent),"nprogress-custom-parent");var t=document.getElementById("nprogress");t&&u(t)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var t=document.body.style,e="WebkitTransform"in t?"Webkit":"MozTransform"in t?"Moz":"msTransform"in t?"ms":"OTransform"in t?"O":"";return e+"Perspective"in t?"translate3d":e+"Transform"in t?"translate":"margin"};var a=function(){var t=[];function e(){var n=t.shift();n&&n(e)}return function(n){t.push(n),1==t.length&&e()}}(),c=function(){var t=["Webkit","O","Moz","ms"],e={};function n(n){return n=n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(t,e){return e.toUpperCase()})),e[n]||(e[n]=function(e){var n=document.body.style;if(e in n)return e;for(var o,i=t.length,r=e.charAt(0).toUpperCase()+e.slice(1);i--;)if((o=t[i]+r)in n)return o;return e}(n))}function o(t,e,o){e=n(e),t.style[e]=o}return function(t,e){var n,i,r=arguments;if(2==r.length)for(n in e)void 0!==(i=e[n])&&e.hasOwnProperty(n)&&o(t,n,i);else o(t,r[1],r[2])}}();function l(t,e){return("string"==typeof t?t:d(t)).indexOf(" "+e+" ")>=0}function s(t,e){var n=d(t),o=n+e;l(n,e)||(t.className=o.substring(1))}function p(t,e){var n,o=d(t);l(t,e)&&(n=o.replace(" "+e+" "," "),t.className=n.substring(1,n.length-1))}function d(t){return(" "+(t.className||"")+" ").replace(/\s+/gi," ")}function u(t){t&&t.parentNode&&t.parentNode.removeChild(t)}return n})?o.call(e,n,e,t):o)||(t.exports=i)},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){t.exports=function(t){return t}},function(t,e,n){"use strict";var o=n(0),i=n(54).f,r=n(13),a=n(96),c=n(34),l=n(69),s=n(135);t.exports=function(t,e){var n,p,d,u,g,h=t.target,m=t.global,f=t.stat;if(n=m?o:f?o[h]||c(h,{}):o[h]&&o[h].prototype)for(p in e){if(u=e[p],d=t.dontCallGetSet?(g=i(n,p))&&g.value:n[p],!s(m?p:h+(f?".":"#")+p,t.forced)&&void 0!==d){if(typeof u==typeof d)continue;l(u,d)}(t.sham||d&&d.sham)&&r(u,"sham",!0),a(n,p,u,t)}}},function(t,e,n){"use strict";var o=n(27),i=Function.prototype.call;t.exports=o?i.bind(i):function(){return i.apply(i,arguments)}},function(t,e,n){"use strict";var o=n(3);t.exports=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},function(t,e,n){"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){"use strict";var o=n(55),i=n(56);t.exports=function(t){return o(i(t))}},function(t,e,n){"use strict";var o=n(0),i=n(1),r=function(t){return i(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?r(o[t]):o[t]&&o[t][e]}},function(t,e,n){"use strict";var o=n(1),i=n(117),r=TypeError;t.exports=function(t){if(o(t))return t;throw new r(i(t)+" is not a function")}},function(t,e,n){"use strict";var o=n(0),i=n(64),r=n(9),a=n(66),c=n(62),l=n(61),s=o.Symbol,p=i("wks"),d=l?s.for||s:s&&s.withoutSetter||a;t.exports=function(t){return r(p,t)||(p[t]=c&&r(s,t)?s[t]:d("Symbol."+t)),p[t]}},function(t,e,n){"use strict";var o=n(65),i=n(0),r=n(34),a=t.exports=i["__core-js_shared__"]||r("__core-js_shared__",{});(a.versions||(a.versions=[])).push({version:"3.36.0",mode:o?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE",source:"https://github.com/zloirock/core-js"})},function(t,e,n){"use strict";var o=n(0),i=Object.defineProperty;t.exports=function(t,e){try{i(o,t,{value:e,configurable:!0,writable:!0})}catch(n){o[t]=e}return e}},function(t,e,n){"use strict";var o=n(56),i=Object;t.exports=function(t){return i(o(t))}},function(t,e,n){"use strict";var o=n(8),i=String,r=TypeError;t.exports=function(t){if(o(t))return t;throw new r(i(t)+" is not an object")}},function(t,e,n){"use strict";var o=n(132);t.exports=function(t){return o(t.length)}},function(t,e,n){var o=n(158),i=n(11),r=Object.prototype,a=r.hasOwnProperty,c=r.propertyIsEnumerable,l=o(function(){return arguments}())?o:function(t){return i(t)&&a.call(t,"callee")&&!c.call(t,"callee")};t.exports=l},function(t,e,n){var o=n(10)(n(6),"Map");t.exports=o},function(t,e,n){var o=n(177),i=n(184),r=n(186),a=n(187),c=n(188);function l(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){var o=n(4),i=n(44),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(o(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||(a.test(t)||!r.test(t)||null!=e&&t in Object(e))}},function(t,e,n){var o=n(12),i=n(11);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==o(t)}},function(t,e,n){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",o="second",i="minute",r="hour",a="day",c="week",l="month",s="quarter",p="year",d="date",u="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},f=function(t,e,n){var o=String(t);return!o||o.length>=e?t:""+Array(e+1-o.length).join(n)+t},v={s:f,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),o=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+f(o,2,"0")+":"+f(i,2,"0")},m:function t(e,n){if(e.date()1)return t(a[0])}else{var c=e.name;y[c]=e,i=c}return!o&&i&&(b=i),i||!o&&b},B=function(t,e){if(k(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new x(n)},D=v;D.l=_,D.i=k,D.w=function(t,e){return B(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var x=function(){function m(t){this.$L=_(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}var f=m.prototype;return f.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(D.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var o=e.match(g);if(o){var i=o[2]-1||0,r=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)):new Date(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)}}return new Date(e)}(t),this.init()},f.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},f.$utils=function(){return D},f.isValid=function(){return!(this.$d.toString()===u)},f.isSame=function(t,e){var n=B(t);return this.startOf(e)<=n&&n<=this.endOf(e)},f.isAfter=function(t,e){return B(t)-1&&t%1==0&&t79&&a<83||!r("reduce")},{reduce:function(t){var e=arguments.length;return i(this,t,e,e>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var o=n(5),i=n(26),r=n(113),a=n(28),c=n(29),l=n(58),s=n(9),p=n(67),d=Object.getOwnPropertyDescriptor;e.f=o?d:function(t,e){if(t=c(t),e=l(e),p)try{return d(t,e)}catch(t){}if(s(t,e))return a(!i(r.f,t,e),t[e])}},function(t,e,n){"use strict";var o=n(2),i=n(3),r=n(17),a=Object,c=o("".split);t.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"===r(t)?c(t,""):a(t)}:a},function(t,e,n){"use strict";var o=n(57),i=TypeError;t.exports=function(t){if(o(t))throw new i("Can't call method on "+t);return t}},function(t,e,n){"use strict";t.exports=function(t){return null==t}},function(t,e,n){"use strict";var o=n(114),i=n(59);t.exports=function(t){var e=o(t,"string");return i(e)?e:e+""}},function(t,e,n){"use strict";var o=n(30),i=n(1),r=n(60),a=n(61),c=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return i(e)&&r(e.prototype,c(t))}},function(t,e,n){"use strict";var o=n(2);t.exports=o({}.isPrototypeOf)},function(t,e,n){"use strict";var o=n(62);t.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){"use strict";var o=n(63),i=n(3),r=n(0).String;t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol("symbol detection");return!r(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&o&&o<41}))},function(t,e,n){"use strict";var o,i,r=n(0),a=n(115),c=r.process,l=r.Deno,s=c&&c.versions||l&&l.version,p=s&&s.v8;p&&(i=(o=p.split("."))[0]>0&&o[0]<4?1:+(o[0]+o[1])),!i&&a&&(!(o=a.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=a.match(/Chrome\/(\d+)/))&&(i=+o[1]),t.exports=i},function(t,e,n){"use strict";var o=n(33);t.exports=function(t,e){return o[t]||(o[t]=e||{})}},function(t,e,n){"use strict";t.exports=!1},function(t,e,n){"use strict";var o=n(2),i=0,r=Math.random(),a=o(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++i+r,36)}},function(t,e,n){"use strict";var o=n(5),i=n(3),r=n(119);t.exports=!o&&!i((function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";var o=n(9),i=n(126),r=n(54),a=n(15);t.exports=function(t,e,n){for(var c=i(e),l=a.f,s=r.f,p=0;pp))return!1;var u=l.get(t),g=l.get(e);if(u&&g)return u==e&&g==t;var h=-1,m=!0,f=2&n?new o:void 0;for(l.set(t,e),l.set(e,t);++h=0&&Math.floor(e)===e&&isFinite(t)}function m(t){return a(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function f(t){return null==t?"":Array.isArray(t)||u(t)&&t.toString===d?JSON.stringify(t,null,2):String(t)}function v(t){var e=parseFloat(t);return isNaN(e)?t:e}function b(t,e){for(var n=Object.create(null),o=t.split(","),i=0;i-1)return t.splice(o,1)}}var k=Object.prototype.hasOwnProperty;function _(t,e){return k.call(t,e)}function B(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var D=/-(\w)/g,x=B((function(t){return t.replace(D,(function(t,e){return e?e.toUpperCase():""}))})),P=B((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),K=/\B([A-Z])/g,S=B((function(t){return t.replace(K,"-$1").toLowerCase()}));var T=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var o=arguments.length;return o?o>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function O(t,e){e=e||0;for(var n=t.length-e,o=new Array(n);n--;)o[n]=t[n+e];return o}function C(t,e){for(var n in e)t[n]=e[n];return t}function A(t){for(var e={},n=0;n0,J=Z&&Z.indexOf("edge/")>0;Z&&Z.indexOf("android");var Q=Z&&/iphone|ipad|ipod|ios/.test(Z);Z&&/chrome\/\d+/.test(Z),Z&&/phantomjs/.test(Z);var tt,et=Z&&Z.match(/firefox\/(\d+)/),nt={}.watch,ot=!1;if(G)try{var it={};Object.defineProperty(it,"passive",{get:function(){ot=!0}}),window.addEventListener("test-passive",null,it)}catch(t){}var rt=function(){return void 0===tt&&(tt=!G&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),tt},at=G&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ct(t){return"function"==typeof t&&/native code/.test(t.toString())}var lt,st="undefined"!=typeof Symbol&&ct(Symbol)&&"undefined"!=typeof Reflect&&ct(Reflect.ownKeys);lt="undefined"!=typeof Set&&ct(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var pt=null;function dt(t){void 0===t&&(t=null),t||pt&&pt._scope.off(),pt=t,t&&t._scope.on()}var ut=function(){function t(t,e,n,o,i,r,a,c){this.tag=t,this.data=e,this.children=n,this.text=o,this.elm=i,this.ns=void 0,this.context=r,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=c,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),gt=function(t){void 0===t&&(t="");var e=new ut;return e.text=t,e.isComment=!0,e};function ht(t){return new ut(void 0,void 0,void 0,String(t))}function mt(t){var e=new ut(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var ft=0,vt=[],bt=function(){function t(){this._pending=!1,this.id=ft++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,vt.push(this))},t.prototype.depend=function(e){t.target&&t.target.addDep(this)},t.prototype.notify=function(t){var e=this.subs.filter((function(t){return t}));for(var n=0,o=e.length;n0&&(Zt((s=t(s,"".concat(n||"","_").concat(o)))[0])&&Zt(d)&&(u[p]=ht(d.text+s[0].text),s.shift()),u.push.apply(u,s)):l(s)?Zt(d)?u[p]=ht(d.text+s):""!==s&&u.push(ht(s)):Zt(s)&&Zt(d)?u[p]=ht(d.text+s.text):(c(e._isVList)&&a(s.tag)&&r(s.key)&&a(n)&&(s.key="__vlist".concat(n,"_").concat(o,"__")),u.push(s)));return u}(t):void 0}function Zt(t){return a(t)&&a(t.text)&&!1===t.isComment}function Xt(t,e){var n,o,r,c,l=null;if(i(t)||"string"==typeof t)for(l=new Array(t.length),n=0,o=t.length;n0,c=e?!!e.$stable:!a,l=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(c&&i&&i!==o&&l===i.$key&&!a&&!i.$hasNormal)return i;for(var s in r={},e)e[s]&&"$"!==s[0]&&(r[s]=me(t,n,s,e[s]))}else r={};for(var p in n)p in r||(r[p]=fe(n,p));return e&&Object.isExtensible(e)&&(e._normalized=r),H(r,"$stable",c),H(r,"$key",l),H(r,"$hasNormal",a),r}function me(t,e,n,o){var r=function(){var e=pt;dt(t);var n=arguments.length?o.apply(null,arguments):o({}),r=(n=n&&"object"==typeof n&&!i(n)?[n]:Gt(n))&&n[0];return dt(e),n&&(!r||1===n.length&&r.isComment&&!ge(r))?void 0:n};return o.proxy&&Object.defineProperty(e,n,{get:r,enumerable:!0,configurable:!0}),r}function fe(t,e){return function(){return t[e]}}function ve(t){return{get attrs(){if(!t._attrsProxy){var e=t._attrsProxy={};H(e,"_v_attr_proxy",!0),be(e,t.$attrs,o,t,"$attrs")}return t._attrsProxy},get listeners(){t._listenersProxy||be(t._listenersProxy={},t.$listeners,o,t,"$listeners");return t._listenersProxy},get slots(){return function(t){t._slotsProxy||we(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(t)},emit:T(t.$emit,t),expose:function(e){e&&Object.keys(e).forEach((function(n){return It(t,e,n)}))}}}function be(t,e,n,o,i){var r=!1;for(var a in e)a in t?e[a]!==n[a]&&(r=!0):(r=!0,ye(t,a,o,i));for(var a in t)a in e||(r=!0,delete t[a]);return r}function ye(t,e,n,o){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[o][e]}})}function we(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var ke=null;function _e(t,e){return(t.__esModule||st&&"Module"===t[Symbol.toStringTag])&&(t=t.default),p(t)?e.extend(t):t}function Be(t){if(i(t))for(var e=0;edocument.createEvent("Event").timeStamp&&(ln=function(){return sn.now()})}var pn=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function dn(){var t,e;for(cn=ln(),rn=!0,tn.sort(pn),an=0;anan&&tn[n].id>t.id;)n--;tn.splice(n+1,0,t)}else tn.push(t);on||(on=!0,Re(dn))}}function gn(t,e){if(t){for(var n=Object.create(null),o=st?Reflect.ownKeys(t):Object.keys(t),i=0;i-1)if(r&&!_(i,"default"))a=!1;else if(""===a||a===S(t)){var l=$n(String,i.type);(l<0||c-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!g(t)&&t.test(e)}function Xn(t,e){var n=t.cache,o=t.keys,i=t._vnode;for(var r in n){var a=n[r];if(a){var c=a.name;c&&!e(c)&&Yn(n,r,o,i)}}}function Yn(t,e,n,o){var i=t[e];!i||o&&i.tag===o.tag||i.componentInstance.$destroy(),t[e]=null,w(n,e)}Vn.prototype._init=function(t){var e=this;e._uid=Wn++,e._isVue=!0,e.__v_skip=!0,e._scope=new Nt(!0),e._scope._vm=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),o=e._parentVnode;n.parent=e.parent,n._parentVnode=o;var i=o.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Tn(Hn(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Ge(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,i=n&&n.context;t.$slots=de(e._renderChildren,i),t.$scopedSlots=n?he(t.$parent,n.data.scopedSlots,t.$slots):o,t._c=function(e,n,o,i){return De(t,e,n,o,i,!1)},t.$createElement=function(e,n,o,i){return De(t,e,n,o,i,!0)};var r=n&&n.data;Ct(t,"$attrs",r&&r.attrs||o,null,!0),Ct(t,"$listeners",e._parentListeners||o,null,!0)}(e),Qe(e,"beforeCreate",void 0,!1),function(t){var e=gn(t.$options.inject,t);e&&(Kt(!1),Object.keys(e).forEach((function(n){Ct(t,n,e[n])})),Kt(!0))}(e),Rn(e),function(t){var e=t.$options.provide;if(e){var n=s(e)?e.call(t):e;if(!p(n))return;for(var o=Ut(t),i=st?Reflect.ownKeys(n):Object.keys(n),r=0;r1?O(n):n;for(var o=O(arguments,1),i='event handler for "'.concat(t,'"'),r=0,a=n.length;rparseInt(this.max)&&Yn(t,e[0],e,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Yn(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Xn(t,(function(t){return Zn(e,t)}))})),this.$watch("exclude",(function(e){Xn(t,(function(t){return!Zn(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Be(t),n=e&&e.componentOptions;if(n){var o=Gn(n),i=this.include,r=this.exclude;if(i&&(!o||!Zn(i,o))||r&&o&&Zn(r,o))return e;var a=this.cache,c=this.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;a[l]?(e.componentInstance=a[l].componentInstance,w(c,l),c.push(l)):(this.vnodeToCache=e,this.keyToCache=l),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return U}};Object.defineProperty(t,"config",e),t.util={warn:_n,extend:C,mergeOptions:Tn,defineReactive:Ct},t.set=At,t.delete=Et,t.nextTick=Re,t.observable=function(t){return Ot(t),t},t.options=Object.create(null),L.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,C(t.options.components,Qn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=O(arguments,1);return n.unshift(this),s(t.install)?t.install.apply(t,n):s(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Tn(this.options,t),this}}(t),qn(t),function(t){L.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&u(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&s(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(Vn),Object.defineProperty(Vn.prototype,"$isServer",{get:rt}),Object.defineProperty(Vn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Vn,"FunctionalRenderContext",{value:hn}),Vn.version="2.7.14";var to=b("style,class"),eo=b("input,textarea,option,select,progress"),no=b("contenteditable,draggable,spellcheck"),oo=b("events,caret,typing,plaintext-only"),io=b("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),ro="http://www.w3.org/1999/xlink",ao=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},co=function(t){return ao(t)?t.slice(6,t.length):""},lo=function(t){return null==t||!1===t};function so(t){for(var e=t.data,n=t,o=t;a(o.componentInstance);)(o=o.componentInstance._vnode)&&o.data&&(e=po(o.data,e));for(;a(n=n.parent);)n&&n.data&&(e=po(e,n.data));return function(t,e){if(a(t)||a(e))return uo(t,go(e));return""}(e.staticClass,e.class)}function po(t,e){return{staticClass:uo(t.staticClass,e.staticClass),class:a(t.class)?[t.class,e.class]:e.class}}function uo(t,e){return t?e?t+" "+e:t:e||""}function go(t){return Array.isArray(t)?function(t){for(var e,n="",o=0,i=t.length;o-1?Mo(t,e,n):io(e)?lo(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):no(e)?t.setAttribute(e,function(t,e){return lo(e)||"false"===e?"false":"contenteditable"===t&&oo(e)?e:"true"}(e,n)):ao(e)?lo(n)?t.removeAttributeNS(ro,co(e)):t.setAttributeNS(ro,e,n):Mo(t,e,n)}function Mo(t,e,n){if(lo(n))t.removeAttribute(e);else{if(X&&!Y&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var o=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",o)};t.addEventListener("input",o),t.__ieph=!0}t.setAttribute(e,n)}}var Ro={create:$o,update:$o};function Io(t,e){var n=e.elm,o=e.data,i=t.data;if(!(r(o.staticClass)&&r(o.class)&&(r(i)||r(i.staticClass)&&r(i.class)))){var c=so(e),l=n._transitionClasses;a(l)&&(c=uo(c,go(l))),c!==n._prevClass&&(n.setAttribute("class",c),n._prevClass=c)}}var Lo,No={create:Io,update:Io};function Uo(t,e,n){var o=Lo;return function i(){var r=e.apply(null,arguments);null!==r&&Ho(t,i,n,o)}}var zo=Oe&&!(et&&Number(et[1])<=53);function Wo(t,e,n,o){if(zo){var i=cn,r=e;e=r._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=i||t.timeStamp<=0||t.target.ownerDocument!==document)return r.apply(this,arguments)}}Lo.addEventListener(t,e,ot?{capture:n,passive:o}:n)}function Ho(t,e,n,o){(o||Lo).removeEventListener(t,e._wrapper||e,n)}function Vo(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},o=t.data.on||{};Lo=e.elm||t.elm,function(t){if(a(t.__r)){var e=X?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}a(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),Ht(n,o,Wo,Ho,Uo,e.context),Lo=void 0}}var qo,Go={create:Vo,update:Vo,destroy:function(t){return Vo(t,Do)}};function Zo(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,o,i=e.elm,l=t.data.domProps||{},s=e.data.domProps||{};for(n in(a(s.__ob__)||c(s._v_attr_proxy))&&(s=e.data.domProps=C({},s)),l)n in s||(i[n]="");for(n in s){if(o=s[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===l[n])continue;1===i.childNodes.length&&i.removeChild(i.childNodes[0])}if("value"===n&&"PROGRESS"!==i.tagName){i._value=o;var p=r(o)?"":String(o);Xo(i,p)&&(i.value=p)}else if("innerHTML"===n&&fo(i.tagName)&&r(i.innerHTML)){(qo=qo||document.createElement("div")).innerHTML="".concat(o,"");for(var d=qo.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;d.firstChild;)i.appendChild(d.firstChild)}else if(o!==l[n])try{i[n]=o}catch(t){}}}}function Xo(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,o=t._vModifiers;if(a(o)){if(o.number)return v(n)!==v(e);if(o.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Yo={create:Zo,update:Zo},Jo=B((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var o=t.split(n);o.length>1&&(e[o[0].trim()]=o[1].trim())}})),e}));function Qo(t){var e=ti(t.style);return t.staticStyle?C(t.staticStyle,e):e}function ti(t){return Array.isArray(t)?A(t):"string"==typeof t?Jo(t):t}var ei,ni=/^--/,oi=/\s*!important$/,ii=function(t,e,n){if(ni.test(e))t.style.setProperty(e,n);else if(oi.test(n))t.style.setProperty(S(e),n.replace(oi,""),"important");else{var o=ai(e);if(Array.isArray(n))for(var i=0,r=n.length;i-1?e.split(si).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function di(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(si).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),o=" "+e+" ";n.indexOf(o)>=0;)n=n.replace(o," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function ui(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&C(e,gi(t.name||"v")),C(e,t),e}return"string"==typeof t?gi(t):void 0}}var gi=B((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),hi=G&&!Y,mi="transition",fi="transitionend",vi="animation",bi="animationend";hi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(mi="WebkitTransition",fi="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(vi="WebkitAnimation",bi="webkitAnimationEnd"));var yi=G?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function wi(t){yi((function(){yi(t)}))}function ki(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),pi(t,e))}function _i(t,e){t._transitionClasses&&w(t._transitionClasses,e),di(t,e)}function Bi(t,e,n){var o=xi(t,e),i=o.type,r=o.timeout,a=o.propCount;if(!i)return n();var c="transition"===i?fi:bi,l=0,s=function(){t.removeEventListener(c,p),n()},p=function(e){e.target===t&&++l>=a&&s()};setTimeout((function(){l0&&(n="transition",p=a,d=r.length):"animation"===e?s>0&&(n="animation",p=s,d=l.length):d=(n=(p=Math.max(a,s))>0?a>s?"transition":"animation":null)?"transition"===n?r.length:l.length:0,{type:n,timeout:p,propCount:d,hasTransform:"transition"===n&&Di.test(o[mi+"Property"])}}function Pi(t,e){for(;t.length1}function Ai(t,e){!0!==e.data.show&&Si(e)}var Ei=function(t){var e,n,o={},s=t.modules,p=t.nodeOps;for(e=0;eh?w(t,r(n[v+1])?null:n[v+1].elm,n,g,v,o):g>v&&_(e,d,h)}(d,m,v,n,s):a(v)?(a(t.text)&&p.setTextContent(d,""),w(d,null,v,0,v.length-1,n)):a(m)?_(m,0,m.length-1):a(t.text)&&p.setTextContent(d,""):t.text!==e.text&&p.setTextContent(d,e.text),a(h)&&a(g=h.hook)&&a(g=g.postpatch)&&g(t,e)}}}function P(t,e,n){if(c(n)&&a(t.parent))t.parent.data.pendingInsert=e;else for(var o=0;o-1,a.selected!==r&&(a.selected=r);else if(j(Ri(a),o))return void(t.selectedIndex!==c&&(t.selectedIndex=c));i||(t.selectedIndex=-1)}}function Mi(t,e){return e.every((function(e){return!j(e,t)}))}function Ri(t){return"_value"in t?t._value:t.value}function Ii(t){t.target.composing=!0}function Li(t){t.target.composing&&(t.target.composing=!1,Ni(t.target,"input"))}function Ni(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Ui(t){return!t.componentInstance||t.data&&t.data.transition?t:Ui(t.componentInstance._vnode)}var zi={model:Fi,show:{bind:function(t,e,n){var o=e.value,i=(n=Ui(n)).data&&n.data.transition,r=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;o&&i?(n.data.show=!0,Si(n,(function(){t.style.display=r}))):t.style.display=o?r:"none"},update:function(t,e,n){var o=e.value;!o!=!e.oldValue&&((n=Ui(n)).data&&n.data.transition?(n.data.show=!0,o?Si(n,(function(){t.style.display=t.__vOriginalDisplay})):Ti(n,(function(){t.style.display="none"}))):t.style.display=o?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,o,i){i||(t.style.display=t.__vOriginalDisplay)}}},Wi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Hi(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Hi(Be(e.children)):t}function Vi(t){var e={},n=t.$options;for(var o in n.propsData)e[o]=t[o];var i=n._parentListeners;for(var o in i)e[x(o)]=i[o];return e}function qi(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Gi=function(t){return t.tag||ge(t)},Zi=function(t){return"show"===t.name},Xi={name:"transition",props:Wi,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Gi)).length){0;var o=this.mode;0;var i=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return i;var r=Hi(i);if(!r)return i;if(this._leaving)return qi(t,i);var a="__transition-".concat(this._uid,"-");r.key=null==r.key?r.isComment?a+"comment":a+r.tag:l(r.key)?0===String(r.key).indexOf(a)?r.key:a+r.key:r.key;var c=(r.data||(r.data={})).transition=Vi(this),s=this._vnode,p=Hi(s);if(r.data.directives&&r.data.directives.some(Zi)&&(r.data.show=!0),p&&p.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(r,p)&&!ge(p)&&(!p.componentInstance||!p.componentInstance._vnode.isComment)){var d=p.data.transition=C({},c);if("out-in"===o)return this._leaving=!0,Vt(d,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),qi(t,i);if("in-out"===o){if(ge(r))return s;var u,g=function(){u()};Vt(c,"afterEnter",g),Vt(c,"enterCancelled",g),Vt(d,"delayLeave",(function(t){u=t}))}}return i}}},Yi=C({tag:String,moveClass:String},Wi);function Ji(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Qi(t){t.data.newPos=t.elm.getBoundingClientRect()}function tr(t){var e=t.data.pos,n=t.data.newPos,o=e.left-n.left,i=e.top-n.top;if(o||i){t.data.moved=!0;var r=t.elm.style;r.transform=r.WebkitTransform="translate(".concat(o,"px,").concat(i,"px)"),r.transitionDuration="0s"}}delete Yi.mode;var er={Transition:Xi,TransitionGroup:{props:Yi,beforeMount:function(){var t=this,e=this._update;this._update=function(n,o){var i=Xe(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,o)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),o=this.prevChildren=this.children,i=this.$slots.default||[],r=this.children=[],a=Vi(this),c=0;c-1?bo[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:bo[t]=/HTMLUnknownElement/.test(e.toString())},C(Vn.options.directives,zi),C(Vn.options.components,er),Vn.prototype.__patch__=G?Ei:E,Vn.prototype.$mount=function(t,e){return function(t,e,n){var o;t.$el=e,t.$options.render||(t.$options.render=gt),Qe(t,"beforeMount"),o=function(){t._update(t._render(),n)},new We(t,o,E,{before:function(){t._isMounted&&!t._isDestroyed&&Qe(t,"beforeUpdate")}},!0),n=!1;var i=t._preWatchers;if(i)for(var r=0;r=0&&(e=t.slice(o),t=t.slice(0,o));var i=t.indexOf("?");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{path:t,query:n,hash:e}}(i.path||""),s=e&&e.path||"/",p=l.path?_r(l.path,s,n||i.append):s,d=function(t,e,n){void 0===e&&(e={});var o,i=n||sr;try{o=i(t||"")}catch(t){o={}}for(var r in e){var a=e[r];o[r]=Array.isArray(a)?a.map(lr):lr(a)}return o}(l.query,i.query,o&&o.options.parseQuery),u=i.hash||l.hash;return u&&"#"!==u.charAt(0)&&(u="#"+u),{_normalized:!0,path:p,query:d,hash:u}}var zr,Wr=function(){},Hr={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(t){var e=this,n=this.$router,o=this.$route,i=n.resolve(this.to,o,this.append),r=i.location,a=i.route,c=i.href,l={},s=n.options.linkActiveClass,p=n.options.linkExactActiveClass,d=null==s?"router-link-active":s,u=null==p?"router-link-exact-active":p,g=null==this.activeClass?d:this.activeClass,h=null==this.exactActiveClass?u:this.exactActiveClass,m=a.redirectedFrom?ur(null,Ur(a.redirectedFrom),null,n):a;l[h]=vr(o,m,this.exactPath),l[g]=this.exact||this.exactPath?l[h]:function(t,e){return 0===t.path.replace(dr,"/").indexOf(e.path.replace(dr,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(o,m);var f=l[h]?this.ariaCurrentValue:null,v=function(t){Vr(t)&&(e.replace?n.replace(r,Wr):n.push(r,Wr))},b={click:Vr};Array.isArray(this.event)?this.event.forEach((function(t){b[t]=v})):b[this.event]=v;var y={class:l},w=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:c,route:a,navigate:v,isActive:l[g],isExactActive:l[h]});if(w){if(1===w.length)return w[0];if(w.length>1||!w.length)return 0===w.length?t():t("span",{},w)}if("a"===this.tag)y.on=b,y.attrs={href:c,"aria-current":f};else{var k=function t(e){var n;if(e)for(var o=0;o-1&&(c.params[u]=n.params[u]);return c.path=Nr(p.path,c.params),l(p,c,a)}if(c.path){c.params={};for(var g=0;g-1}function Ba(t,e){return _a(t)&&t._isRouter&&(null==e||t.type===e)}function Da(t,e,n){var o=function(i){i>=t.length?n():t[i]?e(t[i],(function(){o(i+1)})):o(i+1)};o(0)}function xa(t){return function(e,n,o){var i=!1,r=0,a=null;Pa(t,(function(t,e,n,c){if("function"==typeof t&&void 0===t.cid){i=!0,r++;var l,s=Ta((function(e){var i;((i=e).__esModule||Sa&&"Module"===i[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:zr.extend(e),n.components[c]=e,--r<=0&&o()})),p=Ta((function(t){var e="Failed to resolve async component "+c+": "+t;a||(a=_a(t)?t:new Error(e),o(a))}));try{l=t(s,p)}catch(t){p(t)}if(l)if("function"==typeof l.then)l.then(s,p);else{var d=l.component;d&&"function"==typeof d.then&&d.then(s,p)}}})),i||o()}}function Pa(t,e){return Ka(t.map((function(t){return Object.keys(t.components).map((function(n){return e(t.components[n],t.instances[n],t,n)}))})))}function Ka(t){return Array.prototype.concat.apply([],t)}var Sa="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ta(t){var e=!1;return function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];if(!e)return e=!0,t.apply(this,n)}}var Oa=function(t,e){this.router=t,this.base=function(t){if(!t)if(qr){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=hr,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Ca(t,e,n,o){var i=Pa(t,(function(t,o,i,r){var a=function(t,e){"function"!=typeof t&&(t=zr.extend(t));return t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return n(t,o,i,r)})):n(a,o,i,r)}));return Ka(o?i.reverse():i)}function Aa(t,e){if(e)return function(){return t.apply(e,arguments)}}Oa.prototype.listen=function(t){this.cb=t},Oa.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},Oa.prototype.onError=function(t){this.errorCbs.push(t)},Oa.prototype.transitionTo=function(t,e,n){var o,i=this;try{o=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var r=this.current;this.confirmTransition(o,(function(){i.updateRoute(o),e&&e(o),i.ensureURL(),i.router.afterHooks.forEach((function(t){t&&t(o,r)})),i.ready||(i.ready=!0,i.readyCbs.forEach((function(t){t(o)})))}),(function(t){n&&n(t),t&&!i.ready&&(Ba(t,va.redirected)&&r===hr||(i.ready=!0,i.readyErrorCbs.forEach((function(e){e(t)}))))}))},Oa.prototype.confirmTransition=function(t,e,n){var o=this,i=this.current;this.pending=t;var r,a,c=function(t){!Ba(t)&&_a(t)&&(o.errorCbs.length?o.errorCbs.forEach((function(e){e(t)})):console.error(t)),n&&n(t)},l=t.matched.length-1,s=i.matched.length-1;if(vr(t,i)&&l===s&&t.matched[l]===i.matched[s])return this.ensureURL(),t.hash&&ra(this.router,i,t,!1),c(((a=wa(r=i,t,va.duplicated,'Avoided redundant navigation to current location: "'+r.fullPath+'".')).name="NavigationDuplicated",a));var p=function(t,e){var n,o=Math.max(t.length,e.length);for(n=0;n0)){var e=this.router,n=e.options.scrollBehavior,o=ha&&n;o&&this.listeners.push(ia());var i=function(){var n=t.current,i=Fa(t.base);t.current===hr&&i===t._startLocation||t.transitionTo(i,(function(t){o&&ra(e,t,n,!0)}))};window.addEventListener("popstate",i),this.listeners.push((function(){window.removeEventListener("popstate",i)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){ma(Br(o.base+t.fullPath)),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){fa(Br(o.base+t.fullPath)),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.ensureURL=function(t){if(Fa(this.base)!==this.current.fullPath){var e=Br(this.base+this.current.fullPath);t?ma(e):fa(e)}},e.prototype.getCurrentLocation=function(){return Fa(this.base)},e}(Oa);function Fa(t){var e=window.location.pathname,n=e.toLowerCase(),o=t.toLowerCase();return!t||n!==o&&0!==n.indexOf(Br(o+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var $a=function(t){function e(e,n,o){t.call(this,e,n),o&&function(t){var e=Fa(t);if(!/^\/#/.test(e))return window.location.replace(Br(t+"/#"+e)),!0}(this.base)||ja()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,n=ha&&e;n&&this.listeners.push(ia());var o=function(){var e=t.current;ja()&&t.transitionTo(Ma(),(function(o){n&&ra(t.router,o,e,!0),ha||La(o.fullPath)}))},i=ha?"popstate":"hashchange";window.addEventListener(i,o),this.listeners.push((function(){window.removeEventListener(i,o)}))}},e.prototype.push=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){Ia(t.fullPath),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){La(t.fullPath),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;Ma()!==e&&(t?Ia(e):La(e))},e.prototype.getCurrentLocation=function(){return Ma()},e}(Oa);function ja(){var t=Ma();return"/"===t.charAt(0)||(La("/"+t),!1)}function Ma(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Ra(t){var e=window.location.href,n=e.indexOf("#");return(n>=0?e.slice(0,n):e)+"#"+t}function Ia(t){ha?ma(Ra(t)):window.location.hash=t}function La(t){ha?fa(Ra(t)):window.location.replace(Ra(t))}var Na=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var o=this;this.transitionTo(t,(function(t){o.stack=o.stack.slice(0,o.index+1).concat(t),o.index++,e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var o=this;this.transitionTo(t,(function(t){o.stack=o.stack.slice(0,o.index).concat(t),e&&e(t)}),n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var o=this.stack[n];this.confirmTransition(o,(function(){var t=e.current;e.index=n,e.updateRoute(o),e.router.afterHooks.forEach((function(e){e&&e(o,t)}))}),(function(t){Ba(t,va.duplicated)&&(e.index=n)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Oa),Ua=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Xr(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!ha&&!1!==t.fallback,this.fallback&&(e="hash"),qr||(e="abstract"),this.mode=e,e){case"history":this.history=new Ea(this,t.base);break;case"hash":this.history=new $a(this,t.base,this.fallback);break;case"abstract":this.history=new Na(this,t.base);break;default:0}},za={currentRoute:{configurable:!0}};Ua.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},za.currentRoute.get=function(){return this.history&&this.history.current},Ua.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var n=this.history;if(n instanceof Ea||n instanceof $a){var o=function(t){n.setupListeners(),function(t){var o=n.current,i=e.options.scrollBehavior;ha&&i&&"fullPath"in t&&ra(e,t,o,!1)}(t)};n.transitionTo(n.getCurrentLocation(),o,o)}n.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Ua.prototype.beforeEach=function(t){return Ha(this.beforeHooks,t)},Ua.prototype.beforeResolve=function(t){return Ha(this.resolveHooks,t)},Ua.prototype.afterEach=function(t){return Ha(this.afterHooks,t)},Ua.prototype.onReady=function(t,e){this.history.onReady(t,e)},Ua.prototype.onError=function(t){this.history.onError(t)},Ua.prototype.push=function(t,e,n){var o=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){o.history.push(t,e,n)}));this.history.push(t,e,n)},Ua.prototype.replace=function(t,e,n){var o=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){o.history.replace(t,e,n)}));this.history.replace(t,e,n)},Ua.prototype.go=function(t){this.history.go(t)},Ua.prototype.back=function(){this.go(-1)},Ua.prototype.forward=function(){this.go(1)},Ua.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Ua.prototype.resolve=function(t,e,n){var o=Ur(t,e=e||this.history.current,n,this),i=this.match(o,e),r=i.redirectedFrom||i.fullPath;return{location:o,route:i,href:function(t,e,n){var o="hash"===n?"#"+e:e;return t?Br(t+"/"+o):o}(this.history.base,r,this.mode),normalizedTo:o,resolved:i}},Ua.prototype.getRoutes=function(){return this.matcher.getRoutes()},Ua.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==hr&&this.history.transitionTo(this.history.getCurrentLocation())},Ua.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==hr&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Ua.prototype,za);var Wa=Ua;function Ha(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}Ua.install=function t(e){if(!t.installed||zr!==e){t.installed=!0,zr=e;var n=function(t){return void 0!==t},o=function(t,e){var o=t.$options._parentVnode;n(o)&&n(o=o.data)&&n(o=o.registerRouteInstance)&&o(t,e)};e.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,o(this,this)},destroyed:function(){o(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",wr),e.component("RouterLink",Hr);var i=e.config.optionMergeStrategies;i.beforeRouteEnter=i.beforeRouteLeave=i.beforeRouteUpdate=i.created}},Ua.version="3.6.5",Ua.isNavigationFailure=Ba,Ua.NavigationFailureType=va,Ua.START_LOCATION=hr,qr&&window.Vue&&window.Vue.use(Ua);n(53);n(100),n(46);var Va={"components/AlgoliaSearchBox":()=>Promise.all([n.e(0),n.e(23)]).then(n.bind(null,326)),"components/DropdownLink":()=>Promise.all([n.e(0),n.e(22)]).then(n.bind(null,287)),"components/DropdownTransition":()=>Promise.all([n.e(0),n.e(32)]).then(n.bind(null,262)),"components/Home":()=>Promise.all([n.e(0),n.e(27)]).then(n.bind(null,327)),"components/NavLink":()=>n.e(43).then(n.bind(null,254)),"components/NavLinks":()=>Promise.all([n.e(0),n.e(20)]).then(n.bind(null,276)),"components/Navbar":()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,286)),"components/Page":()=>Promise.all([n.e(0),n.e(18)]).then(n.bind(null,298)),"components/PageEdit":()=>Promise.all([n.e(0),n.e(28)]).then(n.bind(null,288)),"components/PageNav":()=>Promise.all([n.e(0),n.e(24)]).then(n.bind(null,289)),"components/Sidebar":()=>Promise.all([n.e(0),n.e(16)]).then(n.bind(null,269)),"components/SidebarButton":()=>Promise.all([n.e(0),n.e(33)]).then(n.bind(null,329)),"components/SidebarGroup":()=>Promise.all([n.e(0),n.e(7)]).then(n.bind(null,265)),"components/SidebarLink":()=>Promise.all([n.e(0),n.e(30)]).then(n.bind(null,263)),"components/SidebarLinks":()=>Promise.all([n.e(0),n.e(7)]).then(n.bind(null,256)),"global-components/Badge":()=>Promise.all([n.e(0),n.e(8)]).then(n.bind(null,398)),"global-components/CodeBlock":()=>Promise.all([n.e(0),n.e(9)]).then(n.bind(null,388)),"global-components/CodeGroup":()=>Promise.all([n.e(0),n.e(10)]).then(n.bind(null,389)),"layouts/404":()=>Promise.all([n.e(0),n.e(1),n.e(6)]).then(n.bind(null,390)),"layouts/Layout":()=>Promise.all([n.e(0),n.e(1),n.e(3)]).then(n.bind(null,391)),NotFound:()=>Promise.all([n.e(0),n.e(1),n.e(6)]).then(n.bind(null,390)),Layout:()=>Promise.all([n.e(0),n.e(1),n.e(3)]).then(n.bind(null,391)),"components/Cases":()=>Promise.all([n.e(0),n.e(25)]).then(n.bind(null,328)),"components/Footer":()=>Promise.all([n.e(0),n.e(26)]).then(n.bind(null,270)),"components/LayoutWrap":()=>Promise.all([n.e(0),n.e(1),n.e(17)]).then(n.bind(null,277)),"components/PostMeta":()=>Promise.all([n.e(0),n.e(29)]).then(n.bind(null,299)),"layouts/DirectoryPagination":()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(11)]).then(n.bind(null,392)),"layouts/FrontmatterKey":()=>Promise.all([n.e(0),n.e(1),n.e(5)]).then(n.bind(null,393)),"layouts/FrontmatterPagination":()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(12)]).then(n.bind(null,394)),"layouts/IndexPost":()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,325)),"layouts/Post":()=>Promise.all([n.e(0),n.e(1),n.e(4)]).then(n.bind(null,395)),DirectoryPagination:()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(11)]).then(n.bind(null,392)),FrontmatterKey:()=>Promise.all([n.e(0),n.e(1),n.e(5)]).then(n.bind(null,393)),FrontmatterPagination:()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(12)]).then(n.bind(null,394)),IndexPost:()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,325)),Post:()=>Promise.all([n.e(0),n.e(1),n.e(4)]).then(n.bind(null,395))},qa={"v-330a32a2":()=>n.e(45).then(n.bind(null,399)),"v-2c450c3f":()=>n.e(46).then(n.bind(null,400)),"v-5e744cf7":()=>n.e(47).then(n.bind(null,401)),"v-7c0c45f9":()=>n.e(48).then(n.bind(null,402)),"v-8bd632d6":()=>n.e(49).then(n.bind(null,403)),"v-0f4d5d15":()=>n.e(50).then(n.bind(null,404)),"v-2cebe183":()=>n.e(34).then(n.bind(null,405)),"v-3eaa044d":()=>n.e(31).then(n.bind(null,406)),"v-353b78e1":()=>n.e(51).then(n.bind(null,407)),"v-3875825f":()=>n.e(52).then(n.bind(null,408)),"v-07ff1843":()=>n.e(53).then(n.bind(null,409)),"v-9504490e":()=>n.e(54).then(n.bind(null,410)),"v-c6756cce":()=>n.e(55).then(n.bind(null,411)),"v-56536559":()=>n.e(19).then(n.bind(null,412)),"v-f58ec8f2":()=>n.e(21).then(n.bind(null,413)),"v-015729b9":()=>n.e(56).then(n.bind(null,414)),"v-2c605799":()=>n.e(57).then(n.bind(null,415)),"v-57698579":()=>n.e(58).then(n.bind(null,416)),"v-9145467a":()=>n.e(59).then(n.bind(null,417)),"v-2cf72b39":()=>n.e(60).then(n.bind(null,418)),"v-11d64359":()=>n.e(61).then(n.bind(null,419)),"v-5d749fce":()=>n.e(62).then(n.bind(null,420)),"v-ab5ba3ce":()=>n.e(63).then(n.bind(null,421)),"v-d0375c8e":()=>n.e(64).then(n.bind(null,422)),"v-edd5570e":()=>n.e(66).then(n.bind(null,423)),"v-10852eea":()=>n.e(65).then(n.bind(null,424)),"v-05df4999":()=>n.e(67).then(n.bind(null,425)),"v-faad828e":()=>n.e(68).then(n.bind(null,426)),"v-0119984e":()=>n.e(69).then(n.bind(null,427)),"v-7c3d28f9":()=>n.e(70).then(n.bind(null,428)),"v-0df1c3ce":()=>n.e(71).then(n.bind(null,429)),"v-75d11339":()=>n.e(72).then(n.bind(null,430)),"v-1ac9ef4e":()=>n.e(73).then(n.bind(null,431)),"v-55969f39":()=>n.e(74).then(n.bind(null,432)),"v-8534b9c2":()=>n.e(75).then(n.bind(null,433)),"v-aeb70fce":()=>n.e(76).then(n.bind(null,434)),"v-4dc135e3":()=>n.e(77).then(n.bind(null,435)),"v-30c0037b":()=>Promise.all([n.e(0),n.e(36)]).then(n.bind(null,436)),"v-4d760891":()=>Promise.all([n.e(0),n.e(35)]).then(n.bind(null,437)),"v-4bb7844a":()=>Promise.all([n.e(0),n.e(37)]).then(n.bind(null,438)),"v-b936290e":()=>Promise.all([n.e(0),n.e(38)]).then(n.bind(null,439)),"v-7afdbb4e":()=>Promise.all([n.e(0),n.e(39)]).then(n.bind(null,440)),"v-4e0b610e":()=>Promise.all([n.e(0),n.e(40)]).then(n.bind(null,441)),"v-a7c24c4e":()=>Promise.all([n.e(0),n.e(41)]).then(n.bind(null,442)),"v-7a315e41":()=>n.e(78).then(n.bind(null,443)),"v-17019aeb":()=>Promise.all([n.e(0),n.e(42)]).then(n.bind(null,444)),"v-f611a14e":()=>n.e(79).then(n.bind(null,445)),"v-3acb6e6a":()=>n.e(80).then(n.bind(null,446)),"v-496cb7f9":()=>n.e(81).then(n.bind(null,396)),"v-0b3b65ea":()=>n.e(82).then(n.bind(null,447)),"v-a76bccee":()=>n.e(83).then(n.bind(null,448)),"v-05d01c19":()=>n.e(84).then(n.bind(null,449)),"v-11bf335e":()=>n.e(85).then(n.bind(null,450)),"v-a9236c10":()=>n.e(86).then(n.bind(null,451)),"v-29f9f21c":()=>n.e(87).then(n.bind(null,452)),"v-3750297a":()=>n.e(88).then(n.bind(null,453)),"v-105750ce":()=>n.e(89).then(n.bind(null,454)),"v-c152529c":()=>n.e(90).then(n.bind(null,455)),"v-50aa6d4e":()=>n.e(91).then(n.bind(null,456)),"v-4bcdac39":()=>n.e(92).then(n.bind(null,457))};function Ga(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const Za=/-(\w)/g,Xa=Ga(t=>t.replace(Za,(t,e)=>e?e.toUpperCase():"")),Ya=/\B([A-Z])/g,Ja=Ga(t=>t.replace(Ya,"-$1").toLowerCase()),Qa=Ga(t=>t.charAt(0).toUpperCase()+t.slice(1));function tc(t,e){if(!e)return;if(t(e))return t(e);return e.includes("-")?t(Qa(Xa(e))):t(Qa(e))||t(Ja(e))}const ec=Object.assign({},Va,qa),nc=t=>ec[t],oc=t=>qa[t],ic=t=>Va[t],rc=t=>Vn.component(t);function ac(t){return tc(oc,t)}function cc(t){return tc(ic,t)}function lc(t){return tc(nc,t)}function sc(t){return tc(rc,t)}function pc(...t){return Promise.all(t.filter(t=>t).map(async t=>{if(!sc(t)&&lc(t)){const e=await lc(t)();Vn.component(t,e.default)}}))}function dc(t,e){"undefined"!=typeof window&&window.__VUEPRESS__&&(window.__VUEPRESS__[t]=e)}var uc=n(91),gc=n.n(uc),hc=n(92),mc=n.n(hc),fc={created(){if(this.siteMeta=this.$site.headTags.filter(([t])=>"meta"===t).map(([t,e])=>e),this.$ssrContext){const e=this.getMergedMetaTags();this.$ssrContext.title=this.$title,this.$ssrContext.lang=this.$lang,this.$ssrContext.pageMeta=(t=e)?t.map(t=>{let e="{e+=` ${n}="${mc()(t[n])}"`}),e+">"}).join("\n "):"",this.$ssrContext.canonicalLink=bc(this.$canonicalUrl)}var t},mounted(){this.currentMetaTags=[...document.querySelectorAll("meta")],this.updateMeta(),this.updateCanonicalLink()},methods:{updateMeta(){document.title=this.$title,document.documentElement.lang=this.$lang;const t=this.getMergedMetaTags();this.currentMetaTags=yc(t,this.currentMetaTags)},getMergedMetaTags(){const t=this.$page.frontmatter.meta||[];return gc()([{name:"description",content:this.$description}],t,this.siteMeta,wc)},updateCanonicalLink(){vc(),this.$canonicalUrl&&document.head.insertAdjacentHTML("beforeend",bc(this.$canonicalUrl))}},watch:{$page(){this.updateMeta(),this.updateCanonicalLink()}},beforeDestroy(){yc(null,this.currentMetaTags),vc()}};function vc(){const t=document.querySelector("link[rel='canonical']");t&&t.remove()}function bc(t=""){return t?``:""}function yc(t,e){if(e&&[...e].filter(t=>t.parentNode===document.head).forEach(t=>document.head.removeChild(t)),t)return t.map(t=>{const e=document.createElement("meta");return Object.keys(t).forEach(n=>{e.setAttribute(n,t[n])}),document.head.appendChild(e),e})}function wc(t){for(const e of["name","property","itemprop"])if(t.hasOwnProperty(e))return t[e]+e;return JSON.stringify(t)}var kc=n(93),_c={mounted(){window.addEventListener("scroll",this.onScroll)},methods:{onScroll:n.n(kc)()((function(){this.setActiveHash()}),300),setActiveHash(){const t=[].slice.call(document.querySelectorAll(".sidebar-link")),e=[].slice.call(document.querySelectorAll(".header-anchor")).filter(e=>t.some(t=>t.hash===e.hash)),n=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),o=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),i=window.innerHeight+n;for(let t=0;t=r.parentElement.offsetTop+10&&(!a||n{this.$nextTick(()=>{this.$vuepress.$set("disableScrollBehavior",!1)})})}}}},beforeDestroy(){window.removeEventListener("scroll",this.onScroll)}},Bc=n(22),Dc=n.n(Bc),xc={mounted(){Dc.a.configure({showSpinner:!1}),this.$router.beforeEach((t,e,n)=>{t.path===e.path||Vn.component(t.name)||Dc.a.start(),n()}),this.$router.afterEach(()=>{Dc.a.done(),this.isSidebarOpen=!1})}},Pc={props:{parent:Object,code:String,options:{align:String,color:String,backgroundTransition:Boolean,backgroundColor:String,successText:String,staticIcon:Boolean}},data:()=>({success:!1,originalBackground:null,originalTransition:null}),computed:{alignStyle(){let t={};return t[this.options.align]="7.5px",t},iconClass(){return this.options.staticIcon?"":"hover"}},mounted(){this.originalTransition=this.parent.style.transition,this.originalBackground=this.parent.style.background},beforeDestroy(){this.parent.style.transition=this.originalTransition,this.parent.style.background=this.originalBackground},methods:{hexToRgb(t){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},copyToClipboard(t){if(navigator.clipboard)navigator.clipboard.writeText(this.code).then(()=>{this.setSuccessTransitions()},()=>{});else{let t=document.createElement("textarea");document.body.appendChild(t),t.value=this.code,t.select(),document.execCommand("Copy"),t.remove(),this.setSuccessTransitions()}},setSuccessTransitions(){if(clearTimeout(this.successTimeout),this.options.backgroundTransition){this.parent.style.transition="background 350ms";let t=this.hexToRgb(this.options.backgroundColor);this.parent.style.background=`rgba(${t.r}, ${t.g}, ${t.b}, 0.1)`}this.success=!0,this.successTimeout=setTimeout(()=>{this.options.backgroundTransition&&(this.parent.style.background=this.originalBackground,this.parent.style.transition=this.originalTransition),this.success=!1},500)}}},Kc=(n(240),n(7)),Sc=Object(Kc.a)(Pc,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"code-copy"},[e("svg",{class:t.iconClass,style:t.alignStyle,attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},on:{click:t.copyToClipboard}},[e("path",{attrs:{fill:"none",d:"M0 0h24v24H0z"}}),t._v(" "),e("path",{attrs:{fill:t.options.color,d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}})]),t._v(" "),e("span",{class:t.success?"success":"",style:t.alignStyle},[t._v("\n "+t._s(t.options.successText)+"\n ")])])}),[],!1,null,"49140617",null).exports,Tc=(n(241),{updated(){this.update()},methods:{update(){setTimeout(()=>{document.querySelectorAll('div[class*="language-"] pre').forEach(t=>{if(t.classList.contains("code-copy-added"))return;let e=new(Vn.extend(Sc));e.options={align:"bottom",color:"#8F979E",backgroundTransition:!1,backgroundColor:"#0075b8",successText:"Copied!",staticIcon:!0},e.code=t.innerText,e.parent=t,e.$mount(),t.classList.add("code-copy-added"),t.appendChild(e.$el)})},100)}}}),Oc=(n(242),Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},o=window.Promise||function(t){function e(){}t(e,e)},i=function(t){var e=t.target;e!==x?-1!==y.indexOf(e)&&m({target:e}):h()},r=function(){if(!k&&D.original){var t=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(_-t)>B.scrollOffset&&setTimeout(h,150)}},a=function(t){var e=t.key||t.keyCode;"Escape"!==e&&"Esc"!==e&&27!==e||h()},c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t;if(t.background&&(x.style.background=t.background),t.container&&t.container instanceof Object&&(e.container=Oc({},B.container,t.container)),t.template){var n=Ac(t.template)?t.template:document.querySelector(t.template);e.template=n}return B=Oc({},B,e),y.forEach((function(t){t.dispatchEvent(Mc("medium-zoom:update",{detail:{zoom:P}}))})),P},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t(Oc({},B,e))},s=function(){for(var t=arguments.length,e=Array(t),n=0;n0?e.reduce((function(t,e){return[].concat(t,Fc(e))}),[]):y;return o.forEach((function(t){t.classList.remove("medium-zoom-image"),t.dispatchEvent(Mc("medium-zoom:detach",{detail:{zoom:P}}))})),y=y.filter((function(t){return-1===o.indexOf(t)})),P},d=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return y.forEach((function(o){o.addEventListener("medium-zoom:"+t,e,n)})),w.push({type:"medium-zoom:"+t,listener:e,options:n}),P},u=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return y.forEach((function(o){o.removeEventListener("medium-zoom:"+t,e,n)})),w=w.filter((function(n){return!(n.type==="medium-zoom:"+t&&n.listener.toString()===e.toString())})),P},g=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,n=function(){var t={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},e=void 0,n=void 0;if(B.container)if(B.container instanceof Object)e=(t=Oc({},t,B.container)).width-t.left-t.right-2*B.margin,n=t.height-t.top-t.bottom-2*B.margin;else{var o=(Ac(B.container)?B.container:document.querySelector(B.container)).getBoundingClientRect(),i=o.width,r=o.height,a=o.left,c=o.top;t=Oc({},t,{width:i,height:r,left:a,top:c})}e=e||t.width-2*B.margin,n=n||t.height-2*B.margin;var l=D.zoomedHd||D.original,s=Ec(l)?e:l.naturalWidth||e,p=Ec(l)?n:l.naturalHeight||n,d=l.getBoundingClientRect(),u=d.top,g=d.left,h=d.width,m=d.height,f=Math.min(Math.max(h,s),e)/h,v=Math.min(Math.max(m,p),n)/m,b=Math.min(f,v),y="scale("+b+") translate3d("+((e-h)/2-g+B.margin+t.left)/b+"px, "+((n-m)/2-u+B.margin+t.top)/b+"px, 0)";D.zoomed.style.transform=y,D.zoomedHd&&(D.zoomedHd.style.transform=y)};return new o((function(t){if(e&&-1===y.indexOf(e))t(P);else{if(D.zoomed)t(P);else{if(e)D.original=e;else{if(!(y.length>0))return void t(P);var o=y;D.original=o[0]}if(D.original.dispatchEvent(Mc("medium-zoom:open",{detail:{zoom:P}})),_=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,k=!0,D.zoomed=jc(D.original),document.body.appendChild(x),B.template){var i=Ac(B.template)?B.template:document.querySelector(B.template);D.template=document.createElement("div"),D.template.appendChild(i.content.cloneNode(!0)),document.body.appendChild(D.template)}if(D.original.parentElement&&"PICTURE"===D.original.parentElement.tagName&&D.original.currentSrc&&(D.zoomed.src=D.original.currentSrc),document.body.appendChild(D.zoomed),window.requestAnimationFrame((function(){document.body.classList.add("medium-zoom--opened")})),D.original.classList.add("medium-zoom-image--hidden"),D.zoomed.classList.add("medium-zoom-image--opened"),D.zoomed.addEventListener("click",h),D.zoomed.addEventListener("transitionend",(function e(){k=!1,D.zoomed.removeEventListener("transitionend",e),D.original.dispatchEvent(Mc("medium-zoom:opened",{detail:{zoom:P}})),t(P)})),D.original.getAttribute("data-zoom-src")){D.zoomedHd=D.zoomed.cloneNode(),D.zoomedHd.removeAttribute("srcset"),D.zoomedHd.removeAttribute("sizes"),D.zoomedHd.removeAttribute("loading"),D.zoomedHd.src=D.zoomed.getAttribute("data-zoom-src"),D.zoomedHd.onerror=function(){clearInterval(r),console.warn("Unable to reach the zoom image target "+D.zoomedHd.src),D.zoomedHd=null,n()};var r=setInterval((function(){D.zoomedHd.complete&&(clearInterval(r),D.zoomedHd.classList.add("medium-zoom-image--opened"),D.zoomedHd.addEventListener("click",h),document.body.appendChild(D.zoomedHd),n())}),10)}else if(D.original.hasAttribute("srcset")){D.zoomedHd=D.zoomed.cloneNode(),D.zoomedHd.removeAttribute("sizes"),D.zoomedHd.removeAttribute("loading");var a=D.zoomedHd.addEventListener("load",(function(){D.zoomedHd.removeEventListener("load",a),D.zoomedHd.classList.add("medium-zoom-image--opened"),D.zoomedHd.addEventListener("click",h),document.body.appendChild(D.zoomedHd),n()}))}else n()}}}))},h=function(){return new o((function(t){if(!k&&D.original){k=!0,document.body.classList.remove("medium-zoom--opened"),D.zoomed.style.transform="",D.zoomedHd&&(D.zoomedHd.style.transform=""),D.template&&(D.template.style.transition="opacity 150ms",D.template.style.opacity=0),D.original.dispatchEvent(Mc("medium-zoom:close",{detail:{zoom:P}})),D.zoomed.addEventListener("transitionend",(function e(){D.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(D.zoomed),D.zoomedHd&&document.body.removeChild(D.zoomedHd),document.body.removeChild(x),D.zoomed.classList.remove("medium-zoom-image--opened"),D.template&&document.body.removeChild(D.template),k=!1,D.zoomed.removeEventListener("transitionend",e),D.original.dispatchEvent(Mc("medium-zoom:closed",{detail:{zoom:P}})),D.original=null,D.zoomed=null,D.zoomedHd=null,D.template=null,t(P)}))}else t(P)}))},m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target;return D.original?h():g({target:e})},f=function(){return B},v=function(){return y},b=function(){return D.original},y=[],w=[],k=!1,_=0,B=n,D={original:null,zoomed:null,zoomedHd:null,template:null};"[object Object]"===Object.prototype.toString.call(e)?B=e:(e||"string"==typeof e)&&s(e),B=Oc({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},B);var x=$c(B.background);document.addEventListener("click",i),document.addEventListener("keyup",a),document.addEventListener("scroll",r),window.addEventListener("resize",h);var P={open:g,close:h,toggle:m,update:c,clone:l,attach:s,detach:p,on:d,off:u,getOptions:f,getImages:v,getZoomedImage:b};return P},Ic=[fc,_c,xc,Tc,{data:()=>({zoom:null}),mounted(){this.updateZoom()},updated(){this.updateZoom()},methods:{updateZoom(){setTimeout(()=>{this.zoom&&this.zoom.detach(),this.zoom=Rc(".theme-default-content :not(a) > img",void 0)},1e3)}}}],Lc={name:"GlobalLayout",computed:{layout(){const t=this.getLayout();return dc("layout",t),Vn.component(t)}},methods:{getLayout(){if(this.$page.path){const t=this.$page.frontmatter.layout;return t&&(this.$vuepress.getLayoutAsyncComponent(t)||this.$vuepress.getVueComponent(t))?t:"Layout"}return"NotFound"}}},Nc=Object(Kc.a)(Lc,(function(){return(0,this._self._c)(this.layout,{tag:"component"})}),[],!1,null,null,null).exports;!function(t,e,n){switch(e){case"components":t[e]||(t[e]={}),Object.assign(t[e],n);break;case"mixins":t[e]||(t[e]=[]),t[e].push(...n);break;default:throw new Error("Unknown option name.")}}(Nc,"mixins",Ic);const Uc=[{name:"v-330a32a2",path:"/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-330a32a2").then(n)}},{path:"/index.html",redirect:"/"},{name:"v-2c450c3f",path:"/blog/_2023-q4-update/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2c450c3f").then(n)}},{path:"/blog/_2023-q4-update/index.html",redirect:"/blog/_2023-q4-update/"},{path:"/_blog/2023_q4_update.html",redirect:"/blog/_2023-q4-update/"},{name:"v-5e744cf7",path:"/blog/_2024-q1-update/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-5e744cf7").then(n)}},{path:"/blog/_2024-q1-update/index.html",redirect:"/blog/_2024-q1-update/"},{path:"/_blog/2024_q1_update.html",redirect:"/blog/_2024-q1-update/"},{name:"v-7c0c45f9",path:"/blog/bitcoin-core-rpc-demo/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-7c0c45f9").then(n)}},{path:"/blog/bitcoin-core-rpc-demo/index.html",redirect:"/blog/bitcoin-core-rpc-demo/"},{path:"/_blog/Bitcoin_Core_RPC_Demo.html",redirect:"/blog/bitcoin-core-rpc-demo/"},{name:"v-8bd632d6",path:"/blog/bdk-cli-basics-multisig-2of3/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-8bd632d6").then(n)}},{path:"/blog/bdk-cli-basics-multisig-2of3/index.html",redirect:"/blog/bdk-cli-basics-multisig-2of3/"},{path:"/_blog/bdk-cli_basics_multisig_2of3.html",redirect:"/blog/bdk-cli-basics-multisig-2of3/"},{name:"v-0f4d5d15",path:"/blog/bdk-cli-basics/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-0f4d5d15").then(n)}},{path:"/blog/bdk-cli-basics/index.html",redirect:"/blog/bdk-cli-basics/"},{path:"/_blog/bdk_cli_basics.html",redirect:"/blog/bdk-cli-basics/"},{name:"v-2cebe183",path:"/blog/bdk-core-pt1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2cebe183").then(n)}},{path:"/blog/bdk-core-pt1/index.html",redirect:"/blog/bdk-core-pt1/"},{path:"/_blog/bdk_core_pt1.html",redirect:"/blog/bdk-core-pt1/"},{name:"v-3eaa044d",path:"/blog/bdk-rn-making-of/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-3eaa044d").then(n)}},{path:"/blog/bdk-rn-making-of/index.html",redirect:"/blog/bdk-rn-making-of/"},{path:"/_blog/bdk_rn_making_of.html",redirect:"/blog/bdk-rn-making-of/"},{name:"v-353b78e1",path:"/blog/bdk-with-tor/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-353b78e1").then(n)}},{path:"/blog/bdk-with-tor/index.html",redirect:"/blog/bdk-with-tor/"},{path:"/_blog/bdk_with_tor.html",redirect:"/blog/bdk-with-tor/"},{name:"v-3875825f",path:"/blog/bindings-scope/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-3875825f").then(n)}},{path:"/blog/bindings-scope/index.html",redirect:"/blog/bindings-scope/"},{path:"/_blog/bindings-scope.html",redirect:"/blog/bindings-scope/"},{name:"v-07ff1843",path:"/blog/compact-filters-demo/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-07ff1843").then(n)}},{path:"/blog/compact-filters-demo/index.html",redirect:"/blog/compact-filters-demo/"},{path:"/_blog/compact_filters_demo.html",redirect:"/blog/compact-filters-demo/"},{name:"v-9504490e",path:"/blog/descriptor-based-paper-wallet/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-9504490e").then(n)}},{path:"/blog/descriptor-based-paper-wallet/index.html",redirect:"/blog/descriptor-based-paper-wallet/"},{path:"/_blog/descriptor_based_paper_wallet.html",redirect:"/blog/descriptor-based-paper-wallet/"},{name:"v-c6756cce",path:"/blog/descriptors-in-the-wild/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-c6756cce").then(n)}},{path:"/blog/descriptors-in-the-wild/index.html",redirect:"/blog/descriptors-in-the-wild/"},{path:"/_blog/descriptors_in_the_wild.html",redirect:"/blog/descriptors-in-the-wild/"},{name:"v-56536559",path:"/blog/exploring-bdk-flutter/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-56536559").then(n)}},{path:"/blog/exploring-bdk-flutter/index.html",redirect:"/blog/exploring-bdk-flutter/"},{path:"/_blog/exploring_bdk_flutter.html",redirect:"/blog/exploring-bdk-flutter/"},{name:"v-f58ec8f2",path:"/blog/exploring-bdk-rn/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-f58ec8f2").then(n)}},{path:"/blog/exploring-bdk-rn/index.html",redirect:"/blog/exploring-bdk-rn/"},{path:"/_blog/exploring_bdk_rn.html",redirect:"/blog/exploring-bdk-rn/"},{name:"v-015729b9",path:"/blog/2021/01/fee-estimation-for-light-clients-part-1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-015729b9").then(n)}},{path:"/blog/2021/01/fee-estimation-for-light-clients-part-1/index.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{path:"/_blog/fee_estimation_for_light_clients_part_1.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{name:"v-2c605799",path:"/blog/2021/01/fee-estimation-for-light-clients-part-2/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2c605799").then(n)}},{path:"/blog/2021/01/fee-estimation-for-light-clients-part-2/index.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{path:"/_blog/fee_estimation_for_light_clients_part_2.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{name:"v-57698579",path:"/blog/2021/01/fee-estimation-for-light-clients-part-3/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-57698579").then(n)}},{path:"/blog/2021/01/fee-estimation-for-light-clients-part-3/index.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{path:"/_blog/fee_estimation_for_light_clients_part_3.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{name:"v-9145467a",path:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-9145467a").then(n)}},{path:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/index.html",redirect:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{path:"/_blog/first_bdk_taproot_tx.html",redirect:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{name:"v-2cf72b39",path:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2cf72b39").then(n)}},{path:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/index.html",redirect:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{path:"/_blog/first_bdk_taproot_tx_part_2.html",redirect:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{name:"v-11d64359",path:"/blog/getting-started-with-rust-hwi/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-11d64359").then(n)}},{path:"/blog/getting-started-with-rust-hwi/index.html",redirect:"/blog/getting-started-with-rust-hwi/"},{path:"/_blog/getting_started_with_rust_hwi.html",redirect:"/blog/getting-started-with-rust-hwi/"},{name:"v-5d749fce",path:"/blog/2020/12/hello-world/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-5d749fce").then(n)}},{path:"/blog/2020/12/hello-world/index.html",redirect:"/blog/2020/12/hello-world/"},{path:"/_blog/hello-world.html",redirect:"/blog/2020/12/hello-world/"},{name:"v-ab5ba3ce",path:"/blog/hidden-power-of-bitcoin/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-ab5ba3ce").then(n)}},{path:"/blog/hidden-power-of-bitcoin/index.html",redirect:"/blog/hidden-power-of-bitcoin/"},{path:"/_blog/hidden-power-of-bitcoin.html",redirect:"/blog/hidden-power-of-bitcoin/"},{name:"v-d0375c8e",path:"/blog/improving-coin-selection-in-bdk/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-d0375c8e").then(n)}},{path:"/blog/improving-coin-selection-in-bdk/index.html",redirect:"/blog/improving-coin-selection-in-bdk/"},{path:"/_blog/improving_coin_selection_in_BDK.html",redirect:"/blog/improving-coin-selection-in-bdk/"},{name:"v-edd5570e",path:"/blog/2020/12/release-v0.2.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-edd5570e").then(n)}},{path:"/blog/2020/12/release-v0.2.0/index.html",redirect:"/blog/2020/12/release-v0.2.0/"},{path:"/_blog/release-0.2.0.html",redirect:"/blog/2020/12/release-v0.2.0/"},{name:"v-10852eea",path:"/blog/miniscript-vulnerability/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-10852eea").then(n)}},{path:"/blog/miniscript-vulnerability/index.html",redirect:"/blog/miniscript-vulnerability/"},{path:"/_blog/miniscript_vulnerability.html",redirect:"/blog/miniscript-vulnerability/"},{name:"v-05df4999",path:"/blog/2021/01/release-v0.3.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-05df4999").then(n)}},{path:"/blog/2021/01/release-v0.3.0/index.html",redirect:"/blog/2021/01/release-v0.3.0/"},{path:"/_blog/release-0.3.0.html",redirect:"/blog/2021/01/release-v0.3.0/"},{name:"v-faad828e",path:"/blog/2021/02/release-v0.4.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-faad828e").then(n)}},{path:"/blog/2021/02/release-v0.4.0/index.html",redirect:"/blog/2021/02/release-v0.4.0/"},{path:"/_blog/release-0.4.0.html",redirect:"/blog/2021/02/release-v0.4.0/"},{name:"v-0119984e",path:"/blog/2021/03/release-v0.5.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-0119984e").then(n)}},{path:"/blog/2021/03/release-v0.5.0/index.html",redirect:"/blog/2021/03/release-v0.5.0/"},{path:"/_blog/release-0.5.0.html",redirect:"/blog/2021/03/release-v0.5.0/"},{name:"v-7c3d28f9",path:"/blog/2021/04/release-v0.6.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-7c3d28f9").then(n)}},{path:"/blog/2021/04/release-v0.6.0/index.html",redirect:"/blog/2021/04/release-v0.6.0/"},{path:"/_blog/release-0.6.0.html",redirect:"/blog/2021/04/release-v0.6.0/"},{name:"v-0df1c3ce",path:"/blog/2021/05/release-v0.7.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-0df1c3ce").then(n)}},{path:"/blog/2021/05/release-v0.7.0/index.html",redirect:"/blog/2021/05/release-v0.7.0/"},{path:"/_blog/release-0.7.0.html",redirect:"/blog/2021/05/release-v0.7.0/"},{name:"v-75d11339",path:"/blog/2021/06/release-v0.8.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-75d11339").then(n)}},{path:"/blog/2021/06/release-v0.8.0/index.html",redirect:"/blog/2021/06/release-v0.8.0/"},{path:"/_blog/release-0.8.0.html",redirect:"/blog/2021/06/release-v0.8.0/"},{name:"v-1ac9ef4e",path:"/blog/2021/07/release-v0.9.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-1ac9ef4e").then(n)}},{path:"/blog/2021/07/release-v0.9.0/index.html",redirect:"/blog/2021/07/release-v0.9.0/"},{path:"/_blog/release-0.9.0.html",redirect:"/blog/2021/07/release-v0.9.0/"},{name:"v-55969f39",path:"/blog/road-to-bdk-1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-55969f39").then(n)}},{path:"/blog/road-to-bdk-1/index.html",redirect:"/blog/road-to-bdk-1/"},{path:"/_blog/road_to_bdk_1.html",redirect:"/blog/road-to-bdk-1/"},{name:"v-8534b9c2",path:"/blog/spending-policy-demo/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-8534b9c2").then(n)}},{path:"/blog/spending-policy-demo/index.html",redirect:"/blog/spending-policy-demo/"},{path:"/_blog/spending_policy_demo.html",redirect:"/blog/spending-policy-demo/"},{name:"v-aeb70fce",path:"/blog/using-bdk-with-hardware-wallets/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-aeb70fce").then(n)}},{path:"/blog/using-bdk-with-hardware-wallets/index.html",redirect:"/blog/using-bdk-with-hardware-wallets/"},{path:"/_blog/using_bdk_with_hardware_wallets.html",redirect:"/blog/using-bdk-with-hardware-wallets/"},{name:"v-4dc135e3",path:"/blog/why-bindings/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-4dc135e3").then(n)}},{path:"/blog/why-bindings/index.html",redirect:"/blog/why-bindings/"},{path:"/_blog/why-bindings.html",redirect:"/blog/why-bindings/"},{name:"v-30c0037b",path:"/adoption/custodial/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-30c0037b").then(n)}},{path:"/adoption/custodial/index.html",redirect:"/adoption/custodial/"},{path:"/adoption/custodial.html",redirect:"/adoption/custodial/"},{name:"v-4d760891",path:"/adoption/all/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4d760891").then(n)}},{path:"/adoption/all/index.html",redirect:"/adoption/all/"},{path:"/adoption/all.html",redirect:"/adoption/all/"},{name:"v-4bb7844a",path:"/adoption/desktop/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4bb7844a").then(n)}},{path:"/adoption/desktop/index.html",redirect:"/adoption/desktop/"},{path:"/adoption/desktop.html",redirect:"/adoption/desktop/"},{name:"v-b936290e",path:"/adoption/exchange/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-b936290e").then(n)}},{path:"/adoption/exchange/index.html",redirect:"/adoption/exchange/"},{path:"/adoption/exchange.html",redirect:"/adoption/exchange/"},{name:"v-7afdbb4e",path:"/adoption/hardware/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-7afdbb4e").then(n)}},{path:"/adoption/hardware/index.html",redirect:"/adoption/hardware/"},{path:"/adoption/hardware.html",redirect:"/adoption/hardware/"},{name:"v-4e0b610e",path:"/adoption/infrastructure/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4e0b610e").then(n)}},{path:"/adoption/infrastructure/index.html",redirect:"/adoption/infrastructure/"},{path:"/adoption/infrastructure.html",redirect:"/adoption/infrastructure/"},{name:"v-a7c24c4e",path:"/adoption/mobile/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-a7c24c4e").then(n)}},{path:"/adoption/mobile/index.html",redirect:"/adoption/mobile/"},{path:"/adoption/mobile.html",redirect:"/adoption/mobile/"},{name:"v-7a315e41",path:"/bdk-cli/compiler/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-7a315e41").then(n)}},{path:"/bdk-cli/compiler/index.html",redirect:"/bdk-cli/compiler/"},{path:"/bdk-cli/compiler.html",redirect:"/bdk-cli/compiler/"},{name:"v-17019aeb",path:"/adoption/web/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-17019aeb").then(n)}},{path:"/adoption/web/index.html",redirect:"/adoption/web/"},{path:"/adoption/web.html",redirect:"/adoption/web/"},{name:"v-f611a14e",path:"/bdk-cli/concept/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-f611a14e").then(n)}},{path:"/bdk-cli/concept/index.html",redirect:"/bdk-cli/concept/"},{path:"/bdk-cli/concept.html",redirect:"/bdk-cli/concept/"},{name:"v-3acb6e6a",path:"/bdk-cli/installation/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-3acb6e6a").then(n)}},{path:"/bdk-cli/installation/index.html",redirect:"/bdk-cli/installation/"},{path:"/bdk-cli/installation.html",redirect:"/bdk-cli/installation/"},{name:"v-496cb7f9",path:"/bdk-cli/interface/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-496cb7f9").then(n)}},{path:"/bdk-cli/interface/index.html",redirect:"/bdk-cli/interface/"},{path:"/bdk-cli/interface.html",redirect:"/bdk-cli/interface/"},{name:"v-0b3b65ea",path:"/bdk-cli/introduction/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-0b3b65ea").then(n)}},{path:"/bdk-cli/introduction/index.html",redirect:"/bdk-cli/introduction/"},{path:"/bdk-cli/introduction.html",redirect:"/bdk-cli/introduction/"},{name:"v-a76bccee",path:"/bdk-cli/playground/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-a76bccee").then(n)}},{path:"/bdk-cli/playground/index.html",redirect:"/bdk-cli/playground/"},{path:"/bdk-cli/playground.html",redirect:"/bdk-cli/playground/"},{name:"v-05d01c19",path:"/bdk-cli/regtest/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-05d01c19").then(n)}},{path:"/bdk-cli/regtest/index.html",redirect:"/bdk-cli/regtest/"},{path:"/bdk-cli/regtest.html",redirect:"/bdk-cli/regtest/"},{name:"v-11bf335e",path:"/case-studies/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-11bf335e").then(n)}},{path:"/case-studies/index.html",redirect:"/case-studies/"},{path:"/case-studies.html",redirect:"/case-studies/"},{name:"v-a9236c10",path:"/descriptors/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-a9236c10").then(n)}},{path:"/descriptors/index.html",redirect:"/descriptors/"},{name:"v-29f9f21c",path:"/examples/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-29f9f21c").then(n)}},{path:"/examples/index.html",redirect:"/examples/"},{name:"v-3750297a",path:"/foundation/about/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-3750297a").then(n)}},{path:"/foundation/about/index.html",redirect:"/foundation/about/"},{path:"/foundation/about.html",redirect:"/foundation/about/"},{name:"v-105750ce",path:"/foundation/grantees/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-105750ce").then(n)}},{path:"/foundation/grantees/index.html",redirect:"/foundation/grantees/"},{path:"/foundation/grantees.html",redirect:"/foundation/grantees/"},{name:"v-c152529c",path:"/foundation/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-c152529c").then(n)}},{path:"/foundation/index.html",redirect:"/foundation/"},{name:"v-50aa6d4e",path:"/foundation/supporters/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-50aa6d4e").then(n)}},{path:"/foundation/supporters/index.html",redirect:"/foundation/supporters/"},{path:"/foundation/supporters.html",redirect:"/foundation/supporters/"},{name:"v-4bcdac39",path:"/getting-started/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4bcdac39").then(n)}},{path:"/getting-started/index.html",redirect:"/getting-started/"},{path:"/getting-started.html",redirect:"/getting-started/"},{name:"v-424df898",path:"/blog/",component:Nc,beforeEnter:(t,e,n)=>{pc("IndexPost","v-424df898").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/index.html",redirect:"/blog/"},{name:"v-619df59e",path:"/blog/tags/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterKey","v-619df59e").then(n)},meta:{pid:"tags",id:"tags"}},{path:"/blog/tags/index.html",redirect:"/blog/tags/"},{name:"v-b0968728",path:"/blog/author/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterKey","v-b0968728").then(n)},meta:{pid:"author",id:"author"}},{path:"/blog/author/index.html",redirect:"/blog/author/"},{name:"v-5f2600b8",path:"/blog/tags/BDK/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f2600b8").then(n)},meta:{pid:"tags",id:"BDK"}},{path:"/blog/tags/BDK/index.html",redirect:"/blog/tags/BDK/"},{name:"v-398e8fd4",path:"/blog/tags/project/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-398e8fd4").then(n)},meta:{pid:"tags",id:"project"}},{path:"/blog/tags/project/index.html",redirect:"/blog/tags/project/"},{name:"v-da8c869a",path:"/blog/tags/tutorial/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-da8c869a").then(n)},meta:{pid:"tags",id:"tutorial"}},{path:"/blog/tags/tutorial/index.html",redirect:"/blog/tags/tutorial/"},{name:"v-62bbf2ad",path:"/blog/tags/Bitcoin Core/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-62bbf2ad").then(n)},meta:{pid:"tags",id:"Bitcoin Core"}},{path:"/blog/tags/Bitcoin Core/index.html",redirect:"/blog/tags/Bitcoin Core/"},{name:"v-5f171cb0",path:"/blog/tags/RPC/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f171cb0").then(n)},meta:{pid:"tags",id:"RPC"}},{path:"/blog/tags/RPC/index.html",redirect:"/blog/tags/RPC/"},{name:"v-4696dfd8",path:"/blog/tags/Wallet/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4696dfd8").then(n)},meta:{pid:"tags",id:"Wallet"}},{path:"/blog/tags/Wallet/index.html",redirect:"/blog/tags/Wallet/"},{name:"v-c711ccde",path:"/blog/tags/bdk-cli/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-c711ccde").then(n)},meta:{pid:"tags",id:"bdk-cli"}},{path:"/blog/tags/bdk-cli/index.html",redirect:"/blog/tags/bdk-cli/"},{name:"v-655ee4a0",path:"/blog/tags/multi-sig/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-655ee4a0").then(n)},meta:{pid:"tags",id:"multi-sig"}},{path:"/blog/tags/multi-sig/index.html",redirect:"/blog/tags/multi-sig/"},{name:"v-e646a928",path:"/blog/tags/basics/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-e646a928").then(n)},meta:{pid:"tags",id:"basics"}},{path:"/blog/tags/basics/index.html",redirect:"/blog/tags/basics/"},{name:"v-1fb58ffb",path:"/blog/tags/novice/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-1fb58ffb").then(n)},meta:{pid:"tags",id:"novice"}},{path:"/blog/tags/novice/index.html",redirect:"/blog/tags/novice/"},{name:"v-c4494744",path:"/blog/tags/architecture/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-c4494744").then(n)},meta:{pid:"tags",id:"architecture"}},{path:"/blog/tags/architecture/index.html",redirect:"/blog/tags/architecture/"},{name:"v-876cfade",path:"/blog/tags/BDK-RN/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-876cfade").then(n)},meta:{pid:"tags",id:"BDK-RN"}},{path:"/blog/tags/BDK-RN/index.html",redirect:"/blog/tags/BDK-RN/"},{name:"v-3acc51dc",path:"/blog/tags/Development/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-3acc51dc").then(n)},meta:{pid:"tags",id:"Development"}},{path:"/blog/tags/Development/index.html",redirect:"/blog/tags/Development/"},{name:"v-650ae784",path:"/blog/tags/Architecture/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-650ae784").then(n)},meta:{pid:"tags",id:"Architecture"}},{path:"/blog/tags/Architecture/index.html",redirect:"/blog/tags/Architecture/"},{name:"v-5ef73f54",path:"/blog/tags/tor/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5ef73f54").then(n)},meta:{pid:"tags",id:"tor"}},{path:"/blog/tags/tor/index.html",redirect:"/blog/tags/tor/"},{name:"v-39437010",path:"/blog/tags/wallet/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-39437010").then(n)},meta:{pid:"tags",id:"wallet"}},{path:"/blog/tags/wallet/index.html",redirect:"/blog/tags/wallet/"},{name:"v-7c8563fd",path:"/blog/tags/blockchain/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-7c8563fd").then(n)},meta:{pid:"tags",id:"blockchain"}},{path:"/blog/tags/blockchain/index.html",redirect:"/blog/tags/blockchain/"},{name:"v-1296a8fa",path:"/blog/tags/bindings/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-1296a8fa").then(n)},meta:{pid:"tags",id:"bindings"}},{path:"/blog/tags/bindings/index.html",redirect:"/blog/tags/bindings/"},{name:"v-baacba64",path:"/blog/tags/compact_filters/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-baacba64").then(n)},meta:{pid:"tags",id:"compact_filters"}},{path:"/blog/tags/compact_filters/index.html",redirect:"/blog/tags/compact_filters/"},{name:"v-75ccd5f2",path:"/blog/tags/BIP157/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-75ccd5f2").then(n)},meta:{pid:"tags",id:"BIP157"}},{path:"/blog/tags/BIP157/index.html",redirect:"/blog/tags/BIP157/"},{name:"v-4fed1c23",path:"/blog/tags/Neutrino/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4fed1c23").then(n)},meta:{pid:"tags",id:"Neutrino"}},{path:"/blog/tags/Neutrino/index.html",redirect:"/blog/tags/Neutrino/"},{name:"v-a9e0285e",path:"/blog/tags/guide/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-a9e0285e").then(n)},meta:{pid:"tags",id:"guide"}},{path:"/blog/tags/guide/index.html",redirect:"/blog/tags/guide/"},{name:"v-733ed37c",path:"/blog/tags/descriptor/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-733ed37c").then(n)},meta:{pid:"tags",id:"descriptor"}},{path:"/blog/tags/descriptor/index.html",redirect:"/blog/tags/descriptor/"},{name:"v-1144be8a",path:"/blog/tags/paper wallets/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-1144be8a").then(n)},meta:{pid:"tags",id:"paper wallets"}},{path:"/blog/tags/paper wallets/index.html",redirect:"/blog/tags/paper wallets/"},{name:"v-915f8322",path:"/blog/tags/bitcoin/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-915f8322").then(n)},meta:{pid:"tags",id:"bitcoin"}},{path:"/blog/tags/bitcoin/index.html",redirect:"/blog/tags/bitcoin/"},{name:"v-bf53d4d4",path:"/blog/tags/React Native/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-bf53d4d4").then(n)},meta:{pid:"tags",id:"React Native"}},{path:"/blog/tags/React Native/index.html",redirect:"/blog/tags/React Native/"},{name:"v-07eeb15e",path:"/blog/tags/Flutter/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-07eeb15e").then(n)},meta:{pid:"tags",id:"Flutter"}},{path:"/blog/tags/Flutter/index.html",redirect:"/blog/tags/Flutter/"},{name:"v-5f023740",path:"/blog/tags/iOS/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f023740").then(n)},meta:{pid:"tags",id:"iOS"}},{path:"/blog/tags/iOS/index.html",redirect:"/blog/tags/iOS/"},{name:"v-414e735e",path:"/blog/tags/Android/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-414e735e").then(n)},meta:{pid:"tags",id:"Android"}},{path:"/blog/tags/Android/index.html",redirect:"/blog/tags/Android/"},{name:"v-2c94bf22",path:"/blog/tags/mobile/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-2c94bf22").then(n)},meta:{pid:"tags",id:"mobile"}},{path:"/blog/tags/mobile/index.html",redirect:"/blog/tags/mobile/"},{name:"v-dd212a9e",path:"/blog/tags/bdk-rn/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-dd212a9e").then(n)},meta:{pid:"tags",id:"bdk-rn"}},{path:"/blog/tags/bdk-rn/index.html",redirect:"/blog/tags/bdk-rn/"},{name:"v-5f07f0f8",path:"/blog/tags/bdk/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f07f0f8").then(n)},meta:{pid:"tags",id:"bdk"}},{path:"/blog/tags/bdk/index.html",redirect:"/blog/tags/bdk/"},{name:"v-5f0447f2",path:"/blog/tags/fee/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f0447f2").then(n)},meta:{pid:"tags",id:"fee"}},{path:"/blog/tags/fee/index.html",redirect:"/blog/tags/fee/"},{name:"v-e2317b12",path:"/blog/tags/machine learning/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-e2317b12").then(n)},meta:{pid:"tags",id:"machine learning"}},{path:"/blog/tags/machine learning/index.html",redirect:"/blog/tags/machine learning/"},{name:"v-57f3a168",path:"/blog/tags/taproot/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-57f3a168").then(n)},meta:{pid:"tags",id:"taproot"}},{path:"/blog/tags/taproot/index.html",redirect:"/blog/tags/taproot/"},{name:"v-ef7c3fa2",path:"/blog/tags/miniscript/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-ef7c3fa2").then(n)},meta:{pid:"tags",id:"miniscript"}},{path:"/blog/tags/miniscript/index.html",redirect:"/blog/tags/miniscript/"},{name:"v-640144b2",path:"/blog/tags/Hardware Wallets/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-640144b2").then(n)},meta:{pid:"tags",id:"Hardware Wallets"}},{path:"/blog/tags/Hardware Wallets/index.html",redirect:"/blog/tags/Hardware Wallets/"},{name:"v-79c3de4b",path:"/blog/tags/getting started/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-79c3de4b").then(n)},meta:{pid:"tags",id:"getting started"}},{path:"/blog/tags/getting started/index.html",redirect:"/blog/tags/getting started/"},{name:"v-3fee41ed",path:"/blog/tags/rust/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-3fee41ed").then(n)},meta:{pid:"tags",id:"rust"}},{path:"/blog/tags/rust/index.html",redirect:"/blog/tags/rust/"},{name:"v-01a03a08",path:"/blog/tags/bitcoin-cli/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-01a03a08").then(n)},meta:{pid:"tags",id:"bitcoin-cli"}},{path:"/blog/tags/bitcoin-cli/index.html",redirect:"/blog/tags/bitcoin-cli/"},{name:"v-74edfe92",path:"/blog/tags/coin selection/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-74edfe92").then(n)},meta:{pid:"tags",id:"coin selection"}},{path:"/blog/tags/coin selection/index.html",redirect:"/blog/tags/coin selection/"},{name:"v-4e62fa1c",path:"/blog/tags/development/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4e62fa1c").then(n)},meta:{pid:"tags",id:"development"}},{path:"/blog/tags/development/index.html",redirect:"/blog/tags/development/"},{name:"v-0159a747",path:"/blog/tags/summer of bitcoin/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-0159a747").then(n)},meta:{pid:"tags",id:"summer of bitcoin"}},{path:"/blog/tags/summer of bitcoin/index.html",redirect:"/blog/tags/summer of bitcoin/"},{name:"v-543950a6",path:"/blog/tags/release/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-543950a6").then(n)},meta:{pid:"tags",id:"release"}},{path:"/blog/tags/release/index.html",redirect:"/blog/tags/release/"},{name:"v-0755ed11",path:"/blog/tags/security/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-0755ed11").then(n)},meta:{pid:"tags",id:"security"}},{path:"/blog/tags/security/index.html",redirect:"/blog/tags/security/"},{name:"v-a354115e",path:"/blog/author/Steve Myers/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-a354115e").then(n)},meta:{pid:"author",id:"Steve Myers"}},{path:"/blog/author/Steve Myers/index.html",redirect:"/blog/author/Steve Myers/"},{name:"v-22d0e252",path:"/blog/author/Daniela Brozzoni/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-22d0e252").then(n)},meta:{pid:"author",id:"Daniela Brozzoni"}},{path:"/blog/author/Daniela Brozzoni/index.html",redirect:"/blog/author/Daniela Brozzoni/"},{name:"v-82e16b5c",path:"/blog/author/Rajarshi Maitra/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-82e16b5c").then(n)},meta:{pid:"author",id:"Rajarshi Maitra"}},{path:"/blog/author/Rajarshi Maitra/index.html",redirect:"/blog/author/Rajarshi Maitra/"},{name:"v-3e6950f4",path:"/blog/author/waterst0ne/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-3e6950f4").then(n)},meta:{pid:"author",id:"waterst0ne"}},{path:"/blog/author/waterst0ne/index.html",redirect:"/blog/author/waterst0ne/"},{name:"v-600b5b28",path:"/blog/author/Lloyd Fournier/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-600b5b28").then(n)},meta:{pid:"author",id:"Lloyd Fournier"}},{path:"/blog/author/Lloyd Fournier/index.html",redirect:"/blog/author/Lloyd Fournier/"},{name:"v-37829241",path:"/blog/author/Bitcoin Zavior/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-37829241").then(n)},meta:{pid:"author",id:"Bitcoin Zavior"}},{path:"/blog/author/Bitcoin Zavior/index.html",redirect:"/blog/author/Bitcoin Zavior/"},{name:"v-d2b26530",path:"/blog/author/rorp/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-d2b26530").then(n)},meta:{pid:"author",id:"rorp"}},{path:"/blog/author/rorp/index.html",redirect:"/blog/author/rorp/"},{name:"v-5d54001e",path:"/blog/author/thunderbiscuit/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5d54001e").then(n)},meta:{pid:"author",id:"thunderbiscuit"}},{path:"/blog/author/thunderbiscuit/index.html",redirect:"/blog/author/thunderbiscuit/"},{name:"v-624fd61e",path:"/blog/author/Riccardo Casatta/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-624fd61e").then(n)},meta:{pid:"author",id:"Riccardo Casatta"}},{path:"/blog/author/Riccardo Casatta/index.html",redirect:"/blog/author/Riccardo Casatta/"},{name:"v-6b564fb4",path:"/blog/author/Gabriele Domenichini/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-6b564fb4").then(n)},meta:{pid:"author",id:"Gabriele Domenichini"}},{path:"/blog/author/Gabriele Domenichini/index.html",redirect:"/blog/author/Gabriele Domenichini/"},{name:"v-ad00c09c",path:"/blog/author/Alekos Filini/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-ad00c09c").then(n)},meta:{pid:"author",id:"Alekos Filini"}},{path:"/blog/author/Alekos Filini/index.html",redirect:"/blog/author/Alekos Filini/"},{name:"v-4eeab648",path:"/blog/author/Wszdexdrf/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4eeab648").then(n)},meta:{pid:"author",id:"Wszdexdrf"}},{path:"/blog/author/Wszdexdrf/index.html",redirect:"/blog/author/Wszdexdrf/"},{name:"v-91c10894",path:"/blog/author/Sandipan Dey/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-91c10894").then(n)},meta:{pid:"author",id:"Sandipan Dey"}},{path:"/blog/author/Sandipan Dey/index.html",redirect:"/blog/author/Sandipan Dey/"},{name:"v-a0d840b0",path:"/blog/author/César Alvarez Vallero/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-a0d840b0").then(n)},meta:{pid:"author",id:"César Alvarez Vallero"}},{path:"/blog/author/César Alvarez Vallero/index.html",redirect:"/blog/author/César Alvarez Vallero/"},{name:"v-c3507bb6",path:"/blog/page/2/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-c3507bb6").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/page/2/index.html",redirect:"/blog/page/2/"},{name:"v-c3507b78",path:"/blog/page/3/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-c3507b78").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/page/3/index.html",redirect:"/blog/page/3/"},{name:"v-c3507b3a",path:"/blog/page/4/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-c3507b3a").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/page/4/index.html",redirect:"/blog/page/4/"},{name:"v-5f2ac9cb",path:"/blog/author/Alekos Filini/page/2/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-5f2ac9cb").then(n)},meta:{pid:"author",id:"Alekos Filini"}},{path:"/blog/author/Alekos Filini/page/2/index.html",redirect:"/blog/author/Alekos Filini/page/2/"},{path:"*",component:Nc}],zc={title:"Bitcoin Dev Kit Documentation",description:"The Bitcoin Dev Kit (BDK) project (originally called Magical Bitcoin 🧙) aims to build a collection of tools and libraries that are designed to be a solid foundation for cross platform Bitcoin wallets, along with a fully working reference implementation wallet called Magical Bitcoin.",base:"/",headTags:[["meta",{name:"viewport",content:"width=device-width,initial-scale=1.0"}],["link",{rel:"preload",href:"/fonts/ibm-plex-mono-400.woff2",as:"font",crossorigin:!0}],["link",{rel:"apple-touch-icon",sizes:"180x180",href:"/img/favicon/apple-touch-icon.png"}],["link",{rel:"manifest",href:"/site.webmanifest"}],["link",{rel:"stylesheet",href:"/css/variables.css"}],["link",{name:"msapplication-config",content:"/browserconfig.xml"}],["link",{name:"msapplication-TileColor",content:"#ffffff"}],["link",{name:"theme-color",content:"#ffffff"}]],pages:[{title:"Home",frontmatter:{home:!0,heroText:"Bitcoin Dev Kit",tagline:"With BDK, you can seamlessly build cross platform mobile wallets",actionText:"Get started",actionLink:"/getting-started/",features:[{title:"Customizable",details:"Designed from the ground up to be easily customized to your application needs: blockchain backends, databases, signers, coin selection, key management and more.",image:"customizable"},{title:"Focus on what matters",details:"All of the low-level Bitcoin logic is handled by us, so you can focus on crafting custom-tailored user experiences.",image:"focus"},{title:"High performance & compact",details:"As lightweight as you need it to be and optimized to run on all modern-day embedded devices such as mobile phones, IoT devices, PoS terminals and more.",image:"mobile"}],meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"With BDK, you can seamlessly build cross platform mobile wallets"},{property:"og:description",content:"We are building native API's for C, Swift, Java & Kotlin so you can easily integrate Bitcoin in your preferred programming language on mobile."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"With BDK, you can seamlessly build cross platform mobile wallets"},{name:"twitter:description",content:"We are building native API's for C, Swift, Java & Kotlin so you can easily integrate Bitcoin in your preferred programming language on mobile."},{name:"twitter:url",content:"https://bitcoindevkit.org/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/",relativePath:"README.md",key:"v-330a32a2",path:"/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"2023 Q4 Project Update",frontmatter:{title:"2023 Q4 Project Update",description:"2023 Q4 update on the BDK project's progress.",authors:["Steve Myers","Daniela Brozzoni"],date:"2024-02-20",tags:["BDK","project"],draft:!1,meta:[{property:"article:published_time",content:"2024-02-20T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"2023 Q4 Project Update"},{property:"og:description",content:"2023 Q4 update on the BDK project's progress."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/2023_q4_update/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"2023 Q4 Project Update"},{name:"twitter:description",content:"2023 Q4 update on the BDK project's progress."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/2023_q4_update/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, project"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"project"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/2023_q4_update.html",relativePath:"_blog/2023_q4_update.md",key:"v-2c450c3f",path:"/blog/_2023-q4-update/",headers:[{level:3,title:"This Post",slug:"this-post"},{level:3,title:"End of Year Review",slug:"end-of-year-review"},{level:3,title:"Core BDK",slug:"core-bdk"},{level:3,title:"BDK-FFI",slug:"bdk-ffi"},{level:3,title:"BDK contributors spotlight",slug:"bdk-contributors-spotlight"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"2024 Q1 Project Update",frontmatter:{title:"2024 Q1 Project Update",description:"2024 Q1 update on the BDK project's progress.",authors:["Steve Myers"],date:"2024-03-21",tags:["BDK","project"],draft:!1,meta:[{property:"article:published_time",content:"2024-03-21T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"2024 Q1 Project Update"},{property:"og:description",content:"2024 Q1 update on the BDK project's progress."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/2024_q1_update/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"2024 Q1 Project Update"},{name:"twitter:description",content:"2024 Q1 update on the BDK project's progress."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/2024_q1_update/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, project"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"project"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/2024_q1_update.html",relativePath:"_blog/2024_q1_update.md",key:"v-5e744cf7",path:"/blog/_2024-q1-update/",headers:[{level:3,title:"Core BDK",slug:"core-bdk"},{level:3,title:"BDK-FFI",slug:"bdk-ffi"},{level:3,title:"Plans for Next Quarter",slug:"plans-for-next-quarter"},{level:3,title:"BDK contributors spotlight",slug:"bdk-contributors-spotlight"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"BDK wallet with Bitcoin core RPC",frontmatter:{title:"BDK wallet with Bitcoin core RPC ",description:"Tutorial showing usage of Bitcoin core backend with BDK wallet",authors:["Rajarshi Maitra"],date:"2021-08-21",tags:["tutorial","BDK","Bitcoin Core","RPC","Wallet"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2021-08-21T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK wallet with Bitcoin core RPC"},{property:"og:description",content:"Tutorial showing usage of Bitcoin core backend with BDK wallet"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/Bitcoin_Core_RPC_Demo/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK wallet with Bitcoin core RPC"},{name:"twitter:description",content:"Tutorial showing usage of Bitcoin core backend with BDK wallet"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/Bitcoin_Core_RPC_Demo/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, BDK, Bitcoin Core, RPC, Wallet"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"Bitcoin Core"},{property:"article:tag",content:"RPC"},{property:"article:tag",content:"Wallet"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/Bitcoin_Core_RPC_Demo.html",relativePath:"_blog/Bitcoin_Core_RPC_Demo.md",key:"v-7c0c45f9",path:"/blog/bitcoin-core-rpc-demo/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisite",slug:"prerequisite"},{level:2,title:"Setting Up",slug:"setting-up"},{level:2,title:"Setting dependencies",slug:"setting-dependencies"},{level:2,title:"Getting Descriptors",slug:"getting-descriptors"},{level:2,title:"Talking to Bitcoin Core Programmatically",slug:"talking-to-bitcoin-core-programmatically"},{level:2,title:"Get some balance in core wallet.",slug:"get-some-balance-in-core-wallet"},{level:2,title:"Setup the BDK wallet",slug:"setup-the-bdk-wallet"},{level:2,title:"Sending Sats Around",slug:"sending-sats-around"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"bdk-cli basics multi-sig 2 of 3 tutorial",frontmatter:{title:"bdk-cli basics multi-sig 2 of 3 tutorial",description:"Tutorial using command-line to create a 2 of 3 multi-sig Wallet and Spend",authors:["waterst0ne"],date:"2022-10-17",tags:["tutorial","bdk-cli","multi-sig"],hidden:!1,draft:!1,meta:[{property:"article:published_time",content:"2022-10-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"bdk-cli basics multi-sig 2 of 3 tutorial"},{property:"og:description",content:"Tutorial using command-line to create a 2 of 3 multi-sig Wallet and Spend"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk-cli_basics_multisig_2of3/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"bdk-cli basics multi-sig 2 of 3 tutorial"},{name:"twitter:description",content:"Tutorial using command-line to create a 2 of 3 multi-sig Wallet and Spend"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk-cli_basics_multisig_2of3/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, bdk-cli, multi-sig"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"multi-sig"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk-cli_basics_multisig_2of3.html",relativePath:"_blog/bdk-cli_basics_multisig_2of3.md",key:"v-8bd632d6",path:"/blog/bdk-cli-basics-multisig-2of3/",headers:[{level:2,title:"2-of-3 Multi-Signature Descriptor Wallet using bdk-cli",slug:"2-of-3-multi-signature-descriptor-wallet-using-bdk-cli"},{level:2,title:"Overview of the tutorial",slug:"overview-of-the-tutorial"},{level:2,title:"Step 1: Generate the XPRVs (Extended-Keys) and Save to environment variables",slug:"step-1-generate-the-xprvs-extended-keys-and-save-to-environment-variables"},{level:3,title:"1a: Verify XPRV environment variables are Active",slug:"1a-verify-xprv-environment-variables-are-active"},{level:2,title:"Step 2: Generate XPUBs (Extended Public Keys) & Save to environment variables",slug:"step-2-generate-xpubs-extended-public-keys-save-to-environment-variables"},{level:3,title:"2a: Verify XPUB environment variables",slug:"2a-verify-xpub-environment-variables"},{level:2,title:"Step 3: Create Single-Wallet Descriptors",slug:"step-3-create-single-wallet-descriptors"},{level:2,title:"Step 4: Create Multi-Sig-Descriptor Wallets",slug:"step-4-create-multi-sig-descriptor-wallets"},{level:3,title:"4a: Verify Multi-Sig-Descriptor environment variables are active",slug:"4a-verify-multi-sig-descriptor-environment-variables-are-active"},{level:2,title:"Step 5: Generate Receive Address by using Multi-Sig-Descriptor Wallets",slug:"step-5-generate-receive-address-by-using-multi-sig-descriptor-wallets"},{level:2,title:"Step 6: Send Testnet Bitcoin to the newly created receive-address",slug:"step-6-send-testnet-bitcoin-to-the-newly-created-receive-address"},{level:2,title:"Step 7: Sync one of the Multi-Sig Wallets",slug:"step-7-sync-one-of-the-multi-sig-wallets"},{level:2,title:"Step 8: Check Balance Multi-Sig Wallets",slug:"step-8-check-balance-multi-sig-wallets"},{level:2,title:"Step 9: Check Multi-Sig Policies on Descriptor Wallet",slug:"step-9-check-multi-sig-policies-on-descriptor-wallet"},{level:3,title:"SpendingPolicyRequired for complex descriptors",slug:"spendingpolicyrequired-for-complex-descriptors"},{level:2,title:"Step 10: Create a Transaction (PSBT)",slug:"step-10-create-a-transaction-psbt"},{level:3,title:"Export UNSIGNED_PSBT to environment variable",slug:"export-unsigned-psbt-to-environment-variable"},{level:3,title:"Verify UNSIGNED_PSBT environment variable",slug:"verify-unsigned-psbt-environment-variable"},{level:2,title:"Step 11: SIGN the Transaction",slug:"step-11-sign-the-transaction"},{level:3,title:"1st Wallet Signs the transaction",slug:"1st-wallet-signs-the-transaction"},{level:3,title:"2nd Wallet Signs the transaction",slug:"2nd-wallet-signs-the-transaction"},{level:2,title:"Step 12: Broadcast Transaction",slug:"step-12-broadcast-transaction"},{level:3,title:"Verify Transaction",slug:"verify-transaction"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Command Line introduction to Bitcoin Wallet Development using bdk-cli",frontmatter:{title:"Command Line introduction to Bitcoin Wallet Development using bdk-cli",description:"Intro to bdk-cli and wallet dev",authors:["waterst0ne"],date:"2022-09-22",tags:["bdk-cli","basics","novice"],meta:[{property:"article:published_time",content:"2022-09-22T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Command Line introduction to Bitcoin Wallet Development using bdk-cli"},{property:"og:description",content:"Intro to bdk-cli and wallet dev"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_cli_basics/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Command Line introduction to Bitcoin Wallet Development using bdk-cli"},{name:"twitter:description",content:"Intro to bdk-cli and wallet dev"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_cli_basics/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bdk-cli, basics, novice"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"basics"},{property:"article:tag",content:"novice"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_cli_basics.html",relativePath:"_blog/bdk_cli_basics.md",key:"v-0f4d5d15",path:"/blog/bdk-cli-basics/",headers:[{level:2,title:"Tutorial Goals",slug:"tutorial-goals"},{level:2,title:"A few things before you begin:",slug:"a-few-things-before-you-begin"},{level:3,title:"Outline of Tutorial and Installation notes:",slug:"outline-of-tutorial-and-installation-notes"},{level:3,title:"Brief Outline of Tutorial",slug:"brief-outline-of-tutorial"},{level:3,title:"Rust and Cargo installation:",slug:"rust-and-cargo-installation"},{level:3,title:"bdk-cli installation:",slug:"bdk-cli-installation"},{level:3,title:"Emoji Legend:",slug:"emoji-legend"},{level:2,title:"Step 0: Check Version of bdk-cli",slug:"step-0-check-version-of-bdk-cli"},{level:3,title:"Preview of bdk-cli help menu",slug:"preview-of-bdk-cli-help-menu"},{level:2,title:"Step 1: Seed Generate",slug:"step-1-seed-generate"},{level:3,title:"1a: Mnemonic word-list + XPRV (Extended Private Key) :key:",slug:"1a-mnemonic-word-list-xprv-extended-private-key-"},{level:3,title:"1b: Save XPRV (Extended Private Key) into environment variable",slug:"1b-save-xprv-extended-private-key-into-environment-variable"},{level:3,title:"1c: Verify environment variable XPRV_00 is active",slug:"1c-verify-environment-variable-xprv-00-is-active"},{level:3,title:"1d: Create Descriptor and Save into environment variable",slug:"1d-create-descriptor-and-save-into-environment-variable"},{level:3,title:"1e: Verify environment variable my_descriptor is active",slug:"1e-verify-environment-variable-my-descriptor-is-active"},{level:2,title:"Step 2: Generate Receive-Address",slug:"step-2-generate-receive-address"},{level:2,title:"Step 3: Send testnet bitcoin to the newly created receive-address",slug:"step-3-send-testnet-bitcoin-to-the-newly-created-receive-address"},{level:2,title:"Step 4: Sync the wallet",slug:"step-4-sync-the-wallet"},{level:2,title:"Step 5: Check the balance",slug:"step-5-check-the-balance"},{level:2,title:"Step 6: Create Transaction (PSBT)",slug:"step-6-create-transaction-psbt"},{level:3,title:"6a: export PSBT to environment-variable",slug:"6a-export-psbt-to-environment-variable"},{level:2,title:"Step 7: Sign Transaction (PSBT)",slug:"step-7-sign-transaction-psbt"},{level:3,title:"7a: export signed psbt to environment variable",slug:"7a-export-signed-psbt-to-environment-variable"},{level:2,title:"Step 8: Broadcast Transaction",slug:"step-8-broadcast-transaction"},{level:2,title:"Resources",slug:"resources"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"bdk_core: a new architecture for the Bitcoin Dev Kit",frontmatter:{title:"`bdk_core`: a new architecture for the Bitcoin Dev Kit",description:"A new architecture for the Bitcoin Dev Kit",authors:["Lloyd Fournier"],date:"2022-05-09",tags:["architecture"],draft:!1,meta:[{property:"article:published_time",content:"2022-05-09T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"bdk_core: a new architecture for the Bitcoin Dev Kit"},{property:"og:description",content:"A new architecture for the Bitcoin Dev Kit"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_core_pt1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"bdk_core: a new architecture for the Bitcoin Dev Kit"},{name:"twitter:description",content:"A new architecture for the Bitcoin Dev Kit"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_core_pt1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"architecture"},{property:"article:tag",content:"architecture"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_core_pt1.html",relativePath:"_blog/bdk_core_pt1.md",key:"v-2cebe183",path:"/blog/bdk-core-pt1/",headers:[{level:2,title:"The separation of policy and mechanism",slug:"the-separation-of-policy-and-mechanism"},{level:2,title:"A syncing mechansim without the policy",slug:"a-syncing-mechansim-without-the-policy"},{level:3,title:"A general syncing mechanism",slug:"a-general-syncing-mechanism"},{level:3,title:"How to store and index transactions",slug:"how-to-store-and-index-transactions"},{level:3,title:"Rolling back, rolling forward and syncing to disk",slug:"rolling-back-rolling-forward-and-syncing-to-disk"},{level:2,title:"Examples",slug:"examples"},{level:3,title:"Doing an initial sync of a descriptor that may already contain coins",slug:"doing-an-initial-sync-of-a-descriptor-that-may-already-contain-coins"},{level:3,title:"Doing a sync of a wallet after you already have sync'd",slug:"doing-a-sync-of-a-wallet-after-you-already-have-syncd"},{level:3,title:"Updating state when you get the data in real time",slug:"updating-state-when-you-get-the-data-in-real-time"},{level:2,title:"Feedback",slug:"feedback"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"bdk-rn: Behind the scenes",frontmatter:{title:"`bdk-rn`: Behind the scenes",description:"bdk-rn: React Native version of BitcoinDevKit. Insight into how bdk-rn was developed",authors:["Bitcoin Zavior"],date:"2022-07-10",tags:["BDK-RN","Development","Architecture"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-07-10T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"bdk-rn: Behind the scenes"},{property:"og:description",content:"bdk-rn: React Native version of BitcoinDevKit. Insight into how bdk-rn was developed"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_rn_making_of/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"bdk-rn: Behind the scenes"},{name:"twitter:description",content:"bdk-rn: React Native version of BitcoinDevKit. Insight into how bdk-rn was developed"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_rn_making_of/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK-RN, Development, Architecture"},{property:"article:tag",content:"BDK-RN"},{property:"article:tag",content:"Development"},{property:"article:tag",content:"Architecture"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_rn_making_of.html",relativePath:"_blog/bdk_rn_making_of.md",key:"v-3eaa044d",path:"/blog/bdk-rn-making-of/",headers:[{level:2,title:"React Native Architecture",slug:"react-native-architecture"},{level:2,title:"Native Integration",slug:"native-integration"},{level:2,title:"Android Module",slug:"android-module"},{level:2,title:"References",slug:"references"},{level:2,title:"Feedback",slug:"feedback"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Using BDK with Tor",frontmatter:{title:"Using BDK with Tor",description:"How to integrate Tor client to sync BDK wallet with tor enabled blockchain service",authors:["rorp"],date:"2023-01-03",tags:["tutorial","tor","wallet","blockchain"],meta:[{property:"article:published_time",content:"2023-01-03T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Using BDK with Tor"},{property:"og:description",content:"How to integrate Tor client to sync BDK wallet with tor enabled blockchain service"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_with_tor/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Using BDK with Tor"},{name:"twitter:description",content:"How to integrate Tor client to sync BDK wallet with tor enabled blockchain service"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_with_tor/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, tor, wallet, blockchain"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"tor"},{property:"article:tag",content:"wallet"},{property:"article:tag",content:"blockchain"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_with_tor.html",relativePath:"_blog/bdk_with_tor.md",key:"v-353b78e1",path:"/blog/bdk-with-tor/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisite",slug:"prerequisite"},{level:2,title:"Setting Up",slug:"setting-up"},{level:2,title:"ElectrumBlockchain",slug:"electrumblockchain"},{level:2,title:"Blocking EsploraBlockchain",slug:"blocking-esplorablockchain"},{level:2,title:"Asynchronous EsploraBlockchain",slug:"asynchronous-esplorablockchain"},{level:2,title:"CompactFiltersBlockchain",slug:"compactfiltersblockchain"},{level:2,title:"Integrated Tor daemon",slug:"integrated-tor-daemon"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"BDK's Scope and Approach to Rust Bindings",frontmatter:{title:"BDK's Scope and Approach to Rust Bindings",description:"An outline of BDK's approach to language bindings and how we intend on supporting others build their own.",authors:["thunderbiscuit"],date:"2023-06-02",tags:["BDK","bindings"],meta:[{property:"article:published_time",content:"2023-06-02T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK's Scope and Approach to Rust Bindings"},{property:"og:description",content:"An outline of BDK's approach to language bindings and how we intend on supporting others build their own."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bindings-scope/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK's Scope and Approach to Rust Bindings"},{name:"twitter:description",content:"An outline of BDK's approach to language bindings and how we intend on supporting others build their own."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bindings-scope/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, bindings"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"bindings"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bindings-scope.html",relativePath:"_blog/bindings-scope.md",key:"v-3875825f",path:"/blog/bindings-scope/",headers:[{level:2,title:"Current architecture",slug:"current-architecture"},{level:2,title:"Moving forward: building a family of libraries",slug:"moving-forward-building-a-family-of-libraries"},{level:2,title:"Why can't we just build one big BDK library with everything in it?",slug:"why-cant-we-just-build-one-big-bdk-library-with-everything-in-it"},{level:2,title:"Are you looking to build Rust bindings yourself?",slug:"are-you-looking-to-build-rust-bindings-yourself"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"BDK wallet as a BIP157 SPV light client",frontmatter:{title:"BDK wallet as a BIP157 SPV light client",description:"Tutorial showing usage of compact filters (BIP157) using bdk-cli command line tools",authors:["Rajarshi Maitra"],date:"2021-06-20",tags:["tutorial","BDK","bdk-cli","compact_filters","BIP157","Neutrino"],meta:[{property:"article:published_time",content:"2021-06-20T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK wallet as a BIP157 SPV light client"},{property:"og:description",content:"Tutorial showing usage of compact filters (BIP157) using bdk-cli command line tools"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/compact_filters_demo/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK wallet as a BIP157 SPV light client"},{name:"twitter:description",content:"Tutorial showing usage of compact filters (BIP157) using bdk-cli command line tools"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/compact_filters_demo/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, BDK, bdk-cli, compact_filters, BIP157, Neutrino"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"compact_filters"},{property:"article:tag",content:"BIP157"},{property:"article:tag",content:"Neutrino"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/compact_filters_demo.html",relativePath:"_blog/compact_filters_demo.md",key:"v-07ff1843",path:"/blog/compact-filters-demo/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Compact Filters:",slug:"compact-filters"},{level:3,title:"BDK and Compact filters",slug:"bdk-and-compact-filters"},{level:3,title:"bdk-cli",slug:"bdk-cli"},{level:2,title:"Tutorial Scope",slug:"tutorial-scope"},{level:2,title:"Prerequisites",slug:"prerequisites"},{level:3,title:"Install and run bitcoind",slug:"install-and-run-bitcoind"},{level:3,title:"Install and run bdk-cli",slug:"install-and-run-bdk-cli"},{level:2,title:"Tutorial",slug:"tutorial"},{level:3,title:"Bitcoin Core Wallet Generation",slug:"bitcoin-core-wallet-generation"},{level:3,title:"BDK Wallet Generation",slug:"bdk-wallet-generation"},{level:3,title:"Recieve Coins",slug:"recieve-coins"},{level:3,title:"Creating a transaction.",slug:"creating-a-transaction"},{level:3,title:"Sign and Broadcast the transaction",slug:"sign-and-broadcast-the-transaction"},{level:3,title:"Confirming the Transaction",slug:"confirming-the-transaction"},{level:3,title:"Shutdown Docker",slug:"shutdown-docker"},{level:2,title:"End Words",slug:"end-words"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Making Descriptor-based paper wallets",frontmatter:{title:"Making Descriptor-based paper wallets",description:"Demonstrate how to create descriptor-based paper wallet and how to spend them with bdk",authors:["Riccardo Casatta","Steve Myers"],date:"2021-03-30",tags:["guide","descriptor","paper wallets"],meta:[{property:"article:published_time",content:"2021-03-30T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Making Descriptor-based paper wallets"},{property:"og:description",content:"Demonstrate how to create descriptor-based paper wallet and how to spend them with bdk"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/descriptor_based_paper_wallet/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Making Descriptor-based paper wallets"},{name:"twitter:description",content:"Demonstrate how to create descriptor-based paper wallet and how to spend them with bdk"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/descriptor_based_paper_wallet/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"guide, descriptor, paper wallets"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"descriptor"},{property:"article:tag",content:"paper wallets"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/descriptor_based_paper_wallet.html",relativePath:"_blog/descriptor_based_paper_wallet.md",key:"v-9504490e",path:"/blog/descriptor-based-paper-wallet/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"About paper wallets",slug:"about-paper-wallets"},{level:2,title:"Descriptors",slug:"descriptors"},{level:2,title:"Example use case",slug:"example-use-case"},{level:2,title:"Creating the paper wallet",slug:"creating-the-paper-wallet"},{level:2,title:"BDK",slug:"bdk"},{level:2,title:"Funding tx",slug:"funding-tx"},{level:2,title:"Sweep tx",slug:"sweep-tx"},{level:3,title:"Step 1: Alice creates and signs a PSBT",slug:"step-1-alice-creates-and-signs-a-psbt"},{level:3,title:"Step 2: Barbara signs Alice's signed PSBT and broadcasts the tx",slug:"step-2-barbara-signs-alices-signed-psbt-and-broadcasts-the-tx"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"A Multisig between BDK and Core",frontmatter:{title:"A Multisig between BDK and Core",description:"Guide to setup a 2-of-2 multisig using Bitcoin Core and BDK",authors:["Gabriele Domenichini"],date:"2020-11-18",tags:["guide","descriptor"],meta:[{property:"article:published_time",content:"2020-11-18T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"A Multisig between BDK and Core"},{property:"og:description",content:"Guide to setup a 2-of-2 multisig using Bitcoin Core and BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/descriptors_in_the_wild/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"A Multisig between BDK and Core"},{name:"twitter:description",content:"Guide to setup a 2-of-2 multisig using Bitcoin Core and BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/descriptors_in_the_wild/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"guide, descriptor"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"descriptor"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/descriptors_in_the_wild.html",relativePath:"_blog/descriptors_in_the_wild.md",key:"v-c6756cce",path:"/blog/descriptors-in-the-wild/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"The use case",slug:"the-use-case"},{level:2,title:"The role of Descriptors",slug:"the-role-of-descriptors"},{level:2,title:"Our playground",slug:"our-playground"},{level:3,title:"1. Creating the seeds and the derived Extended Public keys",slug:"1-creating-the-seeds-and-the-derived-extended-public-keys"},{level:3,title:"2. Creation of the multi signature descriptor for each wallet",slug:"2-creation-of-the-multi-signature-descriptor-for-each-wallet"},{level:3,title:"3. Use each other's software to receive testnet coins from a faucet",slug:"3-use-each-others-software-to-receive-testnet-coins-from-a-faucet"},{level:3,title:"4. we return part of the satoshis received back to the faucet",slug:"4-we-return-part-of-the-satoshis-received-back-to-the-faucet"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"BDK-FLUTTER: Building Flutter Apps with BDK",frontmatter:{title:"BDK-FLUTTER: Building Flutter Apps with BDK",description:"A tutorial and guide to using bdk-flutter for building bitcoin apps",authors:["Bitcoin Zavior"],date:"2022-10-05",tags:["bitcoin","React Native","Flutter","iOS","Android","mobile","bdk-rn","bdk","tutorial","guide","wallet"],meta:[{property:"article:published_time",content:"2022-10-05T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK-FLUTTER: Building Flutter Apps with BDK"},{property:"og:description",content:"A tutorial and guide to using bdk-flutter for building bitcoin apps"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_flutter/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK-FLUTTER: Building Flutter Apps with BDK"},{name:"twitter:description",content:"A tutorial and guide to using bdk-flutter for building bitcoin apps"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_flutter/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bitcoin, React Native, Flutter, iOS, Android, mobile, bdk-rn, bdk, tutorial, guide, wallet"},{property:"article:tag",content:"bitcoin"},{property:"article:tag",content:"React Native"},{property:"article:tag",content:"Flutter"},{property:"article:tag",content:"iOS"},{property:"article:tag",content:"Android"},{property:"article:tag",content:"mobile"},{property:"article:tag",content:"bdk-rn"},{property:"article:tag",content:"bdk"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"wallet"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/exploring_bdk_flutter.html",relativePath:"_blog/exploring_bdk_flutter.md",key:"v-56536559",path:"/blog/exploring-bdk-flutter/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Prerequisites",slug:"prerequisites"},{level:3,title:"Bitcoin Basics",slug:"bitcoin-basics"},{level:2,title:"Bitcoin Dev Kit and bdk-flutter",slug:"bitcoin-dev-kit-and-bdk-flutter"},{level:2,title:"Getting Started",slug:"getting-started"},{level:2,title:"Setting up Flutter app structure",slug:"setting-up-flutter-app-structure"},{level:2,title:"Installing bdk-flutter",slug:"installing-bdk-flutter"},{level:2,title:"Configuring",slug:"configuring"},{level:2,title:"Importing bdk-flutter",slug:"importing-bdk-flutter"},{level:2,title:"Calling bdk-flutter methods",slug:"calling-bdk-flutter-methods"},{level:2,title:"Creating a wallet",slug:"creating-a-wallet"},{level:2,title:"UTXOs and balance",slug:"utxos-and-balance"},{level:2,title:"Restoring a wallet",slug:"restoring-a-wallet"},{level:2,title:"Sending bitcoin",slug:"sending-bitcoin"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"BDK-RN: Building React Native Apps with BDK",frontmatter:{title:"BDK-RN: Building React Native Apps with BDK",description:"A tutorial and guide to using bdk-rn for building bitcoin apps",authors:["Bitcoin Zavior"],date:"2022-08-05",tags:["bitcoin","React Native","iOS","Android","mobile","bdk-rn","bdk","tutorial","guide","wallet"],meta:[{property:"article:published_time",content:"2022-08-05T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK-RN: Building React Native Apps with BDK"},{property:"og:description",content:"A tutorial and guide to using bdk-rn for building bitcoin apps"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_rn/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK-RN: Building React Native Apps with BDK"},{name:"twitter:description",content:"A tutorial and guide to using bdk-rn for building bitcoin apps"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_rn/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bitcoin, React Native, iOS, Android, mobile, bdk-rn, bdk, tutorial, guide, wallet"},{property:"article:tag",content:"bitcoin"},{property:"article:tag",content:"React Native"},{property:"article:tag",content:"iOS"},{property:"article:tag",content:"Android"},{property:"article:tag",content:"mobile"},{property:"article:tag",content:"bdk-rn"},{property:"article:tag",content:"bdk"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"wallet"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/exploring_bdk_rn.html",relativePath:"_blog/exploring_bdk_rn.md",key:"v-f58ec8f2",path:"/blog/exploring-bdk-rn/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Prerequisites",slug:"prerequisites"},{level:3,title:"Bitcoin Basics",slug:"bitcoin-basics"},{level:2,title:"Bitcoin Dev Kit and bdk-rn",slug:"bitcoin-dev-kit-and-bdk-rn"},{level:2,title:"Getting Started",slug:"getting-started"},{level:2,title:"Setting up styles and RN app structure",slug:"setting-up-styles-and-rn-app-structure"},{level:2,title:"Installing bdk-rn",slug:"installing-bdk-rn"},{level:2,title:"Importing bdk-rn",slug:"importing-bdk-rn"},{level:2,title:"Calling bdk-rn methods",slug:"calling-bdk-rn-methods"},{level:2,title:"Creating a wallet",slug:"creating-a-wallet"},{level:2,title:"UTXOs and balance",slug:"utxos-and-balance"},{level:2,title:"Restoring wallet",slug:"restoring-wallet"},{level:2,title:"Sending bitcoin",slug:"sending-bitcoin"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Fee estimation for light-clients (Part 1)",frontmatter:{title:"Fee estimation for light-clients (Part 1)",description:"Applying machine learning to the bitcoin fee estimation problem",authors:["Riccardo Casatta"],date:"2021-01-25",tags:["fee","machine learning"],permalink:"/blog/2021/01/fee-estimation-for-light-clients-part-1/",meta:[{property:"article:published_time",content:"2021-01-25T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Fee estimation for light-clients (Part 1)"},{property:"og:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Fee estimation for light-clients (Part 1)"},{name:"twitter:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"fee, machine learning"},{property:"article:tag",content:"fee"},{property:"article:tag",content:"machine learning"}],layout:"Post"},regularPath:"/_blog/fee_estimation_for_light_clients_part_1.html",relativePath:"_blog/fee_estimation_for_light_clients_part_1.md",key:"v-015729b9",path:"/blog/2021/01/fee-estimation-for-light-clients-part-1/",headers:[{level:2,title:"Introduction: what is fee estimation?",slug:"introduction-what-is-fee-estimation"},{level:2,title:"The problem",slug:"the-problem"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Fee estimation for light-clients (Part 2)",frontmatter:{title:"Fee estimation for light-clients (Part 2)",description:"Applying machine learning to the bitcoin fee estimation problem",authors:["Riccardo Casatta"],date:"2021-01-25",tags:["fee","machine learning"],permalink:"/blog/2021/01/fee-estimation-for-light-clients-part-2/",meta:[{property:"article:published_time",content:"2021-01-25T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Fee estimation for light-clients (Part 2)"},{property:"og:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Fee estimation for light-clients (Part 2)"},{name:"twitter:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"fee, machine learning"},{property:"article:tag",content:"fee"},{property:"article:tag",content:"machine learning"}],layout:"Post"},regularPath:"/_blog/fee_estimation_for_light_clients_part_2.html",relativePath:"_blog/fee_estimation_for_light_clients_part_2.md",key:"v-2c605799",path:"/blog/2021/01/fee-estimation-for-light-clients-part-2/",headers:[{level:2,title:"The dataset",slug:"the-dataset"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Fee estimation for light-clients (Part 3)",frontmatter:{title:"Fee estimation for light-clients (Part 3)",description:"Applying machine learning to the bitcoin fee estimation problem",authors:["Riccardo Casatta"],date:"2021-01-25",tags:["fee","machine learning"],permalink:"/blog/2021/01/fee-estimation-for-light-clients-part-3/",meta:[{property:"article:published_time",content:"2021-01-25T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Fee estimation for light-clients (Part 3)"},{property:"og:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Fee estimation for light-clients (Part 3)"},{name:"twitter:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"fee, machine learning"},{property:"article:tag",content:"fee"},{property:"article:tag",content:"machine learning"}],layout:"Post"},regularPath:"/_blog/fee_estimation_for_light_clients_part_3.html",relativePath:"_blog/fee_estimation_for_light_clients_part_3.md",key:"v-57698579",path:"/blog/2021/01/fee-estimation-for-light-clients-part-3/",headers:[{level:2,title:"The model",slug:"the-model"},{level:2,title:"The prediction phase",slug:"the-prediction-phase"},{level:2,title:"Conclusion and future development",slug:"conclusion-and-future-development"},{level:2,title:"Acknowledgements",slug:"acknowledgements"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"The first BDK Taproot TX: a look at the code (Part 1)",frontmatter:{title:"The first BDK Taproot TX: a look at the code (Part 1)",description:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction",authors:["Alekos Filini"],date:"2021-11-15",tags:["BDK","taproot","miniscript"],permalink:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1",meta:[{property:"article:published_time",content:"2021-11-15T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"The first BDK Taproot TX: a look at the code (Part 1)"},{property:"og:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"The first BDK Taproot TX: a look at the code (Part 1)"},{name:"twitter:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, taproot, miniscript"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"taproot"},{property:"article:tag",content:"miniscript"}],layout:"Post"},regularPath:"/_blog/first_bdk_taproot_tx.html",relativePath:"_blog/first_bdk_taproot_tx.md",key:"v-9145467a",path:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/",headers:[{level:2,title:"Backstory",slug:"backstory"},{level:2,title:"rust-bitcoin",slug:"rust-bitcoin"},{level:2,title:"rust-miniscript",slug:"rust-miniscript"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"The first BDK Taproot TX: a look at the code (Part 2)",frontmatter:{title:"The first BDK Taproot TX: a look at the code (Part 2)",description:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction",authors:["Alekos Filini"],date:"2021-12-10",tags:["BDK","taproot","miniscript"],permalink:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2",meta:[{property:"article:published_time",content:"2021-12-10T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"The first BDK Taproot TX: a look at the code (Part 2)"},{property:"og:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"The first BDK Taproot TX: a look at the code (Part 2)"},{name:"twitter:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, taproot, miniscript"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"taproot"},{property:"article:tag",content:"miniscript"}],layout:"Post"},regularPath:"/_blog/first_bdk_taproot_tx_part_2.html",relativePath:"_blog/first_bdk_taproot_tx_part_2.md",key:"v-2cf72b39",path:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/",headers:[{level:2,title:"Shortcuts",slug:"shortcuts"},{level:2,title:"Utilities",slug:"utilities"},{level:2,title:"Wrap Fallible Methods",slug:"wrap-fallible-methods"},{level:2,title:"Descriptor Metadata",slug:"descriptor-metadata"},{level:2,title:"Policy",slug:"policy"},{level:2,title:"Signer",slug:"signer"},{level:2,title:"PSBT Metadata",slug:"psbt-metadata"},{level:2,title:"descriptor!() Macro",slug:"descriptor-macro"},{level:3,title:"tr() Descriptors",slug:"tr-descriptors"},{level:3,title:"multi_a() Operator",slug:"multi-a-operator"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Getting Started with rust-hwi",frontmatter:{title:"Getting Started with rust-hwi",description:"This post will help one understand and develop for hardware wallets using BDK",authors:["Wszdexdrf"],date:"2022-08-16",tags:["BDK","Development","Hardware Wallets"],draft:!1,meta:[{property:"article:published_time",content:"2022-08-16T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Getting Started with rust-hwi"},{property:"og:description",content:"This post will help one understand and develop for hardware wallets using BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/getting_started_with_rust_hwi/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Getting Started with rust-hwi"},{name:"twitter:description",content:"This post will help one understand and develop for hardware wallets using BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/getting_started_with_rust_hwi/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, Development, Hardware Wallets"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"Development"},{property:"article:tag",content:"Hardware Wallets"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/getting_started_with_rust_hwi.html",relativePath:"_blog/getting_started_with_rust_hwi.md",key:"v-11d64359",path:"/blog/getting-started-with-rust-hwi/",headers:[{level:2,title:"Fundamentals",slug:"fundamentals"},{level:2,title:"Integration with BDK",slug:"integration-with-bdk"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Hello World!",frontmatter:{title:"Hello World!",description:"Getting started using the BDK library in a very simple Rust project",authors:["Alekos Filini"],date:"2020-12-18",tags:["getting started","rust"],permalink:"/blog/2020/12/hello-world/",meta:[{property:"article:published_time",content:"2020-12-18T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Hello World!"},{property:"og:description",content:"Getting started using the BDK library in a very simple Rust project"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2020/12/hello-world/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Hello World!"},{name:"twitter:description",content:"Getting started using the BDK library in a very simple Rust project"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2020/12/hello-world/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"getting started, rust"},{property:"article:tag",content:"getting started"},{property:"article:tag",content:"rust"}],layout:"Post"},regularPath:"/_blog/hello-world.html",relativePath:"_blog/hello-world.md",key:"v-5d749fce",path:"/blog/2020/12/hello-world/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Design Goals",slug:"design-goals"},{level:2,title:"The Wallet Structure",slug:"the-wallet-structure"},{level:2,title:"Custom Database and Blockchain types",slug:"custom-database-and-blockchain-types"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Hidden Powers of Miniscript Policy & Descriptors",frontmatter:{title:"Hidden Powers of Miniscript Policy & Descriptors",description:"Introduction to Descriptor and Miniscript, making a Multisig Wallet and Testing Miniscript Policies",authors:["Sandipan Dey","Rajarshi Maitra"],date:"2022-01-02",tags:["tutorial","bdk","bdk-cli","miniscript","descriptor","bitcoin-cli"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-01-02T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Hidden Powers of Miniscript Policy & Descriptors"},{property:"og:description",content:"Introduction to Descriptor and Miniscript, making a Multisig Wallet and Testing Miniscript Policies"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/hidden-power-of-bitcoin/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Hidden Powers of Miniscript Policy & Descriptors"},{name:"twitter:description",content:"Introduction to Descriptor and Miniscript, making a Multisig Wallet and Testing Miniscript Policies"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/hidden-power-of-bitcoin/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, bdk, bdk-cli, miniscript, descriptor, bitcoin-cli"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"bdk"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"miniscript"},{property:"article:tag",content:"descriptor"},{property:"article:tag",content:"bitcoin-cli"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/hidden-power-of-bitcoin.html",relativePath:"_blog/hidden-power-of-bitcoin.md",key:"v-ab5ba3ce",path:"/blog/hidden-power-of-bitcoin/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Script",slug:"script"},{level:2,title:"Miniscript",slug:"miniscript"},{level:2,title:"Descriptors",slug:"descriptors"},{level:2,title:"Where it all comes together...",slug:"where-it-all-comes-together"},{level:3,title:"Keys and Generating Addresses",slug:"keys-and-generating-addresses"},{level:3,title:"Making a MultiSig Descriptor for Funds",slug:"making-a-multisig-descriptor-for-funds"},{level:2,title:"Retention Bonus - Smart Contract with Bitcoin",slug:"retention-bonus-smart-contract-with-bitcoin"},{level:2,title:"Inspirations",slug:"inspirations"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Improving coin selection in BDK",frontmatter:{title:"Improving coin selection in BDK",description:"A brief description of the work done in the coin selection module in BDK during Summer of Bitcoin 2022",date:"2022-08-17",tags:["coin selection","BDK","development","summer of bitcoin"],authors:["César Alvarez Vallero"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-08-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Improving coin selection in BDK"},{property:"og:description",content:"A brief description of the work done in the coin selection module in BDK during Summer of Bitcoin 2022"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/improving_coin_selection_in_BDK/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Improving coin selection in BDK"},{name:"twitter:description",content:"A brief description of the work done in the coin selection module in BDK during Summer of Bitcoin 2022"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/improving_coin_selection_in_BDK/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"coin selection, BDK, development, summer of bitcoin"},{property:"article:tag",content:"coin selection"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"development"},{property:"article:tag",content:"summer of bitcoin"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/improving_coin_selection_in_BDK.html",relativePath:"_blog/improving_coin_selection_in_BDK.md",key:"v-d0375c8e",path:"/blog/improving-coin-selection-in-bdk/",headers:[{level:2,title:"Waste",slug:"waste"},{level:3,title:"How it works?",slug:"how-it-works"},{level:3,title:"What has been done",slug:"what-has-been-done"},{level:3,title:"Work in progress",slug:"work-in-progress"},{level:2,title:"Further Improvements",slug:"further-improvements"},{level:3,title:"Privacy",slug:"privacy"},{level:3,title:"Flexibility",slug:"flexibility"},{level:2,title:"Conclusion",slug:"conclusion"},{level:2,title:"Acknowledgements",slug:"acknowledgements"},{level:2,title:"References",slug:"references"},{level:3,title:"About coin selection considerations",slug:"about-coin-selection-considerations"},{level:3,title:"About Waste metric",slug:"about-waste-metric"},{level:3,title:"About improving privacy in coin selection",slug:"about-improving-privacy-in-coin-selection"},{level:3,title:"About bdk_core",slug:"about-bdk-core"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Release v0.2.0",frontmatter:{title:"Release v0.2.0",description:"Announcing the v0.2.0 release of BDK",authors:["Alekos Filini"],date:"2020-12-21",tags:["rust","release"],permalink:"/blog/2020/12/release-v0.2.0/",meta:[{property:"article:published_time",content:"2020-12-21T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.2.0"},{property:"og:description",content:"Announcing the v0.2.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2020/12/release-v0.2.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.2.0"},{name:"twitter:description",content:"Announcing the v0.2.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2020/12/release-v0.2.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.2.0.html",relativePath:"_blog/release-0.2.0.md",key:"v-edd5570e",path:"/blog/2020/12/release-v0.2.0/",headers:[{level:2,title:"What's new in v0.2.0",slug:"whats-new-in-v020"},{level:3,title:"A new name",slug:"a-new-name"},{level:3,title:"Branch and Bound coin selection",slug:"branch-and-bound-coin-selection"},{level:3,title:"Key generation",slug:"key-generation"},{level:3,title:"Generic key types",slug:"generic-key-types"},{level:3,title:"Descriptor templates",slug:"descriptor-templates"},{level:3,title:"Easier creation of Blockchain and Database",slug:"easier-creation-of-blockchain-and-database"},{level:3,title:"descriptor!() macro",slug:"descriptor-macro"},{level:3,title:"Support for sortedmulti()",slug:"support-for-sortedmulti"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Security Advisory: Miniscript MINIMALIF Bug",frontmatter:{title:"Security Advisory: Miniscript MINIMALIF Bug",description:"Security advisory on the recent Miniscript MINIMALIF bug. How to check if you are affected and what to do next.",authors:["Alekos Filini"],date:"2022-04-19",tags:["miniscript","security"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-04-19T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Security Advisory: Miniscript MINIMALIF Bug"},{property:"og:description",content:"Security advisory on the recent Miniscript MINIMALIF bug. How to check if you are affected and what to do next."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/miniscript_vulnerability/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Security Advisory: Miniscript MINIMALIF Bug"},{name:"twitter:description",content:"Security advisory on the recent Miniscript MINIMALIF bug. How to check if you are affected and what to do next."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/miniscript_vulnerability/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"miniscript, security"},{property:"article:tag",content:"miniscript"},{property:"article:tag",content:"security"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/miniscript_vulnerability.html",relativePath:"_blog/miniscript_vulnerability.md",key:"v-10852eea",path:"/blog/miniscript-vulnerability/",headers:[{level:2,title:"How to check if you are vulnerable",slug:"how-to-check-if-you-are-vulnerable"},{level:2,title:"Next steps",slug:"next-steps"},{level:3,title:"If you are affected",slug:"if-you-are-affected"},{level:3,title:"Everybody",slug:"everybody"},{level:2,title:"Consequences of the update",slug:"consequences-of-the-update"},{level:2,title:"Footnote: How we analyzed the blockchain",slug:"footnote-how-we-analyzed-the-blockchain"},{level:2,title:"Correction (2022-04-25)",slug:"correction-2022-04-25"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Release v0.3.0",frontmatter:{title:"Release v0.3.0",description:"Announcing the v0.3.0 release of BDK",authors:["Alekos Filini"],date:"2021-01-20",tags:["rust","release"],permalink:"/blog/2021/01/release-v0.3.0/",meta:[{property:"article:published_time",content:"2021-01-20T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.3.0"},{property:"og:description",content:"Announcing the v0.3.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/release-v0.3.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.3.0"},{name:"twitter:description",content:"Announcing the v0.3.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/release-v0.3.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.3.0.html",relativePath:"_blog/release-0.3.0.md",key:"v-05df4999",path:"/blog/2021/01/release-v0.3.0/",headers:[{level:2,title:"What's new in v0.3.0",slug:"whats-new-in-v030"},{level:3,title:"Less verbosity when using Wallet::new_offline()",slug:"less-verbosity-when-using-walletnew-offline"},{level:3,title:"No more error conversions in DescriptorTemplate",slug:"no-more-error-conversions-in-descriptortemplate"},{level:3,title:"A new repo for the CLI",slug:"a-new-repo-for-the-cli"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Release v0.4.0",frontmatter:{title:"Release v0.4.0",description:"Announcing the v0.4.0 release of BDK",authors:["Alekos Filini"],date:"2021-02-17",tags:["rust","release"],permalink:"/blog/2021/02/release-v0.4.0/",meta:[{property:"article:published_time",content:"2021-02-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.4.0"},{property:"og:description",content:"Announcing the v0.4.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/02/release-v0.4.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.4.0"},{name:"twitter:description",content:"Announcing the v0.4.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/02/release-v0.4.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.4.0.html",relativePath:"_blog/release-0.4.0.md",key:"v-faad828e",path:"/blog/2021/02/release-v0.4.0/",headers:[{level:2,title:"What's new in v0.4.0",slug:"whats-new-in-v040"},{level:3,title:"A new API to build transaction",slug:"a-new-api-to-build-transaction"},{level:3,title:"Upgraded dependencies",slug:"upgraded-dependencies"},{level:3,title:"Compact Filters example",slug:"compact-filters-example"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Release v0.5.0",frontmatter:{title:"Release v0.5.0",description:"Announcing the v0.5.0 release of BDK",authors:["Alekos Filini"],date:"2021-03-18",tags:["rust","release"],permalink:"/blog/2021/03/release-v0.5.0/",meta:[{property:"article:published_time",content:"2021-03-18T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.5.0"},{property:"og:description",content:"Announcing the v0.5.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/03/release-v0.5.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.5.0"},{name:"twitter:description",content:"Announcing the v0.5.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/03/release-v0.5.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.5.0.html",relativePath:"_blog/release-0.5.0.md",key:"v-0119984e",path:"/blog/2021/03/release-v0.5.0/",headers:[{level:2,title:"What's new in v0.5.0",slug:"whats-new-in-v050"},{level:3,title:"Dual Licensing",slug:"dual-licensing"},{level:3,title:"Spending foreign UTXOs",slug:"spending-foreign-utxos"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Release v0.6.0",frontmatter:{title:"Release v0.6.0",description:"Announcing the v0.6.0 release of BDK",authors:["Alekos Filini"],date:"2021-04-15",tags:["rust","release"],permalink:"/blog/2021/04/release-v0.6.0/",meta:[{property:"article:published_time",content:"2021-04-15T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.6.0"},{property:"og:description",content:"Announcing the v0.6.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/04/release-v0.6.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.6.0"},{name:"twitter:description",content:"Announcing the v0.6.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/04/release-v0.6.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.6.0.html",relativePath:"_blog/release-0.6.0.md",key:"v-7c3d28f9",path:"/blog/2021/04/release-v0.6.0/",headers:[{level:2,title:"What's new in v0.6.0",slug:"whats-new-in-v060"},{level:3,title:"A new way to generate addresses",slug:"a-new-way-to-generate-addresses"},{level:3,title:"Easier multiparty transaction creation",slug:"easier-multiparty-transaction-creation"},{level:3,title:"Renamed types",slug:"renamed-types"},{level:3,title:"New MSRV",slug:"new-msrv"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Release v0.7.0",frontmatter:{title:"Release v0.7.0",description:"Announcing the v0.7.0 release of BDK",authors:["Alekos Filini"],date:"2021-05-17",tags:["rust","release"],permalink:"/blog/2021/05/release-v0.7.0/",meta:[{property:"article:published_time",content:"2021-05-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.7.0"},{property:"og:description",content:"Announcing the v0.7.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/05/release-v0.7.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.7.0"},{name:"twitter:description",content:"Announcing the v0.7.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/05/release-v0.7.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.7.0.html",relativePath:"_blog/release-0.7.0.md",key:"v-0df1c3ce",path:"/blog/2021/05/release-v0.7.0/",headers:[{level:2,title:"What's new in v0.7.0",slug:"whats-new-in-v070"},{level:3,title:"New Signing API",slug:"new-signing-api"},{level:3,title:"Support Timelocks in the policy Module",slug:"support-timelocks-in-the-policy-module"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Release v0.8.0",frontmatter:{title:"Release v0.8.0",description:"Announcing the v0.8.0 release of BDK",authors:["Alekos Filini"],date:"2021-06-14",tags:["rust","release"],permalink:"/blog/2021/06/release-v0.8.0/",meta:[{property:"article:published_time",content:"2021-06-14T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.8.0"},{property:"og:description",content:"Announcing the v0.8.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/06/release-v0.8.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.8.0"},{name:"twitter:description",content:"Announcing the v0.8.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/06/release-v0.8.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.8.0.html",relativePath:"_blog/release-0.8.0.md",key:"v-75d11339",path:"/blog/2021/06/release-v0.8.0/",headers:[{level:2,title:"What's new in v0.8.0",slug:"whats-new-in-v080"},{level:3,title:"Getting the Derivation Index",slug:"getting-the-derivation-index"},{level:3,title:"Explicitly Enable non-ALL Sighashes",slug:"explicitly-enable-non-all-sighashes"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Release v0.9.0",frontmatter:{title:"Release v0.9.0",description:"Announcing the v0.9.0 release of BDK",authors:["Alekos Filini"],date:"2021-07-11",tags:["rust","release"],permalink:"/blog/2021/07/release-v0.9.0/",meta:[{property:"article:published_time",content:"2021-07-11T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.9.0"},{property:"og:description",content:"Announcing the v0.9.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/07/release-v0.9.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.9.0"},{name:"twitter:description",content:"Announcing the v0.9.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/07/release-v0.9.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.9.0.html",relativePath:"_blog/release-0.9.0.md",key:"v-1ac9ef4e",path:"/blog/2021/07/release-v0.9.0/",headers:[{level:2,title:"What's new in v0.9.0",slug:"whats-new-in-v090"},{level:2,title:"Bitcoin Core Blockchain Backend",slug:"bitcoin-core-blockchain-backend"},{level:2,title:"Updated TransactionDetails Struct",slug:"updated-transactiondetails-struct"},{level:2,title:"Verify Downloaded TXs",slug:"verify-downloaded-txs"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"The Road to BDK 1.0",frontmatter:{title:"The Road to BDK 1.0",description:"Outlining the plan for the 1.0 release of BDK",authors:["Alekos Filini"],date:"2022-10-03",tags:["architecture"],draft:!1,meta:[{property:"article:published_time",content:"2022-10-03T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"The Road to BDK 1.0"},{property:"og:description",content:"Outlining the plan for the 1.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/road_to_bdk_1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"The Road to BDK 1.0"},{name:"twitter:description",content:"Outlining the plan for the 1.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/road_to_bdk_1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"architecture"},{property:"article:tag",content:"architecture"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/road_to_bdk_1.html",relativePath:"_blog/road_to_bdk_1.md",key:"v-55969f39",path:"/blog/road-to-bdk-1/",headers:[{level:2,title:"Goals",slug:"goals"},{level:3,title:"Stable API",slug:"stable-api"},{level:3,title:"Upstreaming our code",slug:"upstreaming-our-code"},{level:3,title:"Partially Syncing a Wallet",slug:"partially-syncing-a-wallet"},{level:3,title:"no_std",slug:"no-std"},{level:3,title:"Lower MSRV",slug:"lower-msrv"},{level:2,title:"Architecture",slug:"architecture"},{level:2,title:"Timeline",slug:"timeline"},{level:2,title:"Feature Freezing BDK",slug:"feature-freezing-bdk"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Spending Policy Decoded",frontmatter:{title:"Spending Policy Decoded",description:"Demonstrate how to use a descriptor wallet with different spending policies",authors:["Steve Myers","thunderbiscuit"],date:"2021-02-23",tags:["guide","descriptor"],meta:[{property:"article:published_time",content:"2021-02-23T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Spending Policy Decoded"},{property:"og:description",content:"Demonstrate how to use a descriptor wallet with different spending policies"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/spending_policy_demo/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Spending Policy Decoded"},{name:"twitter:description",content:"Demonstrate how to use a descriptor wallet with different spending policies"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/spending_policy_demo/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"guide, descriptor"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"descriptor"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/spending_policy_demo.html",relativePath:"_blog/spending_policy_demo.md",key:"v-8534b9c2",path:"/blog/spending-policy-demo/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Initial Setup",slug:"initial-setup"},{level:3,title:"Step 0: Install a recent version bdk-cli",slug:"step-0-install-a-recent-version-bdk-cli"},{level:3,title:"Step 1: Generate private extended keys",slug:"step-1-generate-private-extended-keys"},{level:3,title:"Step 2: Extract private extended keys",slug:"step-2-extract-private-extended-keys"},{level:3,title:"Step 3: Derive public extended keys",slug:"step-3-derive-public-extended-keys"},{level:3,title:"Step 4: Create wallet descriptors for each participant",slug:"step-4-create-wallet-descriptors-for-each-participant"},{level:2,title:"Policy A. Three signatures",slug:"policy-a-three-signatures"},{level:3,title:"Step 1a: Create a testnet segwit0 receive address",slug:"step-1a-create-a-testnet-segwit0-receive-address"},{level:3,title:"Step 2a: Send testnet bitcoin from a faucet to receive address",slug:"step-2a-send-testnet-bitcoin-from-a-faucet-to-receive-address"},{level:3,title:"Step 3a: Sync participant wallets and confirm balance",slug:"step-3a-sync-participant-wallets-and-confirm-balance"},{level:3,title:"Step 4a: View wallet spending policies",slug:"step-4a-view-wallet-spending-policies"},{level:3,title:"Step 5a: Create spending transaction",slug:"step-5a-create-spending-transaction"},{level:3,title:"Step 6a: Sign and finalize PSBTs",slug:"step-6a-sign-and-finalize-psbts"},{level:3,title:"Step 7a: Broadcast finalized PSBT",slug:"step-7a-broadcast-finalized-psbt"},{level:3,title:"Step 8a: Confirm transaction included in a testnet block",slug:"step-8a-confirm-transaction-included-in-a-testnet-block"},{level:2,title:"Policy B. Two signatures after a relative time lock",slug:"policy-b-two-signatures-after-a-relative-time-lock"},{level:3,title:"Step 1b: Create a new testnet receive address",slug:"step-1b-create-a-new-testnet-receive-address"},{level:3,title:"Step 2b: Fund new address from testnet faucet",slug:"step-2b-fund-new-address-from-testnet-faucet"},{level:3,title:"Step 3b: Sync wallet and confirm wallet balance",slug:"step-3b-sync-wallet-and-confirm-wallet-balance"},{level:3,title:"Step 4b: Create spending transaction",slug:"step-4b-create-spending-transaction"},{level:3,title:"Step 5b: Sign and finalize PSBTs",slug:"step-5b-sign-and-finalize-psbts"},{level:3,title:"Step 6b: Broadcast finalized PSBT",slug:"step-6b-broadcast-finalized-psbt"},{level:3,title:"Step 7b: View confirmed transaction",slug:"step-7b-view-confirmed-transaction"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Using BDK with hardware wallets",frontmatter:{title:"Using BDK with hardware wallets",description:"Tutorial showing how to send funds to a HW and then spend from it using BDK",authors:["Daniela Brozzoni"],date:"2022-10-27",tags:["BDK","Development","Hardware Wallets"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-10-27T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Using BDK with hardware wallets"},{property:"og:description",content:"Tutorial showing how to send funds to a HW and then spend from it using BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/using_bdk_with_hardware_wallets/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Using BDK with hardware wallets"},{name:"twitter:description",content:"Tutorial showing how to send funds to a HW and then spend from it using BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/using_bdk_with_hardware_wallets/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, Development, Hardware Wallets"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"Development"},{property:"article:tag",content:"Hardware Wallets"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/using_bdk_with_hardware_wallets.html",relativePath:"_blog/using_bdk_with_hardware_wallets.md",key:"v-aeb70fce",path:"/blog/using-bdk-with-hardware-wallets/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisites",slug:"prerequisites"},{level:2,title:"Initial setup",slug:"initial-setup"},{level:2,title:"Finding the hardware wallet",slug:"finding-the-hardware-wallet"},{level:2,title:"Receiving funds",slug:"receiving-funds"},{level:2,title:"Spending funds",slug:"spending-funds"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Why Do We Build Bindings?",frontmatter:{title:"Why Do We Build Bindings?",description:"A post exploring why the Bitcoin Dev Kit Foundation produces language bindings for its libraries",authors:["thunderbiscuit"],date:"2024-05-07",tags:["bindings"],meta:[{property:"article:published_time",content:"2024-05-07T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Why Do We Build Bindings?"},{property:"og:description",content:"A post exploring why the Bitcoin Dev Kit Foundation produces language bindings for its libraries"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/why-bindings/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Why Do We Build Bindings?"},{name:"twitter:description",content:"A post exploring why the Bitcoin Dev Kit Foundation produces language bindings for its libraries"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/why-bindings/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bindings"},{property:"article:tag",content:"bindings"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/why-bindings.html",relativePath:"_blog/why-bindings.md",key:"v-4dc135e3",path:"/blog/why-bindings/",headers:[{level:2,title:"Awesome! Producing Bindings Must Be Easy Right?",slug:"awesome-producing-bindings-must-be-easy-right"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Custodial",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/custodial/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/custodial/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/custodial.html",relativePath:"adoption/custodial.md",key:"v-30c0037b",path:"/adoption/custodial/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"All",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/all/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/all/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/all.html",relativePath:"adoption/all.md",key:"v-4d760891",path:"/adoption/all/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Desktop",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/desktop/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/desktop/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/desktop.html",relativePath:"adoption/desktop.md",key:"v-4bb7844a",path:"/adoption/desktop/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Exchange",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/exchange/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/exchange/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/exchange.html",relativePath:"adoption/exchange.md",key:"v-b936290e",path:"/adoption/exchange/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Hardware",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/hardware/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/hardware/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/hardware.html",relativePath:"adoption/hardware.md",key:"v-7afdbb4e",path:"/adoption/hardware/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Infrastructure",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/infrastructure/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/infrastructure/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/infrastructure.html",relativePath:"adoption/infrastructure.md",key:"v-4e0b610e",path:"/adoption/infrastructure/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Mobile",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/mobile/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/mobile/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/mobile.html",relativePath:"adoption/mobile.md",key:"v-a7c24c4e",path:"/adoption/mobile/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Compiler",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Compiler"},{property:"og:description",content:'If you want to play around with more complicated spending policies, you\'ll start to find it harder and harder to manually create the descriptors. This is where the miniscript compiler comes in! The `bdk` library\nincludes a very simple compiler that can produce a descriptor given a spending policy. The syntax used to encode the spending policy is very well described in this pagehttp://bitcoin.sipa.be/miniscript/,\nspecifically in the "Policy to Miniscript compiler". The compiler included in BDK does basically the same job, but produces descriptors for `rust-miniscript` that have some minor differences from\nthe ones made by the C++ implementation used in that website.'},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/compiler/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Compiler"},{name:"twitter:description",content:'If you want to play around with more complicated spending policies, you\'ll start to find it harder and harder to manually create the descriptors. This is where the miniscript compiler comes in! The `bdk` library\nincludes a very simple compiler that can produce a descriptor given a spending policy. The syntax used to encode the spending policy is very well described in this pagehttp://bitcoin.sipa.be/miniscript/,\nspecifically in the "Policy to Miniscript compiler". The compiler included in BDK does basically the same job, but produces descriptors for `rust-miniscript` that have some minor differences from\nthe ones made by the C++ implementation used in that website.'},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/compiler/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/compiler.html",relativePath:"bdk-cli/compiler.md",key:"v-7a315e41",path:"/bdk-cli/compiler/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Installation",slug:"installation"},{level:2,title:"Usage",slug:"usage"},{level:2,title:"Example",slug:"example"},{level:2,title:"Troubleshooting",slug:"troubleshooting"}],codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Web",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/web/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/web/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/web.html",relativePath:"adoption/web.md",key:"v-17019aeb",path:"/adoption/web/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Concept",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Concept"},{property:"og:description",content:"Now, in order to better grasp some of the design choices made by BDK, it's important to understand the main concept driving the development of this project, and the goal that it's trying to\nachieve."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/concept/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Concept"},{name:"twitter:description",content:"Now, in order to better grasp some of the design choices made by BDK, it's important to understand the main concept driving the development of this project, and the goal that it's trying to\nachieve."},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/concept/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/concept.html",relativePath:"bdk-cli/concept.md",key:"v-f611a14e",path:"/bdk-cli/concept/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Installation",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Installation"},{property:"og:description",content:"The only requirement to run the `bdk-cli` tool is a Linux/macOS system with a fairly recent Rust\ntoolchain installed. Since Linux distros tend to lag behind with updates, the quickest way to\ninstall the Rust compiler and Cargo is rustup.rshttps://rustup.rs/. You can head there and\nfollow their instructions, after which you can test if everything went fine by running"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/installation/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Installation"},{name:"twitter:description",content:"The only requirement to run the `bdk-cli` tool is a Linux/macOS system with a fairly recent Rust\ntoolchain installed. Since Linux distros tend to lag behind with updates, the quickest way to\ninstall the Rust compiler and Cargo is rustup.rshttps://rustup.rs/. You can head there and\nfollow their instructions, after which you can test if everything went fine by running"},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/installation/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/installation.html",relativePath:"bdk-cli/installation.md",key:"v-3acb6e6a",path:"/bdk-cli/installation/",headers:[{level:2,title:"Requirements",slug:"requirements"},{level:2,title:"Installing the bdk-cli tool",slug:"installing-the-bdk-cli-tool"}],codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Interface",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Interface"},{property:"og:description",content:"Remember the `bdk-cli --help` command you ran before? Let's analyze its output here to figure out the interface:"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/interface/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Interface"},{name:"twitter:description",content:"Remember the `bdk-cli --help` command you ran before? Let's analyze its output here to figure out the interface:"},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/interface/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/interface.html",relativePath:"bdk-cli/interface.md",key:"v-496cb7f9",path:"/bdk-cli/interface/",headers:[{level:2,title:"Flags",slug:"flags"},{level:3,title:"Verbosity",slug:"verbosity"},{level:2,title:"Options",slug:"options"},{level:2,title:"Subcommands",slug:"subcommands"},{level:2,title:"key",slug:"key"},{level:3,title:"generate",slug:"generate"},{level:3,title:"restore",slug:"restore"},{level:3,title:"derive",slug:"derive"},{level:2,title:"wallet",slug:"wallet"},{level:3,title:"Options",slug:"options-2"},{level:2,title:"Subcommands",slug:"subcommands-2"},{level:3,title:"broadcast",slug:"broadcast"},{level:3,title:"bump_fee",slug:"bump-fee"},{level:3,title:"combine_psbt",slug:"combine-psbt"},{level:3,title:"create_tx",slug:"create-tx"},{level:3,title:"extract_psbt",slug:"extract-psbt"},{level:3,title:"finalize_psbt",slug:"finalize-psbt"},{level:3,title:"get_balance",slug:"get-balance"},{level:3,title:"get_new_address",slug:"get-new-address"},{level:3,title:"list_transactions",slug:"list-transactions"},{level:3,title:"list_unspent",slug:"list-unspent"},{level:3,title:"policies",slug:"policies"},{level:3,title:"public_descriptor",slug:"public-descriptor"},{level:3,title:"help",slug:"help"},{level:3,title:"sign",slug:"sign"},{level:3,title:"sync",slug:"sync"}],codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Introduction",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Introduction"},{property:"og:description",content:"This can also be used as an example application to create your own command line bitcoin wallet tool using bdk."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/introduction/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Introduction"},{name:"twitter:description",content:"This can also be used as an example application to create your own command line bitcoin wallet tool using bdk."},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/introduction/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/introduction.html",relativePath:"bdk-cli/introduction.md",key:"v-0b3b65ea",path:"/bdk-cli/introduction/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Playground",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Playground"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/playground/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Playground"},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/playground/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/playground.html",relativePath:"bdk-cli/playground.md",key:"v-a76bccee",path:"/bdk-cli/playground/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Regtest",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Regtest"},{property:"og:description",content:"Running the `bdk-cli` tool in regtest requires having a local Electrum server set-up. There are two main implementations, `electrs`https://github.com/romanz/electrs in Rust and `ElectrumX`https://github.com/spesmilo/electrumx in Python. Since the Rust toolchain is already required to\nuse BDK, this page will focus mostly on the former."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/regtest/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Regtest"},{name:"twitter:description",content:"Running the `bdk-cli` tool in regtest requires having a local Electrum server set-up. There are two main implementations, `electrs`https://github.com/romanz/electrs in Rust and `ElectrumX`https://github.com/spesmilo/electrumx in Python. Since the Rust toolchain is already required to\nuse BDK, this page will focus mostly on the former."},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/regtest/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/regtest.html",relativePath:"bdk-cli/regtest.md",key:"v-05d01c19",path:"/bdk-cli/regtest/",headers:[{level:2,title:"Troubleshooting",slug:"troubleshooting"},{level:2,title:"Bonus: Docker",slug:"bonus-docker"}],codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{frontmatter:{cases:!0,sidebar:!1,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",actionText:"Add your project",actionLink:"https://github.com/orgs/bitcoindevkit/discussions/64",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/case-studies/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/case-studies/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/case-studies.html",relativePath:"case-studies.md",key:"v-11bf335e",path:"/case-studies/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Descriptors",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Descriptors"},{property:"og:description",content:'Descriptors are a compact and semi-standard way to easily encode, or "describe", how scripts and subsequently, addresses of a wallet should be generated. They can be especially helpful when working with multisigs or even\nmore complex scripts, where the structure of the script itself is not trivial. They are a big step forward in making wallets more portable across different tools and apps, because for the first time they create a common\nlanguage to describe a full bitcoin script that developers can use and integrate in their software.'},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/descriptors/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Descriptors"},{name:"twitter:description",content:'Descriptors are a compact and semi-standard way to easily encode, or "describe", how scripts and subsequently, addresses of a wallet should be generated. They can be especially helpful when working with multisigs or even\nmore complex scripts, where the structure of the script itself is not trivial. They are a big step forward in making wallets more portable across different tools and apps, because for the first time they create a common\nlanguage to describe a full bitcoin script that developers can use and integrate in their software.'},{name:"twitter:url",content:"https://bitcoindevkit.org/descriptors/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/descriptors/",relativePath:"descriptors/README.md",key:"v-a9236c10",path:"/descriptors/",headers:[{level:3,title:"Compatibility Matrix",slug:"compatibility-matrix"},{level:3,title:"Examples",slug:"examples"},{level:3,title:"Implementation Details",slug:"implementation-details"}],codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Examples",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Examples"},{property:"og:description",content:"Click the links below and learn from community-built example projects."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/examples/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Examples"},{name:"twitter:description",content:"Click the links below and learn from community-built example projects."},{name:"twitter:url",content:"https://bitcoindevkit.org/examples/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/examples/",relativePath:"examples/README.md",key:"v-29f9f21c",path:"/examples/",headers:[{level:2,title:"BDK-CLI",slug:"bdk-cli"},{level:2,title:"DevkitWallet",slug:"devkitwallet"},{level:2,title:"Padawan Wallet",slug:"padawan-wallet"},{level:2,title:"BDKSwiftExampleWallet",slug:"bdkswiftexamplewallet"},{level:2,title:"Tatooine",slug:"tatooine"},{level:2,title:"SEBA Bank Proof of reserves",slug:"seba-bank-proof-of-reserves"},{level:2,title:"Stackmate",slug:"stackmate"},{level:2,title:"Spotbit",slug:"spotbit"}],codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Bitcoin Dev Kit Foundation",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/about/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/about/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/about.html",relativePath:"foundation/about.md",key:"v-3750297a",path:"/foundation/about/",headers:[{level:2,title:"Board",slug:"board"},{level:2,title:"Operations",slug:"operations"}],codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Current Grantees (Full-Time)",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/grantees/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/grantees/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/grantees.html",relativePath:"foundation/grantees.md",key:"v-105750ce",path:"/foundation/grantees/",headers:[{level:2,title:"Evan Lin",slug:"evan-lin"},{level:2,title:"thunderbiscuit",slug:"thunderbiscuit"},{level:2,title:"Matthew Ramsden",slug:"matthew-ramsden"},{level:2,title:"ValuedMammal",slug:"valuedmammal"},{level:2,title:"Wei Chen",slug:"wei-chen"},{level:2,title:"Manuel Gatti",slug:"manuel-gatti"}],codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Bitcoin Dev Kit Foundation",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/",relativePath:"foundation/index.md",key:"v-c152529c",path:"/foundation/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Supporters",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/supporters/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/supporters/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/supporters.html",relativePath:"foundation/supporters.md",key:"v-50aa6d4e",path:"/foundation/supporters/",codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{title:"Bitcoin Dev Kit",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin Dev Kit"},{property:"og:description",content:"The Bitcoin Dev Kit BDKhttps://github.com/bitcoindevkit project originally called Magical Bitcoin 🧙 aims to build a collection of tools and libraries that are designed to be a solid foundation for cross platform Bitcoin wallets, along with a fully working reference implementation wallets for various platforms.\nAll BDK components are designed to be lightweight and modular so that they can be adapted for virtually any use-case: from single-sig mobile wallets to multi-billion-dollar cold storage vaults."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/getting-started/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin Dev Kit"},{name:"twitter:description",content:"The Bitcoin Dev Kit BDKhttps://github.com/bitcoindevkit project originally called Magical Bitcoin 🧙 aims to build a collection of tools and libraries that are designed to be a solid foundation for cross platform Bitcoin wallets, along with a fully working reference implementation wallets for various platforms.\nAll BDK components are designed to be lightweight and modular so that they can be adapted for virtually any use-case: from single-sig mobile wallets to multi-billion-dollar cold storage vaults."},{name:"twitter:url",content:"https://bitcoindevkit.org/getting-started/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/getting-started.html",relativePath:"getting-started.md",key:"v-4bcdac39",path:"/getting-started/",headers:[{level:2,title:"Initial Configuration",slug:"initial-configuration"},{level:2,title:"Internal Features",slug:"internal-features"},{level:2,title:"Playground",slug:"playground"},{level:2,title:"Descriptors",slug:"descriptors"}],codeSwitcherOptions:{},lastUpdated:"6/4/2024, 10:14:13 PM",lastUpdatedTimestamp:1717539253e3},{frontmatter:{layout:"IndexPost",title:"Blog",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/",key:"v-424df898",path:"/blog/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterKey",title:"Tags",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/",key:"v-619df59e",path:"/blog/tags/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterKey",title:"Authors",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/",key:"v-b0968728",path:"/blog/author/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"BDK ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/BDK/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/BDK/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/BDK/",key:"v-5f2600b8",path:"/blog/tags/BDK/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"project ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/project/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/project/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/project/",key:"v-398e8fd4",path:"/blog/tags/project/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"tutorial ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/tutorial/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/tutorial/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/tutorial/",key:"v-da8c869a",path:"/blog/tags/tutorial/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Bitcoin Core ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Bitcoin Core/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Bitcoin Core/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Bitcoin%20Core/",key:"v-62bbf2ad",path:"/blog/tags/Bitcoin Core/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"RPC ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/RPC/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/RPC/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/RPC/",key:"v-5f171cb0",path:"/blog/tags/RPC/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Wallet ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Wallet/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Wallet/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Wallet/",key:"v-4696dfd8",path:"/blog/tags/Wallet/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bdk-cli ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bdk-cli/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bdk-cli/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bdk-cli/",key:"v-c711ccde",path:"/blog/tags/bdk-cli/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"multi-sig ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/multi-sig/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/multi-sig/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/multi-sig/",key:"v-655ee4a0",path:"/blog/tags/multi-sig/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"basics ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/basics/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/basics/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/basics/",key:"v-e646a928",path:"/blog/tags/basics/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"novice ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/novice/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/novice/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/novice/",key:"v-1fb58ffb",path:"/blog/tags/novice/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"architecture ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/architecture/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/architecture/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/architecture/",key:"v-c4494744",path:"/blog/tags/architecture/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"BDK-RN ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/BDK-RN/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/BDK-RN/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/BDK-RN/",key:"v-876cfade",path:"/blog/tags/BDK-RN/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Development ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Development/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Development/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Development/",key:"v-3acc51dc",path:"/blog/tags/Development/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Architecture ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Architecture/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Architecture/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Architecture/",key:"v-650ae784",path:"/blog/tags/Architecture/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"tor ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/tor/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/tor/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/tor/",key:"v-5ef73f54",path:"/blog/tags/tor/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"wallet ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/wallet/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/wallet/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/wallet/",key:"v-39437010",path:"/blog/tags/wallet/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"blockchain ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/blockchain/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/blockchain/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/blockchain/",key:"v-7c8563fd",path:"/blog/tags/blockchain/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bindings ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bindings/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bindings/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bindings/",key:"v-1296a8fa",path:"/blog/tags/bindings/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"compact_filters ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/compact_filters/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/compact_filters/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/compact_filters/",key:"v-baacba64",path:"/blog/tags/compact_filters/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"BIP157 ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/BIP157/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/BIP157/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/BIP157/",key:"v-75ccd5f2",path:"/blog/tags/BIP157/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Neutrino ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Neutrino/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Neutrino/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Neutrino/",key:"v-4fed1c23",path:"/blog/tags/Neutrino/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"guide ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/guide/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/guide/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/guide/",key:"v-a9e0285e",path:"/blog/tags/guide/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"descriptor ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/descriptor/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/descriptor/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/descriptor/",key:"v-733ed37c",path:"/blog/tags/descriptor/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"paper wallets ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/paper wallets/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/paper wallets/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/paper%20wallets/",key:"v-1144be8a",path:"/blog/tags/paper wallets/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bitcoin ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bitcoin/",key:"v-915f8322",path:"/blog/tags/bitcoin/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"React Native ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/React Native/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/React Native/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/React%20Native/",key:"v-bf53d4d4",path:"/blog/tags/React Native/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Flutter ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Flutter/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Flutter/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Flutter/",key:"v-07eeb15e",path:"/blog/tags/Flutter/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"iOS ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/iOS/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/iOS/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/iOS/",key:"v-5f023740",path:"/blog/tags/iOS/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Android ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Android/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Android/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Android/",key:"v-414e735e",path:"/blog/tags/Android/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"mobile ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/mobile/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/mobile/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/mobile/",key:"v-2c94bf22",path:"/blog/tags/mobile/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bdk-rn ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bdk-rn/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bdk-rn/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bdk-rn/",key:"v-dd212a9e",path:"/blog/tags/bdk-rn/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bdk ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bdk/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bdk/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bdk/",key:"v-5f07f0f8",path:"/blog/tags/bdk/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"fee ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/fee/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/fee/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/fee/",key:"v-5f0447f2",path:"/blog/tags/fee/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"machine learning ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/machine learning/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/machine learning/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/machine%20learning/",key:"v-e2317b12",path:"/blog/tags/machine learning/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"taproot ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/taproot/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/taproot/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/taproot/",key:"v-57f3a168",path:"/blog/tags/taproot/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"miniscript ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/miniscript/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/miniscript/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/miniscript/",key:"v-ef7c3fa2",path:"/blog/tags/miniscript/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Hardware Wallets ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Hardware Wallets/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Hardware Wallets/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Hardware%20Wallets/",key:"v-640144b2",path:"/blog/tags/Hardware Wallets/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"getting started ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/getting started/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/getting started/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/getting%20started/",key:"v-79c3de4b",path:"/blog/tags/getting started/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"rust ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/rust/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/rust/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/rust/",key:"v-3fee41ed",path:"/blog/tags/rust/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bitcoin-cli ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin-cli/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin-cli/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bitcoin-cli/",key:"v-01a03a08",path:"/blog/tags/bitcoin-cli/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"coin selection ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/coin selection/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/coin selection/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/coin%20selection/",key:"v-74edfe92",path:"/blog/tags/coin selection/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"development ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/development/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/development/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/development/",key:"v-4e62fa1c",path:"/blog/tags/development/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"summer of bitcoin ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/summer of bitcoin/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/summer of bitcoin/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/summer%20of%20bitcoin/",key:"v-0159a747",path:"/blog/tags/summer of bitcoin/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"release ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/release/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/release/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/release/",key:"v-543950a6",path:"/blog/tags/release/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"security ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/security/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/security/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/security/",key:"v-0755ed11",path:"/blog/tags/security/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Steve Myers ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Steve Myers/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Steve Myers/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Steve%20Myers/",key:"v-a354115e",path:"/blog/author/Steve Myers/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Daniela Brozzoni ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Daniela Brozzoni/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Daniela Brozzoni/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Daniela%20Brozzoni/",key:"v-22d0e252",path:"/blog/author/Daniela Brozzoni/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Rajarshi Maitra ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Rajarshi Maitra/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Rajarshi Maitra/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Rajarshi%20Maitra/",key:"v-82e16b5c",path:"/blog/author/Rajarshi Maitra/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"waterst0ne ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/waterst0ne/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/waterst0ne/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/waterst0ne/",key:"v-3e6950f4",path:"/blog/author/waterst0ne/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Lloyd Fournier ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Lloyd Fournier/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Lloyd Fournier/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Lloyd%20Fournier/",key:"v-600b5b28",path:"/blog/author/Lloyd Fournier/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Bitcoin Zavior ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Bitcoin Zavior/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Bitcoin Zavior/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Bitcoin%20Zavior/",key:"v-37829241",path:"/blog/author/Bitcoin Zavior/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"rorp ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/rorp/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/rorp/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/rorp/",key:"v-d2b26530",path:"/blog/author/rorp/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"thunderbiscuit ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/thunderbiscuit/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/thunderbiscuit/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/thunderbiscuit/",key:"v-5d54001e",path:"/blog/author/thunderbiscuit/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Riccardo Casatta ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Riccardo Casatta/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Riccardo Casatta/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Riccardo%20Casatta/",key:"v-624fd61e",path:"/blog/author/Riccardo Casatta/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Gabriele Domenichini ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Gabriele Domenichini/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Gabriele Domenichini/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Gabriele%20Domenichini/",key:"v-6b564fb4",path:"/blog/author/Gabriele Domenichini/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Alekos Filini ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Alekos%20Filini/",key:"v-ad00c09c",path:"/blog/author/Alekos Filini/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Wszdexdrf ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Wszdexdrf/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Wszdexdrf/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Wszdexdrf/",key:"v-4eeab648",path:"/blog/author/Wszdexdrf/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Sandipan Dey ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Sandipan Dey/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Sandipan Dey/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Sandipan%20Dey/",key:"v-91c10894",path:"/blog/author/Sandipan Dey/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"César Alvarez Vallero ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/César Alvarez Vallero/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/César Alvarez Vallero/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/C%C3%A9sar%20Alvarez%20Vallero/",key:"v-a0d840b0",path:"/blog/author/César Alvarez Vallero/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Page 2",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/page/2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/page/2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/page/2/",key:"v-c3507bb6",path:"/blog/page/2/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Page 3",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/page/3/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/page/3/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/page/3/",key:"v-c3507b78",path:"/blog/page/3/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Page 4",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/page/4/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/page/4/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/page/4/",key:"v-c3507b3a",path:"/blog/page/4/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Alekos Filini - Page 2",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/page/2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/page/2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Alekos%20Filini/page/2/",key:"v-5f2ac9cb",path:"/blog/author/Alekos Filini/page/2/",codeSwitcherOptions:{}}],themeConfig:{domain:"https://bitcoindevkit.org",logo:"/img/logo.svg",displayAllHeaders:!1,repo:"bitcoindevkit/bitcoindevkit.org",docsDir:"docs",editLinks:!0,sidebarDepth:0,nav:[{text:"Docs",link:"/getting-started/"},{text:"Adoption",link:"/adoption/all.md"},{text:"Foundation",link:"/foundation/"},{text:"Blog",link:"/blog/"}],sidebar:{"/adoption/":[{title:"Built With BDK",collapsable:!1,children:[["/adoption/all.md","All"],["/adoption/mobile.md","Mobile"],["/adoption/desktop.md","Desktop"],["/adoption/hardware.md","Hardware"],["/adoption/web.md","Web"],["/adoption/custodial.md","Custodial"],["/adoption/exchange.md","Exchange"],["/adoption/infrastructure.md","Infrastructure"]]}],"/_blog/":[{title:"Blog",collapsable:!1,children:[["/blog/","Articles"],["/blog/tags/","Tags"],["/blog/author/","Authors"]]}],"/blog/":[{title:"Blog",collapsable:!1,children:[["/blog/","Articles"],["/blog/tags/","Tags"],["/blog/author/","Authors"]]}],"/foundation/":[{title:"Foundation",collapsable:!1,children:[["/foundation/about.md","About Us"],["/foundation/supporters.md","Supporters"],["/foundation/grantees.md","Grantees"]]}],"/":[{title:"Documentation",collapsable:!1,children:[["/getting-started","Getting Started"],{title:"BDK-CLI",collapsable:!0,children:["/bdk-cli/introduction","/bdk-cli/installation","/bdk-cli/concept","/bdk-cli/interface","/bdk-cli/regtest","/bdk-cli/compiler","/bdk-cli/playground"]},"/descriptors/","/examples/"]},{title:"API Reference",collapsable:!1,children:[["https://docs.rs/bdk_wallet/","Rust Stable Docs"],["https://bitcoindevkit.org/docs-rs/bdk/nightly/latest/bdk_wallet/","Rust Nightly Docs"],["https://bitcoindevkit.org/android/","Android Docs"],["https://bitcoindevkit.org/jvm/","Kotlin/JVM Docs"],["https://bitcoindevkit.org/java/","Java Docs"]]}]},footer:{links:[{title:"Docs",children:[{text:"Getting Started",link:"/getting-started/"},{text:"BDK-CLI",link:"/bdk-cli/installation/"},{text:"Descriptors",link:"/descriptors/"}]},{title:"Community",children:[{text:"GitHub",link:"https://github.com/bitcoindevkit",rel:"noopener noreferrer"},{text:"Nostr",link:"nostr:npub13dk3dke4zm9vdkucm7f6vv7vhqgkevgg3gju9kr2wzumz7nrykdq0dgnvc",rel:"noopener noreferrer"},{text:"Twitter",link:"https://twitter.com/intent/follow?screen_name=bitcoindevkit",rel:"noopener noreferrer"},{text:"Chat on Discord",link:"https://discord.gg/dstn4dQ",rel:"noopener noreferrer"}]},{title:"More",children:[{text:"Blog",link:"/blog/"},{text:"Supporters",link:"/foundation/supporters/"},{text:"BDK Foundation",link:"/foundation/"}]}],copyright:"Copyright © 2024 BDK Developers"}}},{COLOR_MODES:Wc,STORE_ATTR:Hc,setColorMode:Vc}=n(111),qc=t=>"Enter"===t.code||13===(t.keyCode||t.which),Gc=t=>{const e=t.target.matches("#algolia-search-input")&&qc(t);(t.target.matches(".ds-dropdown-menu *")||e)&&document.getElementById("algolia-search-input").blur(),t.target.matches(".ytEmbed")&&(t.preventDefault(),(t=>{const e=t.querySelector("iframe[data-src]");if(e){const t=e.getAttribute("data-src");e.setAttribute("src",t)}})(t.target))};if("undefined"==typeof process||"server"!==process.env.VUE_ENV){const t=window.matchMedia("(prefers-color-scheme: dark)").matches?Wc[1]:Wc[0],e=window.localStorage.getItem(Hc);Vc(Wc.includes(e)?e:t)}n(243);Vn.component("Badge",()=>Promise.all([n.e(0),n.e(8)]).then(n.bind(null,398))),Vn.component("CodeBlock",()=>Promise.all([n.e(0),n.e(9)]).then(n.bind(null,388))),Vn.component("CodeGroup",()=>Promise.all([n.e(0),n.e(10)]).then(n.bind(null,389)));n(244);var Zc={props:{color:{required:!1,default:"rgb(66, 185, 131)"}}},Xc=(n(245),Object(Kc.a)(Zc,(function(){return(0,this._self._c)("div",{staticClass:"spinner",style:{background:this.color}})}),[],!1,null,"1bbcb91a",null).exports);const Yc={name:"Mermaid",props:{id:{type:String,required:!0},graph:{type:String,required:!0}},data:()=>({svg:void 0}),render(t){return void 0===this.svg?t("Loading"):t("div",{domProps:{innerHTML:this.svg,style:"width: 100%"}})},mounted(){n.e(93).then(n.t.bind(null,384,7)).then(t=>{t.initialize({startOnLoad:!0});let e=document.createElement("div");document.body.appendChild(e),t.render(this.id,this.graph,t=>{this.svg=t,document.body.removeChild(e)},e)})},components:{Loading:Xc}};var Jc=n(94),Qc=n.n(Jc);n(246);Vn.component("CodeSwitcher",()=>n.e(44).then(n.bind(null,397)));var tl={tags:{BDK:{key:"BDK",scope:"tags",path:"/blog/tags/BDK/",pageKeys:["v-2c450c3f","v-5e744cf7","v-7c0c45f9","v-3875825f","v-07ff1843","v-9145467a","v-2cf72b39","v-11d64359","v-d0375c8e","v-aeb70fce"]},project:{key:"project",scope:"tags",path:"/blog/tags/project/",pageKeys:["v-2c450c3f","v-5e744cf7"]},tutorial:{key:"tutorial",scope:"tags",path:"/blog/tags/tutorial/",pageKeys:["v-7c0c45f9","v-8bd632d6","v-353b78e1","v-07ff1843","v-56536559","v-f58ec8f2","v-ab5ba3ce"]},"Bitcoin Core":{key:"Bitcoin Core",scope:"tags",path:"/blog/tags/Bitcoin Core/",pageKeys:["v-7c0c45f9"]},RPC:{key:"RPC",scope:"tags",path:"/blog/tags/RPC/",pageKeys:["v-7c0c45f9"]},Wallet:{key:"Wallet",scope:"tags",path:"/blog/tags/Wallet/",pageKeys:["v-7c0c45f9"]},"bdk-cli":{key:"bdk-cli",scope:"tags",path:"/blog/tags/bdk-cli/",pageKeys:["v-8bd632d6","v-0f4d5d15","v-07ff1843","v-ab5ba3ce"]},"multi-sig":{key:"multi-sig",scope:"tags",path:"/blog/tags/multi-sig/",pageKeys:["v-8bd632d6"]},basics:{key:"basics",scope:"tags",path:"/blog/tags/basics/",pageKeys:["v-0f4d5d15"]},novice:{key:"novice",scope:"tags",path:"/blog/tags/novice/",pageKeys:["v-0f4d5d15"]},architecture:{key:"architecture",scope:"tags",path:"/blog/tags/architecture/",pageKeys:["v-2cebe183","v-55969f39"]},"BDK-RN":{key:"BDK-RN",scope:"tags",path:"/blog/tags/BDK-RN/",pageKeys:["v-3eaa044d"]},Development:{key:"Development",scope:"tags",path:"/blog/tags/Development/",pageKeys:["v-3eaa044d","v-11d64359","v-aeb70fce"]},Architecture:{key:"Architecture",scope:"tags",path:"/blog/tags/Architecture/",pageKeys:["v-3eaa044d"]},tor:{key:"tor",scope:"tags",path:"/blog/tags/tor/",pageKeys:["v-353b78e1"]},wallet:{key:"wallet",scope:"tags",path:"/blog/tags/wallet/",pageKeys:["v-353b78e1","v-56536559","v-f58ec8f2"]},blockchain:{key:"blockchain",scope:"tags",path:"/blog/tags/blockchain/",pageKeys:["v-353b78e1"]},bindings:{key:"bindings",scope:"tags",path:"/blog/tags/bindings/",pageKeys:["v-3875825f","v-4dc135e3"]},compact_filters:{key:"compact_filters",scope:"tags",path:"/blog/tags/compact_filters/",pageKeys:["v-07ff1843"]},BIP157:{key:"BIP157",scope:"tags",path:"/blog/tags/BIP157/",pageKeys:["v-07ff1843"]},Neutrino:{key:"Neutrino",scope:"tags",path:"/blog/tags/Neutrino/",pageKeys:["v-07ff1843"]},guide:{key:"guide",scope:"tags",path:"/blog/tags/guide/",pageKeys:["v-9504490e","v-c6756cce","v-56536559","v-f58ec8f2","v-8534b9c2"]},descriptor:{key:"descriptor",scope:"tags",path:"/blog/tags/descriptor/",pageKeys:["v-9504490e","v-c6756cce","v-ab5ba3ce","v-8534b9c2"]},"paper wallets":{key:"paper wallets",scope:"tags",path:"/blog/tags/paper wallets/",pageKeys:["v-9504490e"]},bitcoin:{key:"bitcoin",scope:"tags",path:"/blog/tags/bitcoin/",pageKeys:["v-56536559","v-f58ec8f2"]},"React Native":{key:"React Native",scope:"tags",path:"/blog/tags/React Native/",pageKeys:["v-56536559","v-f58ec8f2"]},Flutter:{key:"Flutter",scope:"tags",path:"/blog/tags/Flutter/",pageKeys:["v-56536559"]},iOS:{key:"iOS",scope:"tags",path:"/blog/tags/iOS/",pageKeys:["v-56536559","v-f58ec8f2"]},Android:{key:"Android",scope:"tags",path:"/blog/tags/Android/",pageKeys:["v-56536559","v-f58ec8f2"]},mobile:{key:"mobile",scope:"tags",path:"/blog/tags/mobile/",pageKeys:["v-56536559","v-f58ec8f2"]},"bdk-rn":{key:"bdk-rn",scope:"tags",path:"/blog/tags/bdk-rn/",pageKeys:["v-56536559","v-f58ec8f2"]},bdk:{key:"bdk",scope:"tags",path:"/blog/tags/bdk/",pageKeys:["v-56536559","v-f58ec8f2","v-ab5ba3ce"]},fee:{key:"fee",scope:"tags",path:"/blog/tags/fee/",pageKeys:["v-015729b9","v-2c605799","v-57698579"]},"machine learning":{key:"machine learning",scope:"tags",path:"/blog/tags/machine learning/",pageKeys:["v-015729b9","v-2c605799","v-57698579"]},taproot:{key:"taproot",scope:"tags",path:"/blog/tags/taproot/",pageKeys:["v-9145467a","v-2cf72b39"]},miniscript:{key:"miniscript",scope:"tags",path:"/blog/tags/miniscript/",pageKeys:["v-9145467a","v-2cf72b39","v-ab5ba3ce","v-10852eea"]},"Hardware Wallets":{key:"Hardware Wallets",scope:"tags",path:"/blog/tags/Hardware Wallets/",pageKeys:["v-11d64359","v-aeb70fce"]},"getting started":{key:"getting started",scope:"tags",path:"/blog/tags/getting started/",pageKeys:["v-5d749fce"]},rust:{key:"rust",scope:"tags",path:"/blog/tags/rust/",pageKeys:["v-5d749fce","v-edd5570e","v-05df4999","v-faad828e","v-0119984e","v-7c3d28f9","v-0df1c3ce","v-75d11339","v-1ac9ef4e"]},"bitcoin-cli":{key:"bitcoin-cli",scope:"tags",path:"/blog/tags/bitcoin-cli/",pageKeys:["v-ab5ba3ce"]},"coin selection":{key:"coin selection",scope:"tags",path:"/blog/tags/coin selection/",pageKeys:["v-d0375c8e"]},development:{key:"development",scope:"tags",path:"/blog/tags/development/",pageKeys:["v-d0375c8e"]},"summer of bitcoin":{key:"summer of bitcoin",scope:"tags",path:"/blog/tags/summer of bitcoin/",pageKeys:["v-d0375c8e"]},release:{key:"release",scope:"tags",path:"/blog/tags/release/",pageKeys:["v-edd5570e","v-05df4999","v-faad828e","v-0119984e","v-7c3d28f9","v-0df1c3ce","v-75d11339","v-1ac9ef4e"]},security:{key:"security",scope:"tags",path:"/blog/tags/security/",pageKeys:["v-10852eea"]}},author:{"Steve Myers":{key:"Steve Myers",scope:"author",path:"/blog/author/Steve Myers/",pageKeys:["v-2c450c3f","v-5e744cf7","v-9504490e","v-8534b9c2"]},"Daniela Brozzoni":{key:"Daniela Brozzoni",scope:"author",path:"/blog/author/Daniela Brozzoni/",pageKeys:["v-2c450c3f","v-aeb70fce"]},"Rajarshi Maitra":{key:"Rajarshi Maitra",scope:"author",path:"/blog/author/Rajarshi Maitra/",pageKeys:["v-7c0c45f9","v-07ff1843","v-ab5ba3ce"]},waterst0ne:{key:"waterst0ne",scope:"author",path:"/blog/author/waterst0ne/",pageKeys:["v-8bd632d6","v-0f4d5d15"]},"Lloyd Fournier":{key:"Lloyd Fournier",scope:"author",path:"/blog/author/Lloyd Fournier/",pageKeys:["v-2cebe183"]},"Bitcoin Zavior":{key:"Bitcoin Zavior",scope:"author",path:"/blog/author/Bitcoin Zavior/",pageKeys:["v-3eaa044d","v-56536559","v-f58ec8f2"]},rorp:{key:"rorp",scope:"author",path:"/blog/author/rorp/",pageKeys:["v-353b78e1"]},thunderbiscuit:{key:"thunderbiscuit",scope:"author",path:"/blog/author/thunderbiscuit/",pageKeys:["v-3875825f","v-8534b9c2","v-4dc135e3"]},"Riccardo Casatta":{key:"Riccardo Casatta",scope:"author",path:"/blog/author/Riccardo Casatta/",pageKeys:["v-9504490e","v-015729b9","v-2c605799","v-57698579"]},"Gabriele Domenichini":{key:"Gabriele Domenichini",scope:"author",path:"/blog/author/Gabriele Domenichini/",pageKeys:["v-c6756cce"]},"Alekos Filini":{key:"Alekos Filini",scope:"author",path:"/blog/author/Alekos Filini/",pageKeys:["v-9145467a","v-2cf72b39","v-5d749fce","v-edd5570e","v-10852eea","v-05df4999","v-faad828e","v-0119984e","v-7c3d28f9","v-0df1c3ce","v-75d11339","v-1ac9ef4e","v-55969f39"]},Wszdexdrf:{key:"Wszdexdrf",scope:"author",path:"/blog/author/Wszdexdrf/",pageKeys:["v-11d64359"]},"Sandipan Dey":{key:"Sandipan Dey",scope:"author",path:"/blog/author/Sandipan Dey/",pageKeys:["v-ab5ba3ce"]},"César Alvarez Vallero":{key:"César Alvarez Vallero",scope:"author",path:"/blog/author/César Alvarez Vallero/",pageKeys:["v-d0375c8e"]}}};class el{constructor(t,e){this._metaMap=Object.assign({},t),Object.keys(this._metaMap).forEach(t=>{const{pageKeys:n}=this._metaMap[t];this._metaMap[t].pages=n.map(t=>function(t,e){for(let n=0;n{const{pages:n,path:o}=this._metaMap[e];t.push({name:e,pages:n,path:o})}),t}getItemByName(t){return this._metaMap[t]}}var nl={blog:(t,e)=>{const o=n(45);return o(t.frontmatter.date)-o(e.frontmatter.date)>0?-1:1},tags:(t,e)=>{const o=n(45);return o(t.frontmatter.date)-o(e.frontmatter.date)>0?-1:1},author:(t,e)=>{const o=n(45);return o(t.frontmatter.date)-o(e.frontmatter.date)>0?-1:1}},ol={blog:function(t,e,n){return t.pid===n&&t.id===e},tags:function(t,e,n){const o=e;return["tags"].some(e=>{const n=t.frontmatter[e];return Array.isArray(n)?n.some(t=>t==o):n==o})},author:function(t,e,n){const o=e;return["author","authors"].some(e=>{const n=t.frontmatter[e];return Array.isArray(n)?n.some(t=>t==o):n==o})}},il=[{pid:"blog",id:"blog",filter:ol.blog,sorter:nl.blog,pages:[{path:"/blog/",interval:[0,9]},{path:"/blog/page/2/",interval:[10,19]},{path:"/blog/page/3/",interval:[20,29]},{path:"/blog/page/4/",interval:[30,36]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"BDK",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/BDK/",interval:[0,9]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"project",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/project/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"tutorial",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/tutorial/",interval:[0,7]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Bitcoin Core",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Bitcoin Core/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"RPC",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/RPC/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Wallet",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Wallet/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bdk-cli",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bdk-cli/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"multi-sig",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/multi-sig/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"basics",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/basics/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"novice",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/novice/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"architecture",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/architecture/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"BDK-RN",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/BDK-RN/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Development",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Development/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Architecture",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Architecture/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"tor",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/tor/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"wallet",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/wallet/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"blockchain",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/blockchain/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bindings",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bindings/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"compact_filters",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/compact_filters/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"BIP157",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/BIP157/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Neutrino",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Neutrino/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"guide",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/guide/",interval:[0,5]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"descriptor",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/descriptor/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"paper wallets",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/paper wallets/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bitcoin",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bitcoin/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"React Native",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/React Native/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Flutter",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Flutter/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"iOS",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/iOS/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Android",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Android/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"mobile",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/mobile/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bdk-rn",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bdk-rn/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bdk",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bdk/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"fee",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/fee/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"machine learning",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/machine learning/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"taproot",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/taproot/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"miniscript",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/miniscript/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Hardware Wallets",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Hardware Wallets/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"getting started",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/getting started/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"rust",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/rust/",interval:[0,9]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bitcoin-cli",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bitcoin-cli/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"coin selection",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/coin selection/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"development",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/development/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"summer of bitcoin",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/summer of bitcoin/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"release",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/release/",interval:[0,8]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"security",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/security/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Steve Myers",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Steve Myers/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Daniela Brozzoni",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Daniela Brozzoni/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Rajarshi Maitra",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Rajarshi Maitra/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"waterst0ne",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/waterst0ne/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Lloyd Fournier",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Lloyd Fournier/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Bitcoin Zavior",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Bitcoin Zavior/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"rorp",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/rorp/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"thunderbiscuit",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/thunderbiscuit/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Riccardo Casatta",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Riccardo Casatta/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Gabriele Domenichini",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Gabriele Domenichini/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Alekos Filini",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Alekos Filini/",interval:[0,9]},{path:"/blog/author/Alekos Filini/page/2/",interval:[10,13]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Wszdexdrf",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Wszdexdrf/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Sandipan Dey",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Sandipan Dey/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"César Alvarez Vallero",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/César Alvarez Vallero/",interval:[0,1]}],prevText:"Prev",nextText:"Next"}],rl=n(95);const al=n.n(rl)()("plugin-blog:pagination");class cl{constructor(t,e,n){al("pagination",t);const{pages:o,prevText:i,nextText:r}=t,{path:a}=n;this._prevText=i,this._nextText=r;for(let t=0,e=o.length;tt.filter(e,t.id,t.pid)).sort(t.sorter)}setIndexPage(t){this._indexPage=t}get length(){return this._paginationPages.length}get pages(){const[t,e]=this._currentPage.interval;return this._matchedPages.slice(t,e+1)}get hasPrev(){return 0!==this.paginationIndex}get prevLink(){return this.hasPrev?this.paginationIndex-1==0&&this._indexPage?this._indexPage:this._paginationPages[this.paginationIndex-1].path:null}get hasNext(){return this.paginationIndex!==this.length-1}get nextLink(){return this.hasNext?this._paginationPages[this.paginationIndex+1].path:null}get prevText(){return this._prevText}get nextText(){return this._nextText}getSpecificPageLink(t){return this._paginationPages[t].path}}const ll=new class{constructor(t){this.paginations=t}get pages(){return Vn.$vuepress.$get("siteData").pages}getPagination(t,e,n){al("id",e),al("pid",t);const o=this.paginations.filter(n=>n.id===e&&n.pid===t)[0];return new cl(o,this.pages,n)}}(il);var sl={comment:{enabled:!1,service:""},email:{enabled:!1},feed:{rss:!1,atom:!1,json:!1}},pl=[({router:t})=>{"undefined"!=typeof process&&"server"===process.env.VUE_ENV||t.onReady(()=>{const{app:e}=t;e.$once("hook:mounted",()=>{setTimeout(()=>{const{hash:t}=document.location;if(t.length>1){const e=t.substring(1),n=document.getElementById(e);n&&n.scrollIntoView()}},500)}),document.addEventListener("click",Gc),document.addEventListener("keyup",t=>{qc(t)&&Gc(t)})})},{},({Vue:t})=>{t.mixin({computed:{$dataBlock(){return this.$options.__data__block__}}})},{},{},({Vue:t})=>{t.component("CodeCopy",Sc)},({Vue:t})=>{t.component("Mermaid",Yc)},({Vue:t})=>t.use(Qc.a),{},{},({Vue:t})=>{const e=Object.keys(tl).map(t=>{const e=tl[t],n="$"+t;return{[n](){const{pages:t}=this.$site;return new el(e,t)},["$current"+(t.charAt(0).toUpperCase()+t.slice(1))](){const t=this.$route.meta.id;return this[n].getItemByName(t)}}}).reduce((t,e)=>(Object.assign(t,e),t),{});e.$frontmatterKey=function(){const t=this["$"+this.$route.meta.id];return t||null},t.mixin({computed:e})},({Vue:t})=>{t.mixin({computed:{$pagination(){return this.$route.meta.pid&&this.$route.meta.id?this.$getPagination(this.$route.meta.pid,this.$route.meta.id):null}},methods:{$getPagination(t,e){return e=e||t,ll.getPagination(t,e,this.$route)}}})},({Vue:t})=>{const e={$service:()=>sl};t.mixin({computed:e})}],dl=[];class ul extends class{constructor(){this.store=new Vn({data:{state:{}}})}$get(t){return this.store.state[t]}$set(t,e){Vn.set(this.store.state,t,e)}$emit(...t){this.store.$emit(...t)}$on(...t){this.store.$on(...t)}}{}Object.assign(ul.prototype,{getPageAsyncComponent:ac,getLayoutAsyncComponent:cc,getAsyncComponent:lc,getVueComponent:sc});var gl={install(t){const e=new ul;t.$vuepress=e,t.prototype.$vuepress=e}};function hl(t,e){const n=e.toLowerCase();return t.options.routes.some(t=>t.path.toLowerCase()===n)}var ml={props:{pageKey:String,slotKey:{type:String,default:"default"}},render(t){const e=this.pageKey||this.$parent.$page.key;return dc("pageKey",e),Vn.component(e)||Vn.component(e,ac(e)),Vn.component(e)?t(e):t("")}},fl={functional:!0,props:{slotKey:String,required:!0},render:(t,{props:e,slots:n})=>t("div",{class:["content__"+e.slotKey]},n()[e.slotKey])},vl={computed:{openInNewWindowTitle(){return this.$themeLocaleConfig.openNewWindowText||"(opens new window)"}}},bl=(n(249),n(250),Object(Kc.a)(vl,(function(){var t=this._self._c;return t("span",[t("svg",{staticClass:"icon outbound",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"}},[t("path",{attrs:{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}}),this._v(" "),t("polygon",{attrs:{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"}})]),this._v(" "),t("span",{staticClass:"sr-only"},[this._v(this._s(this.openInNewWindowTitle))])])}),[],!1,null,null,null).exports),yl={functional:!0,render(t,{parent:e,children:n}){if(e._isMounted)return n;e.$once("hook:mounted",()=>{e.$forceUpdate()})}};Vn.config.productionTip=!1,Vn.use(Wa),Vn.use(gl),Vn.mixin(function(t,e,n=Vn){!function(t){t.locales&&Object.keys(t.locales).forEach(e=>{t.locales[e].path=e});Object.freeze(t)}(e),n.$vuepress.$set("siteData",e);const o=new(t(n.$vuepress.$get("siteData"))),i=Object.getOwnPropertyDescriptors(Object.getPrototypeOf(o)),r={};return Object.keys(i).reduce((t,e)=>(e.startsWith("$")&&(t[e]=i[e].get),t),r),{computed:r}}(t=>class{setPage(t){this.__page=t}get $site(){return t}get $themeConfig(){return this.$site.themeConfig}get $frontmatter(){return this.$page.frontmatter}get $localeConfig(){const{locales:t={}}=this.$site;let e,n;for(const o in t)"/"===o?n=t[o]:0===this.$page.path.indexOf(o)&&(e=t[o]);return e||n||{}}get $siteTitle(){return this.$localeConfig.title||this.$site.title||""}get $canonicalUrl(){const{canonicalUrl:t}=this.$page.frontmatter;return"string"==typeof t&&t}get $title(){const t=this.$page,{metaTitle:e}=this.$page.frontmatter;if("string"==typeof e)return e;const n=this.$siteTitle,o=t.frontmatter.home?null:t.frontmatter.title||t.title;return n?o?o+" | "+n:n:o||"VuePress"}get $description(){const t=function(t){if(t){const e=t.filter(t=>"description"===t.name)[0];if(e)return e.content}}(this.$page.frontmatter.meta);return t||(this.$page.frontmatter.description||this.$localeConfig.description||this.$site.description||"")}get $lang(){return this.$page.frontmatter.lang||this.$localeConfig.lang||"en-US"}get $localePath(){return this.$localeConfig.path||"/"}get $themeLocaleConfig(){return(this.$site.themeConfig.locales||{})[this.$localePath]||{}}get $page(){return this.__page?this.__page:function(t,e){for(let n=0;nn||(t.hash?!Vn.$vuepress.$get("disableScrollBehavior")&&{selector:decodeURIComponent(t.hash)}:{x:0,y:0})});!function(t){t.beforeEach((e,n,o)=>{if(hl(t,e.path))o();else if(/(\/|\.html)$/.test(e.path))if(/\/$/.test(e.path)){const n=e.path.replace(/\/$/,"")+".html";hl(t,n)?o(n):o()}else o();else{const n=e.path+"/",i=e.path+".html";hl(t,i)?o(i):hl(t,n)?o(n):o()}})}(n);const o={};try{await Promise.all(pl.filter(t=>"function"==typeof t).map(e=>e({Vue:Vn,options:o,router:n,siteData:zc,isServer:t})))}catch(t){console.error(t)}return{app:new Vn(Object.assign(o,{router:n,render:t=>t("div",{attrs:{id:"app"}},[t("RouterView",{ref:"layout"}),t("div",{class:"global-ui"},dl.map(e=>t(e)))])})),router:n}}(!1).then(({app:t,router:e})=>{e.onReady(()=>{t.$mount("#app")})})}]); \ No newline at end of file +var o=Object.freeze({}),i=Array.isArray;function r(t){return null==t}function a(t){return null!=t}function c(t){return!0===t}function l(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function s(t){return"function"==typeof t}function p(t){return null!==t&&"object"==typeof t}var d=Object.prototype.toString;function u(t){return"[object Object]"===d.call(t)}function g(t){return"[object RegExp]"===d.call(t)}function h(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function m(t){return a(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function f(t){return null==t?"":Array.isArray(t)||u(t)&&t.toString===d?JSON.stringify(t,null,2):String(t)}function v(t){var e=parseFloat(t);return isNaN(e)?t:e}function b(t,e){for(var n=Object.create(null),o=t.split(","),i=0;i-1)return t.splice(o,1)}}var k=Object.prototype.hasOwnProperty;function _(t,e){return k.call(t,e)}function B(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var D=/-(\w)/g,x=B((function(t){return t.replace(D,(function(t,e){return e?e.toUpperCase():""}))})),P=B((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),K=/\B([A-Z])/g,S=B((function(t){return t.replace(K,"-$1").toLowerCase()}));var T=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var o=arguments.length;return o?o>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function O(t,e){e=e||0;for(var n=t.length-e,o=new Array(n);n--;)o[n]=t[n+e];return o}function C(t,e){for(var n in e)t[n]=e[n];return t}function A(t){for(var e={},n=0;n0,J=Z&&Z.indexOf("edge/")>0;Z&&Z.indexOf("android");var Q=Z&&/iphone|ipad|ipod|ios/.test(Z);Z&&/chrome\/\d+/.test(Z),Z&&/phantomjs/.test(Z);var tt,et=Z&&Z.match(/firefox\/(\d+)/),nt={}.watch,ot=!1;if(G)try{var it={};Object.defineProperty(it,"passive",{get:function(){ot=!0}}),window.addEventListener("test-passive",null,it)}catch(t){}var rt=function(){return void 0===tt&&(tt=!G&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),tt},at=G&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ct(t){return"function"==typeof t&&/native code/.test(t.toString())}var lt,st="undefined"!=typeof Symbol&&ct(Symbol)&&"undefined"!=typeof Reflect&&ct(Reflect.ownKeys);lt="undefined"!=typeof Set&&ct(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var pt=null;function dt(t){void 0===t&&(t=null),t||pt&&pt._scope.off(),pt=t,t&&t._scope.on()}var ut=function(){function t(t,e,n,o,i,r,a,c){this.tag=t,this.data=e,this.children=n,this.text=o,this.elm=i,this.ns=void 0,this.context=r,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=c,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),gt=function(t){void 0===t&&(t="");var e=new ut;return e.text=t,e.isComment=!0,e};function ht(t){return new ut(void 0,void 0,void 0,String(t))}function mt(t){var e=new ut(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var ft=0,vt=[],bt=function(){function t(){this._pending=!1,this.id=ft++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,vt.push(this))},t.prototype.depend=function(e){t.target&&t.target.addDep(this)},t.prototype.notify=function(t){var e=this.subs.filter((function(t){return t}));for(var n=0,o=e.length;n0&&(Zt((s=t(s,"".concat(n||"","_").concat(o)))[0])&&Zt(d)&&(u[p]=ht(d.text+s[0].text),s.shift()),u.push.apply(u,s)):l(s)?Zt(d)?u[p]=ht(d.text+s):""!==s&&u.push(ht(s)):Zt(s)&&Zt(d)?u[p]=ht(d.text+s.text):(c(e._isVList)&&a(s.tag)&&r(s.key)&&a(n)&&(s.key="__vlist".concat(n,"_").concat(o,"__")),u.push(s)));return u}(t):void 0}function Zt(t){return a(t)&&a(t.text)&&!1===t.isComment}function Xt(t,e){var n,o,r,c,l=null;if(i(t)||"string"==typeof t)for(l=new Array(t.length),n=0,o=t.length;n0,c=e?!!e.$stable:!a,l=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(c&&i&&i!==o&&l===i.$key&&!a&&!i.$hasNormal)return i;for(var s in r={},e)e[s]&&"$"!==s[0]&&(r[s]=me(t,n,s,e[s]))}else r={};for(var p in n)p in r||(r[p]=fe(n,p));return e&&Object.isExtensible(e)&&(e._normalized=r),H(r,"$stable",c),H(r,"$key",l),H(r,"$hasNormal",a),r}function me(t,e,n,o){var r=function(){var e=pt;dt(t);var n=arguments.length?o.apply(null,arguments):o({}),r=(n=n&&"object"==typeof n&&!i(n)?[n]:Gt(n))&&n[0];return dt(e),n&&(!r||1===n.length&&r.isComment&&!ge(r))?void 0:n};return o.proxy&&Object.defineProperty(e,n,{get:r,enumerable:!0,configurable:!0}),r}function fe(t,e){return function(){return t[e]}}function ve(t){return{get attrs(){if(!t._attrsProxy){var e=t._attrsProxy={};H(e,"_v_attr_proxy",!0),be(e,t.$attrs,o,t,"$attrs")}return t._attrsProxy},get listeners(){t._listenersProxy||be(t._listenersProxy={},t.$listeners,o,t,"$listeners");return t._listenersProxy},get slots(){return function(t){t._slotsProxy||we(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(t)},emit:T(t.$emit,t),expose:function(e){e&&Object.keys(e).forEach((function(n){return It(t,e,n)}))}}}function be(t,e,n,o,i){var r=!1;for(var a in e)a in t?e[a]!==n[a]&&(r=!0):(r=!0,ye(t,a,o,i));for(var a in t)a in e||(r=!0,delete t[a]);return r}function ye(t,e,n,o){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[o][e]}})}function we(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var ke=null;function _e(t,e){return(t.__esModule||st&&"Module"===t[Symbol.toStringTag])&&(t=t.default),p(t)?e.extend(t):t}function Be(t){if(i(t))for(var e=0;edocument.createEvent("Event").timeStamp&&(ln=function(){return sn.now()})}var pn=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function dn(){var t,e;for(cn=ln(),rn=!0,tn.sort(pn),an=0;anan&&tn[n].id>t.id;)n--;tn.splice(n+1,0,t)}else tn.push(t);on||(on=!0,Re(dn))}}function gn(t,e){if(t){for(var n=Object.create(null),o=st?Reflect.ownKeys(t):Object.keys(t),i=0;i-1)if(r&&!_(i,"default"))a=!1;else if(""===a||a===S(t)){var l=$n(String,i.type);(l<0||c-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!g(t)&&t.test(e)}function Xn(t,e){var n=t.cache,o=t.keys,i=t._vnode;for(var r in n){var a=n[r];if(a){var c=a.name;c&&!e(c)&&Yn(n,r,o,i)}}}function Yn(t,e,n,o){var i=t[e];!i||o&&i.tag===o.tag||i.componentInstance.$destroy(),t[e]=null,w(n,e)}Vn.prototype._init=function(t){var e=this;e._uid=Wn++,e._isVue=!0,e.__v_skip=!0,e._scope=new Nt(!0),e._scope._vm=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),o=e._parentVnode;n.parent=e.parent,n._parentVnode=o;var i=o.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Tn(Hn(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Ge(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,i=n&&n.context;t.$slots=de(e._renderChildren,i),t.$scopedSlots=n?he(t.$parent,n.data.scopedSlots,t.$slots):o,t._c=function(e,n,o,i){return De(t,e,n,o,i,!1)},t.$createElement=function(e,n,o,i){return De(t,e,n,o,i,!0)};var r=n&&n.data;Ct(t,"$attrs",r&&r.attrs||o,null,!0),Ct(t,"$listeners",e._parentListeners||o,null,!0)}(e),Qe(e,"beforeCreate",void 0,!1),function(t){var e=gn(t.$options.inject,t);e&&(Kt(!1),Object.keys(e).forEach((function(n){Ct(t,n,e[n])})),Kt(!0))}(e),Rn(e),function(t){var e=t.$options.provide;if(e){var n=s(e)?e.call(t):e;if(!p(n))return;for(var o=Ut(t),i=st?Reflect.ownKeys(n):Object.keys(n),r=0;r1?O(n):n;for(var o=O(arguments,1),i='event handler for "'.concat(t,'"'),r=0,a=n.length;rparseInt(this.max)&&Yn(t,e[0],e,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Yn(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Xn(t,(function(t){return Zn(e,t)}))})),this.$watch("exclude",(function(e){Xn(t,(function(t){return!Zn(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Be(t),n=e&&e.componentOptions;if(n){var o=Gn(n),i=this.include,r=this.exclude;if(i&&(!o||!Zn(i,o))||r&&o&&Zn(r,o))return e;var a=this.cache,c=this.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;a[l]?(e.componentInstance=a[l].componentInstance,w(c,l),c.push(l)):(this.vnodeToCache=e,this.keyToCache=l),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return U}};Object.defineProperty(t,"config",e),t.util={warn:_n,extend:C,mergeOptions:Tn,defineReactive:Ct},t.set=At,t.delete=Et,t.nextTick=Re,t.observable=function(t){return Ot(t),t},t.options=Object.create(null),L.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,C(t.options.components,Qn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=O(arguments,1);return n.unshift(this),s(t.install)?t.install.apply(t,n):s(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Tn(this.options,t),this}}(t),qn(t),function(t){L.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&u(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&s(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(Vn),Object.defineProperty(Vn.prototype,"$isServer",{get:rt}),Object.defineProperty(Vn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Vn,"FunctionalRenderContext",{value:hn}),Vn.version="2.7.14";var to=b("style,class"),eo=b("input,textarea,option,select,progress"),no=b("contenteditable,draggable,spellcheck"),oo=b("events,caret,typing,plaintext-only"),io=b("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),ro="http://www.w3.org/1999/xlink",ao=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},co=function(t){return ao(t)?t.slice(6,t.length):""},lo=function(t){return null==t||!1===t};function so(t){for(var e=t.data,n=t,o=t;a(o.componentInstance);)(o=o.componentInstance._vnode)&&o.data&&(e=po(o.data,e));for(;a(n=n.parent);)n&&n.data&&(e=po(e,n.data));return function(t,e){if(a(t)||a(e))return uo(t,go(e));return""}(e.staticClass,e.class)}function po(t,e){return{staticClass:uo(t.staticClass,e.staticClass),class:a(t.class)?[t.class,e.class]:e.class}}function uo(t,e){return t?e?t+" "+e:t:e||""}function go(t){return Array.isArray(t)?function(t){for(var e,n="",o=0,i=t.length;o-1?Mo(t,e,n):io(e)?lo(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):no(e)?t.setAttribute(e,function(t,e){return lo(e)||"false"===e?"false":"contenteditable"===t&&oo(e)?e:"true"}(e,n)):ao(e)?lo(n)?t.removeAttributeNS(ro,co(e)):t.setAttributeNS(ro,e,n):Mo(t,e,n)}function Mo(t,e,n){if(lo(n))t.removeAttribute(e);else{if(X&&!Y&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var o=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",o)};t.addEventListener("input",o),t.__ieph=!0}t.setAttribute(e,n)}}var Ro={create:$o,update:$o};function Io(t,e){var n=e.elm,o=e.data,i=t.data;if(!(r(o.staticClass)&&r(o.class)&&(r(i)||r(i.staticClass)&&r(i.class)))){var c=so(e),l=n._transitionClasses;a(l)&&(c=uo(c,go(l))),c!==n._prevClass&&(n.setAttribute("class",c),n._prevClass=c)}}var Lo,No={create:Io,update:Io};function Uo(t,e,n){var o=Lo;return function i(){var r=e.apply(null,arguments);null!==r&&Ho(t,i,n,o)}}var zo=Oe&&!(et&&Number(et[1])<=53);function Wo(t,e,n,o){if(zo){var i=cn,r=e;e=r._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=i||t.timeStamp<=0||t.target.ownerDocument!==document)return r.apply(this,arguments)}}Lo.addEventListener(t,e,ot?{capture:n,passive:o}:n)}function Ho(t,e,n,o){(o||Lo).removeEventListener(t,e._wrapper||e,n)}function Vo(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},o=t.data.on||{};Lo=e.elm||t.elm,function(t){if(a(t.__r)){var e=X?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}a(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),Ht(n,o,Wo,Ho,Uo,e.context),Lo=void 0}}var qo,Go={create:Vo,update:Vo,destroy:function(t){return Vo(t,Do)}};function Zo(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,o,i=e.elm,l=t.data.domProps||{},s=e.data.domProps||{};for(n in(a(s.__ob__)||c(s._v_attr_proxy))&&(s=e.data.domProps=C({},s)),l)n in s||(i[n]="");for(n in s){if(o=s[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===l[n])continue;1===i.childNodes.length&&i.removeChild(i.childNodes[0])}if("value"===n&&"PROGRESS"!==i.tagName){i._value=o;var p=r(o)?"":String(o);Xo(i,p)&&(i.value=p)}else if("innerHTML"===n&&fo(i.tagName)&&r(i.innerHTML)){(qo=qo||document.createElement("div")).innerHTML="".concat(o,"");for(var d=qo.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;d.firstChild;)i.appendChild(d.firstChild)}else if(o!==l[n])try{i[n]=o}catch(t){}}}}function Xo(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,o=t._vModifiers;if(a(o)){if(o.number)return v(n)!==v(e);if(o.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Yo={create:Zo,update:Zo},Jo=B((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var o=t.split(n);o.length>1&&(e[o[0].trim()]=o[1].trim())}})),e}));function Qo(t){var e=ti(t.style);return t.staticStyle?C(t.staticStyle,e):e}function ti(t){return Array.isArray(t)?A(t):"string"==typeof t?Jo(t):t}var ei,ni=/^--/,oi=/\s*!important$/,ii=function(t,e,n){if(ni.test(e))t.style.setProperty(e,n);else if(oi.test(n))t.style.setProperty(S(e),n.replace(oi,""),"important");else{var o=ai(e);if(Array.isArray(n))for(var i=0,r=n.length;i-1?e.split(si).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function di(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(si).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),o=" "+e+" ";n.indexOf(o)>=0;)n=n.replace(o," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function ui(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&C(e,gi(t.name||"v")),C(e,t),e}return"string"==typeof t?gi(t):void 0}}var gi=B((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),hi=G&&!Y,mi="transition",fi="transitionend",vi="animation",bi="animationend";hi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(mi="WebkitTransition",fi="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(vi="WebkitAnimation",bi="webkitAnimationEnd"));var yi=G?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function wi(t){yi((function(){yi(t)}))}function ki(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),pi(t,e))}function _i(t,e){t._transitionClasses&&w(t._transitionClasses,e),di(t,e)}function Bi(t,e,n){var o=xi(t,e),i=o.type,r=o.timeout,a=o.propCount;if(!i)return n();var c="transition"===i?fi:bi,l=0,s=function(){t.removeEventListener(c,p),n()},p=function(e){e.target===t&&++l>=a&&s()};setTimeout((function(){l0&&(n="transition",p=a,d=r.length):"animation"===e?s>0&&(n="animation",p=s,d=l.length):d=(n=(p=Math.max(a,s))>0?a>s?"transition":"animation":null)?"transition"===n?r.length:l.length:0,{type:n,timeout:p,propCount:d,hasTransform:"transition"===n&&Di.test(o[mi+"Property"])}}function Pi(t,e){for(;t.length1}function Ai(t,e){!0!==e.data.show&&Si(e)}var Ei=function(t){var e,n,o={},s=t.modules,p=t.nodeOps;for(e=0;eh?w(t,r(n[v+1])?null:n[v+1].elm,n,g,v,o):g>v&&_(e,d,h)}(d,m,v,n,s):a(v)?(a(t.text)&&p.setTextContent(d,""),w(d,null,v,0,v.length-1,n)):a(m)?_(m,0,m.length-1):a(t.text)&&p.setTextContent(d,""):t.text!==e.text&&p.setTextContent(d,e.text),a(h)&&a(g=h.hook)&&a(g=g.postpatch)&&g(t,e)}}}function P(t,e,n){if(c(n)&&a(t.parent))t.parent.data.pendingInsert=e;else for(var o=0;o-1,a.selected!==r&&(a.selected=r);else if(j(Ri(a),o))return void(t.selectedIndex!==c&&(t.selectedIndex=c));i||(t.selectedIndex=-1)}}function Mi(t,e){return e.every((function(e){return!j(e,t)}))}function Ri(t){return"_value"in t?t._value:t.value}function Ii(t){t.target.composing=!0}function Li(t){t.target.composing&&(t.target.composing=!1,Ni(t.target,"input"))}function Ni(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Ui(t){return!t.componentInstance||t.data&&t.data.transition?t:Ui(t.componentInstance._vnode)}var zi={model:Fi,show:{bind:function(t,e,n){var o=e.value,i=(n=Ui(n)).data&&n.data.transition,r=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;o&&i?(n.data.show=!0,Si(n,(function(){t.style.display=r}))):t.style.display=o?r:"none"},update:function(t,e,n){var o=e.value;!o!=!e.oldValue&&((n=Ui(n)).data&&n.data.transition?(n.data.show=!0,o?Si(n,(function(){t.style.display=t.__vOriginalDisplay})):Ti(n,(function(){t.style.display="none"}))):t.style.display=o?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,o,i){i||(t.style.display=t.__vOriginalDisplay)}}},Wi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Hi(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Hi(Be(e.children)):t}function Vi(t){var e={},n=t.$options;for(var o in n.propsData)e[o]=t[o];var i=n._parentListeners;for(var o in i)e[x(o)]=i[o];return e}function qi(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Gi=function(t){return t.tag||ge(t)},Zi=function(t){return"show"===t.name},Xi={name:"transition",props:Wi,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Gi)).length){0;var o=this.mode;0;var i=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return i;var r=Hi(i);if(!r)return i;if(this._leaving)return qi(t,i);var a="__transition-".concat(this._uid,"-");r.key=null==r.key?r.isComment?a+"comment":a+r.tag:l(r.key)?0===String(r.key).indexOf(a)?r.key:a+r.key:r.key;var c=(r.data||(r.data={})).transition=Vi(this),s=this._vnode,p=Hi(s);if(r.data.directives&&r.data.directives.some(Zi)&&(r.data.show=!0),p&&p.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(r,p)&&!ge(p)&&(!p.componentInstance||!p.componentInstance._vnode.isComment)){var d=p.data.transition=C({},c);if("out-in"===o)return this._leaving=!0,Vt(d,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),qi(t,i);if("in-out"===o){if(ge(r))return s;var u,g=function(){u()};Vt(c,"afterEnter",g),Vt(c,"enterCancelled",g),Vt(d,"delayLeave",(function(t){u=t}))}}return i}}},Yi=C({tag:String,moveClass:String},Wi);function Ji(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Qi(t){t.data.newPos=t.elm.getBoundingClientRect()}function tr(t){var e=t.data.pos,n=t.data.newPos,o=e.left-n.left,i=e.top-n.top;if(o||i){t.data.moved=!0;var r=t.elm.style;r.transform=r.WebkitTransform="translate(".concat(o,"px,").concat(i,"px)"),r.transitionDuration="0s"}}delete Yi.mode;var er={Transition:Xi,TransitionGroup:{props:Yi,beforeMount:function(){var t=this,e=this._update;this._update=function(n,o){var i=Xe(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,o)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),o=this.prevChildren=this.children,i=this.$slots.default||[],r=this.children=[],a=Vi(this),c=0;c-1?bo[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:bo[t]=/HTMLUnknownElement/.test(e.toString())},C(Vn.options.directives,zi),C(Vn.options.components,er),Vn.prototype.__patch__=G?Ei:E,Vn.prototype.$mount=function(t,e){return function(t,e,n){var o;t.$el=e,t.$options.render||(t.$options.render=gt),Qe(t,"beforeMount"),o=function(){t._update(t._render(),n)},new We(t,o,E,{before:function(){t._isMounted&&!t._isDestroyed&&Qe(t,"beforeUpdate")}},!0),n=!1;var i=t._preWatchers;if(i)for(var r=0;r=0&&(e=t.slice(o),t=t.slice(0,o));var i=t.indexOf("?");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{path:t,query:n,hash:e}}(i.path||""),s=e&&e.path||"/",p=l.path?_r(l.path,s,n||i.append):s,d=function(t,e,n){void 0===e&&(e={});var o,i=n||sr;try{o=i(t||"")}catch(t){o={}}for(var r in e){var a=e[r];o[r]=Array.isArray(a)?a.map(lr):lr(a)}return o}(l.query,i.query,o&&o.options.parseQuery),u=i.hash||l.hash;return u&&"#"!==u.charAt(0)&&(u="#"+u),{_normalized:!0,path:p,query:d,hash:u}}var zr,Wr=function(){},Hr={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(t){var e=this,n=this.$router,o=this.$route,i=n.resolve(this.to,o,this.append),r=i.location,a=i.route,c=i.href,l={},s=n.options.linkActiveClass,p=n.options.linkExactActiveClass,d=null==s?"router-link-active":s,u=null==p?"router-link-exact-active":p,g=null==this.activeClass?d:this.activeClass,h=null==this.exactActiveClass?u:this.exactActiveClass,m=a.redirectedFrom?ur(null,Ur(a.redirectedFrom),null,n):a;l[h]=vr(o,m,this.exactPath),l[g]=this.exact||this.exactPath?l[h]:function(t,e){return 0===t.path.replace(dr,"/").indexOf(e.path.replace(dr,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(o,m);var f=l[h]?this.ariaCurrentValue:null,v=function(t){Vr(t)&&(e.replace?n.replace(r,Wr):n.push(r,Wr))},b={click:Vr};Array.isArray(this.event)?this.event.forEach((function(t){b[t]=v})):b[this.event]=v;var y={class:l},w=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:c,route:a,navigate:v,isActive:l[g],isExactActive:l[h]});if(w){if(1===w.length)return w[0];if(w.length>1||!w.length)return 0===w.length?t():t("span",{},w)}if("a"===this.tag)y.on=b,y.attrs={href:c,"aria-current":f};else{var k=function t(e){var n;if(e)for(var o=0;o-1&&(c.params[u]=n.params[u]);return c.path=Nr(p.path,c.params),l(p,c,a)}if(c.path){c.params={};for(var g=0;g-1}function Ba(t,e){return _a(t)&&t._isRouter&&(null==e||t.type===e)}function Da(t,e,n){var o=function(i){i>=t.length?n():t[i]?e(t[i],(function(){o(i+1)})):o(i+1)};o(0)}function xa(t){return function(e,n,o){var i=!1,r=0,a=null;Pa(t,(function(t,e,n,c){if("function"==typeof t&&void 0===t.cid){i=!0,r++;var l,s=Ta((function(e){var i;((i=e).__esModule||Sa&&"Module"===i[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:zr.extend(e),n.components[c]=e,--r<=0&&o()})),p=Ta((function(t){var e="Failed to resolve async component "+c+": "+t;a||(a=_a(t)?t:new Error(e),o(a))}));try{l=t(s,p)}catch(t){p(t)}if(l)if("function"==typeof l.then)l.then(s,p);else{var d=l.component;d&&"function"==typeof d.then&&d.then(s,p)}}})),i||o()}}function Pa(t,e){return Ka(t.map((function(t){return Object.keys(t.components).map((function(n){return e(t.components[n],t.instances[n],t,n)}))})))}function Ka(t){return Array.prototype.concat.apply([],t)}var Sa="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ta(t){var e=!1;return function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];if(!e)return e=!0,t.apply(this,n)}}var Oa=function(t,e){this.router=t,this.base=function(t){if(!t)if(qr){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=hr,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Ca(t,e,n,o){var i=Pa(t,(function(t,o,i,r){var a=function(t,e){"function"!=typeof t&&(t=zr.extend(t));return t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return n(t,o,i,r)})):n(a,o,i,r)}));return Ka(o?i.reverse():i)}function Aa(t,e){if(e)return function(){return t.apply(e,arguments)}}Oa.prototype.listen=function(t){this.cb=t},Oa.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},Oa.prototype.onError=function(t){this.errorCbs.push(t)},Oa.prototype.transitionTo=function(t,e,n){var o,i=this;try{o=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var r=this.current;this.confirmTransition(o,(function(){i.updateRoute(o),e&&e(o),i.ensureURL(),i.router.afterHooks.forEach((function(t){t&&t(o,r)})),i.ready||(i.ready=!0,i.readyCbs.forEach((function(t){t(o)})))}),(function(t){n&&n(t),t&&!i.ready&&(Ba(t,va.redirected)&&r===hr||(i.ready=!0,i.readyErrorCbs.forEach((function(e){e(t)}))))}))},Oa.prototype.confirmTransition=function(t,e,n){var o=this,i=this.current;this.pending=t;var r,a,c=function(t){!Ba(t)&&_a(t)&&(o.errorCbs.length?o.errorCbs.forEach((function(e){e(t)})):console.error(t)),n&&n(t)},l=t.matched.length-1,s=i.matched.length-1;if(vr(t,i)&&l===s&&t.matched[l]===i.matched[s])return this.ensureURL(),t.hash&&ra(this.router,i,t,!1),c(((a=wa(r=i,t,va.duplicated,'Avoided redundant navigation to current location: "'+r.fullPath+'".')).name="NavigationDuplicated",a));var p=function(t,e){var n,o=Math.max(t.length,e.length);for(n=0;n0)){var e=this.router,n=e.options.scrollBehavior,o=ha&&n;o&&this.listeners.push(ia());var i=function(){var n=t.current,i=Fa(t.base);t.current===hr&&i===t._startLocation||t.transitionTo(i,(function(t){o&&ra(e,t,n,!0)}))};window.addEventListener("popstate",i),this.listeners.push((function(){window.removeEventListener("popstate",i)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){ma(Br(o.base+t.fullPath)),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){fa(Br(o.base+t.fullPath)),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.ensureURL=function(t){if(Fa(this.base)!==this.current.fullPath){var e=Br(this.base+this.current.fullPath);t?ma(e):fa(e)}},e.prototype.getCurrentLocation=function(){return Fa(this.base)},e}(Oa);function Fa(t){var e=window.location.pathname,n=e.toLowerCase(),o=t.toLowerCase();return!t||n!==o&&0!==n.indexOf(Br(o+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var $a=function(t){function e(e,n,o){t.call(this,e,n),o&&function(t){var e=Fa(t);if(!/^\/#/.test(e))return window.location.replace(Br(t+"/#"+e)),!0}(this.base)||ja()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,n=ha&&e;n&&this.listeners.push(ia());var o=function(){var e=t.current;ja()&&t.transitionTo(Ma(),(function(o){n&&ra(t.router,o,e,!0),ha||La(o.fullPath)}))},i=ha?"popstate":"hashchange";window.addEventListener(i,o),this.listeners.push((function(){window.removeEventListener(i,o)}))}},e.prototype.push=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){Ia(t.fullPath),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){La(t.fullPath),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;Ma()!==e&&(t?Ia(e):La(e))},e.prototype.getCurrentLocation=function(){return Ma()},e}(Oa);function ja(){var t=Ma();return"/"===t.charAt(0)||(La("/"+t),!1)}function Ma(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Ra(t){var e=window.location.href,n=e.indexOf("#");return(n>=0?e.slice(0,n):e)+"#"+t}function Ia(t){ha?ma(Ra(t)):window.location.hash=t}function La(t){ha?fa(Ra(t)):window.location.replace(Ra(t))}var Na=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var o=this;this.transitionTo(t,(function(t){o.stack=o.stack.slice(0,o.index+1).concat(t),o.index++,e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var o=this;this.transitionTo(t,(function(t){o.stack=o.stack.slice(0,o.index).concat(t),e&&e(t)}),n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var o=this.stack[n];this.confirmTransition(o,(function(){var t=e.current;e.index=n,e.updateRoute(o),e.router.afterHooks.forEach((function(e){e&&e(o,t)}))}),(function(t){Ba(t,va.duplicated)&&(e.index=n)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Oa),Ua=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Xr(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!ha&&!1!==t.fallback,this.fallback&&(e="hash"),qr||(e="abstract"),this.mode=e,e){case"history":this.history=new Ea(this,t.base);break;case"hash":this.history=new $a(this,t.base,this.fallback);break;case"abstract":this.history=new Na(this,t.base);break;default:0}},za={currentRoute:{configurable:!0}};Ua.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},za.currentRoute.get=function(){return this.history&&this.history.current},Ua.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var n=this.history;if(n instanceof Ea||n instanceof $a){var o=function(t){n.setupListeners(),function(t){var o=n.current,i=e.options.scrollBehavior;ha&&i&&"fullPath"in t&&ra(e,t,o,!1)}(t)};n.transitionTo(n.getCurrentLocation(),o,o)}n.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Ua.prototype.beforeEach=function(t){return Ha(this.beforeHooks,t)},Ua.prototype.beforeResolve=function(t){return Ha(this.resolveHooks,t)},Ua.prototype.afterEach=function(t){return Ha(this.afterHooks,t)},Ua.prototype.onReady=function(t,e){this.history.onReady(t,e)},Ua.prototype.onError=function(t){this.history.onError(t)},Ua.prototype.push=function(t,e,n){var o=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){o.history.push(t,e,n)}));this.history.push(t,e,n)},Ua.prototype.replace=function(t,e,n){var o=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){o.history.replace(t,e,n)}));this.history.replace(t,e,n)},Ua.prototype.go=function(t){this.history.go(t)},Ua.prototype.back=function(){this.go(-1)},Ua.prototype.forward=function(){this.go(1)},Ua.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Ua.prototype.resolve=function(t,e,n){var o=Ur(t,e=e||this.history.current,n,this),i=this.match(o,e),r=i.redirectedFrom||i.fullPath;return{location:o,route:i,href:function(t,e,n){var o="hash"===n?"#"+e:e;return t?Br(t+"/"+o):o}(this.history.base,r,this.mode),normalizedTo:o,resolved:i}},Ua.prototype.getRoutes=function(){return this.matcher.getRoutes()},Ua.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==hr&&this.history.transitionTo(this.history.getCurrentLocation())},Ua.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==hr&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Ua.prototype,za);var Wa=Ua;function Ha(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}Ua.install=function t(e){if(!t.installed||zr!==e){t.installed=!0,zr=e;var n=function(t){return void 0!==t},o=function(t,e){var o=t.$options._parentVnode;n(o)&&n(o=o.data)&&n(o=o.registerRouteInstance)&&o(t,e)};e.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,o(this,this)},destroyed:function(){o(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",wr),e.component("RouterLink",Hr);var i=e.config.optionMergeStrategies;i.beforeRouteEnter=i.beforeRouteLeave=i.beforeRouteUpdate=i.created}},Ua.version="3.6.5",Ua.isNavigationFailure=Ba,Ua.NavigationFailureType=va,Ua.START_LOCATION=hr,qr&&window.Vue&&window.Vue.use(Ua);n(53);n(100),n(46);var Va={"components/AlgoliaSearchBox":()=>Promise.all([n.e(0),n.e(23)]).then(n.bind(null,326)),"components/DropdownLink":()=>Promise.all([n.e(0),n.e(22)]).then(n.bind(null,287)),"components/DropdownTransition":()=>Promise.all([n.e(0),n.e(32)]).then(n.bind(null,262)),"components/Home":()=>Promise.all([n.e(0),n.e(27)]).then(n.bind(null,327)),"components/NavLink":()=>n.e(43).then(n.bind(null,254)),"components/NavLinks":()=>Promise.all([n.e(0),n.e(20)]).then(n.bind(null,276)),"components/Navbar":()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,286)),"components/Page":()=>Promise.all([n.e(0),n.e(18)]).then(n.bind(null,298)),"components/PageEdit":()=>Promise.all([n.e(0),n.e(28)]).then(n.bind(null,288)),"components/PageNav":()=>Promise.all([n.e(0),n.e(24)]).then(n.bind(null,289)),"components/Sidebar":()=>Promise.all([n.e(0),n.e(16)]).then(n.bind(null,269)),"components/SidebarButton":()=>Promise.all([n.e(0),n.e(33)]).then(n.bind(null,329)),"components/SidebarGroup":()=>Promise.all([n.e(0),n.e(7)]).then(n.bind(null,265)),"components/SidebarLink":()=>Promise.all([n.e(0),n.e(30)]).then(n.bind(null,263)),"components/SidebarLinks":()=>Promise.all([n.e(0),n.e(7)]).then(n.bind(null,256)),"global-components/Badge":()=>Promise.all([n.e(0),n.e(8)]).then(n.bind(null,398)),"global-components/CodeBlock":()=>Promise.all([n.e(0),n.e(9)]).then(n.bind(null,388)),"global-components/CodeGroup":()=>Promise.all([n.e(0),n.e(10)]).then(n.bind(null,389)),"layouts/404":()=>Promise.all([n.e(0),n.e(1),n.e(6)]).then(n.bind(null,390)),"layouts/Layout":()=>Promise.all([n.e(0),n.e(1),n.e(3)]).then(n.bind(null,391)),NotFound:()=>Promise.all([n.e(0),n.e(1),n.e(6)]).then(n.bind(null,390)),Layout:()=>Promise.all([n.e(0),n.e(1),n.e(3)]).then(n.bind(null,391)),"components/Cases":()=>Promise.all([n.e(0),n.e(25)]).then(n.bind(null,328)),"components/Footer":()=>Promise.all([n.e(0),n.e(26)]).then(n.bind(null,270)),"components/LayoutWrap":()=>Promise.all([n.e(0),n.e(1),n.e(17)]).then(n.bind(null,277)),"components/PostMeta":()=>Promise.all([n.e(0),n.e(29)]).then(n.bind(null,299)),"layouts/DirectoryPagination":()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(11)]).then(n.bind(null,392)),"layouts/FrontmatterKey":()=>Promise.all([n.e(0),n.e(1),n.e(5)]).then(n.bind(null,393)),"layouts/FrontmatterPagination":()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(12)]).then(n.bind(null,394)),"layouts/IndexPost":()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,325)),"layouts/Post":()=>Promise.all([n.e(0),n.e(1),n.e(4)]).then(n.bind(null,395)),DirectoryPagination:()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(11)]).then(n.bind(null,392)),FrontmatterKey:()=>Promise.all([n.e(0),n.e(1),n.e(5)]).then(n.bind(null,393)),FrontmatterPagination:()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(12)]).then(n.bind(null,394)),IndexPost:()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,325)),Post:()=>Promise.all([n.e(0),n.e(1),n.e(4)]).then(n.bind(null,395))},qa={"v-330a32a2":()=>n.e(45).then(n.bind(null,399)),"v-2c450c3f":()=>n.e(46).then(n.bind(null,400)),"v-5e744cf7":()=>n.e(47).then(n.bind(null,401)),"v-7c0c45f9":()=>n.e(48).then(n.bind(null,402)),"v-0f4d5d15":()=>n.e(50).then(n.bind(null,403)),"v-2cebe183":()=>n.e(34).then(n.bind(null,404)),"v-353b78e1":()=>n.e(51).then(n.bind(null,405)),"v-3875825f":()=>n.e(52).then(n.bind(null,406)),"v-8bd632d6":()=>n.e(49).then(n.bind(null,407)),"v-3eaa044d":()=>n.e(31).then(n.bind(null,408)),"v-07ff1843":()=>n.e(53).then(n.bind(null,409)),"v-9504490e":()=>n.e(54).then(n.bind(null,410)),"v-c6756cce":()=>n.e(55).then(n.bind(null,411)),"v-56536559":()=>n.e(19).then(n.bind(null,412)),"v-f58ec8f2":()=>n.e(21).then(n.bind(null,413)),"v-2c605799":()=>n.e(57).then(n.bind(null,414)),"v-57698579":()=>n.e(58).then(n.bind(null,415)),"v-9145467a":()=>n.e(59).then(n.bind(null,416)),"v-015729b9":()=>n.e(56).then(n.bind(null,417)),"v-2cf72b39":()=>n.e(60).then(n.bind(null,418)),"v-11d64359":()=>n.e(61).then(n.bind(null,419)),"v-5d749fce":()=>n.e(62).then(n.bind(null,420)),"v-ab5ba3ce":()=>n.e(63).then(n.bind(null,421)),"v-d0375c8e":()=>n.e(64).then(n.bind(null,422)),"v-10852eea":()=>n.e(65).then(n.bind(null,423)),"v-05df4999":()=>n.e(67).then(n.bind(null,424)),"v-edd5570e":()=>n.e(66).then(n.bind(null,425)),"v-0119984e":()=>n.e(69).then(n.bind(null,426)),"v-75d11339":()=>n.e(72).then(n.bind(null,427)),"v-7c3d28f9":()=>n.e(70).then(n.bind(null,428)),"v-0df1c3ce":()=>n.e(71).then(n.bind(null,429)),"v-55969f39":()=>n.e(74).then(n.bind(null,430)),"v-8534b9c2":()=>n.e(75).then(n.bind(null,431)),"v-1ac9ef4e":()=>n.e(73).then(n.bind(null,432)),"v-faad828e":()=>n.e(68).then(n.bind(null,433)),"v-aeb70fce":()=>n.e(76).then(n.bind(null,434)),"v-4d760891":()=>Promise.all([n.e(0),n.e(35)]).then(n.bind(null,435)),"v-30c0037b":()=>Promise.all([n.e(0),n.e(36)]).then(n.bind(null,436)),"v-4dc135e3":()=>n.e(77).then(n.bind(null,437)),"v-4bb7844a":()=>Promise.all([n.e(0),n.e(37)]).then(n.bind(null,438)),"v-b936290e":()=>Promise.all([n.e(0),n.e(38)]).then(n.bind(null,439)),"v-a7c24c4e":()=>Promise.all([n.e(0),n.e(41)]).then(n.bind(null,440)),"v-7afdbb4e":()=>Promise.all([n.e(0),n.e(39)]).then(n.bind(null,441)),"v-4e0b610e":()=>Promise.all([n.e(0),n.e(40)]).then(n.bind(null,442)),"v-7a315e41":()=>n.e(78).then(n.bind(null,443)),"v-17019aeb":()=>Promise.all([n.e(0),n.e(42)]).then(n.bind(null,444)),"v-f611a14e":()=>n.e(79).then(n.bind(null,445)),"v-3acb6e6a":()=>n.e(80).then(n.bind(null,446)),"v-496cb7f9":()=>n.e(81).then(n.bind(null,396)),"v-0b3b65ea":()=>n.e(82).then(n.bind(null,447)),"v-a76bccee":()=>n.e(83).then(n.bind(null,448)),"v-05d01c19":()=>n.e(84).then(n.bind(null,449)),"v-11bf335e":()=>n.e(85).then(n.bind(null,450)),"v-a9236c10":()=>n.e(86).then(n.bind(null,451)),"v-105750ce":()=>n.e(89).then(n.bind(null,452)),"v-29f9f21c":()=>n.e(87).then(n.bind(null,453)),"v-3750297a":()=>n.e(88).then(n.bind(null,454)),"v-c152529c":()=>n.e(90).then(n.bind(null,455)),"v-50aa6d4e":()=>n.e(91).then(n.bind(null,456)),"v-4bcdac39":()=>n.e(92).then(n.bind(null,457))};function Ga(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const Za=/-(\w)/g,Xa=Ga(t=>t.replace(Za,(t,e)=>e?e.toUpperCase():"")),Ya=/\B([A-Z])/g,Ja=Ga(t=>t.replace(Ya,"-$1").toLowerCase()),Qa=Ga(t=>t.charAt(0).toUpperCase()+t.slice(1));function tc(t,e){if(!e)return;if(t(e))return t(e);return e.includes("-")?t(Qa(Xa(e))):t(Qa(e))||t(Ja(e))}const ec=Object.assign({},Va,qa),nc=t=>ec[t],oc=t=>qa[t],ic=t=>Va[t],rc=t=>Vn.component(t);function ac(t){return tc(oc,t)}function cc(t){return tc(ic,t)}function lc(t){return tc(nc,t)}function sc(t){return tc(rc,t)}function pc(...t){return Promise.all(t.filter(t=>t).map(async t=>{if(!sc(t)&&lc(t)){const e=await lc(t)();Vn.component(t,e.default)}}))}function dc(t,e){"undefined"!=typeof window&&window.__VUEPRESS__&&(window.__VUEPRESS__[t]=e)}var uc=n(91),gc=n.n(uc),hc=n(92),mc=n.n(hc),fc={created(){if(this.siteMeta=this.$site.headTags.filter(([t])=>"meta"===t).map(([t,e])=>e),this.$ssrContext){const e=this.getMergedMetaTags();this.$ssrContext.title=this.$title,this.$ssrContext.lang=this.$lang,this.$ssrContext.pageMeta=(t=e)?t.map(t=>{let e="{e+=` ${n}="${mc()(t[n])}"`}),e+">"}).join("\n "):"",this.$ssrContext.canonicalLink=bc(this.$canonicalUrl)}var t},mounted(){this.currentMetaTags=[...document.querySelectorAll("meta")],this.updateMeta(),this.updateCanonicalLink()},methods:{updateMeta(){document.title=this.$title,document.documentElement.lang=this.$lang;const t=this.getMergedMetaTags();this.currentMetaTags=yc(t,this.currentMetaTags)},getMergedMetaTags(){const t=this.$page.frontmatter.meta||[];return gc()([{name:"description",content:this.$description}],t,this.siteMeta,wc)},updateCanonicalLink(){vc(),this.$canonicalUrl&&document.head.insertAdjacentHTML("beforeend",bc(this.$canonicalUrl))}},watch:{$page(){this.updateMeta(),this.updateCanonicalLink()}},beforeDestroy(){yc(null,this.currentMetaTags),vc()}};function vc(){const t=document.querySelector("link[rel='canonical']");t&&t.remove()}function bc(t=""){return t?``:""}function yc(t,e){if(e&&[...e].filter(t=>t.parentNode===document.head).forEach(t=>document.head.removeChild(t)),t)return t.map(t=>{const e=document.createElement("meta");return Object.keys(t).forEach(n=>{e.setAttribute(n,t[n])}),document.head.appendChild(e),e})}function wc(t){for(const e of["name","property","itemprop"])if(t.hasOwnProperty(e))return t[e]+e;return JSON.stringify(t)}var kc=n(93),_c={mounted(){window.addEventListener("scroll",this.onScroll)},methods:{onScroll:n.n(kc)()((function(){this.setActiveHash()}),300),setActiveHash(){const t=[].slice.call(document.querySelectorAll(".sidebar-link")),e=[].slice.call(document.querySelectorAll(".header-anchor")).filter(e=>t.some(t=>t.hash===e.hash)),n=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),o=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),i=window.innerHeight+n;for(let t=0;t=r.parentElement.offsetTop+10&&(!a||n{this.$nextTick(()=>{this.$vuepress.$set("disableScrollBehavior",!1)})})}}}},beforeDestroy(){window.removeEventListener("scroll",this.onScroll)}},Bc=n(22),Dc=n.n(Bc),xc={mounted(){Dc.a.configure({showSpinner:!1}),this.$router.beforeEach((t,e,n)=>{t.path===e.path||Vn.component(t.name)||Dc.a.start(),n()}),this.$router.afterEach(()=>{Dc.a.done(),this.isSidebarOpen=!1})}},Pc={props:{parent:Object,code:String,options:{align:String,color:String,backgroundTransition:Boolean,backgroundColor:String,successText:String,staticIcon:Boolean}},data:()=>({success:!1,originalBackground:null,originalTransition:null}),computed:{alignStyle(){let t={};return t[this.options.align]="7.5px",t},iconClass(){return this.options.staticIcon?"":"hover"}},mounted(){this.originalTransition=this.parent.style.transition,this.originalBackground=this.parent.style.background},beforeDestroy(){this.parent.style.transition=this.originalTransition,this.parent.style.background=this.originalBackground},methods:{hexToRgb(t){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},copyToClipboard(t){if(navigator.clipboard)navigator.clipboard.writeText(this.code).then(()=>{this.setSuccessTransitions()},()=>{});else{let t=document.createElement("textarea");document.body.appendChild(t),t.value=this.code,t.select(),document.execCommand("Copy"),t.remove(),this.setSuccessTransitions()}},setSuccessTransitions(){if(clearTimeout(this.successTimeout),this.options.backgroundTransition){this.parent.style.transition="background 350ms";let t=this.hexToRgb(this.options.backgroundColor);this.parent.style.background=`rgba(${t.r}, ${t.g}, ${t.b}, 0.1)`}this.success=!0,this.successTimeout=setTimeout(()=>{this.options.backgroundTransition&&(this.parent.style.background=this.originalBackground,this.parent.style.transition=this.originalTransition),this.success=!1},500)}}},Kc=(n(240),n(7)),Sc=Object(Kc.a)(Pc,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"code-copy"},[e("svg",{class:t.iconClass,style:t.alignStyle,attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},on:{click:t.copyToClipboard}},[e("path",{attrs:{fill:"none",d:"M0 0h24v24H0z"}}),t._v(" "),e("path",{attrs:{fill:t.options.color,d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}})]),t._v(" "),e("span",{class:t.success?"success":"",style:t.alignStyle},[t._v("\n "+t._s(t.options.successText)+"\n ")])])}),[],!1,null,"49140617",null).exports,Tc=(n(241),{updated(){this.update()},methods:{update(){setTimeout(()=>{document.querySelectorAll('div[class*="language-"] pre').forEach(t=>{if(t.classList.contains("code-copy-added"))return;let e=new(Vn.extend(Sc));e.options={align:"bottom",color:"#8F979E",backgroundTransition:!1,backgroundColor:"#0075b8",successText:"Copied!",staticIcon:!0},e.code=t.innerText,e.parent=t,e.$mount(),t.classList.add("code-copy-added"),t.appendChild(e.$el)})},100)}}}),Oc=(n(242),Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},o=window.Promise||function(t){function e(){}t(e,e)},i=function(t){var e=t.target;e!==x?-1!==y.indexOf(e)&&m({target:e}):h()},r=function(){if(!k&&D.original){var t=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(_-t)>B.scrollOffset&&setTimeout(h,150)}},a=function(t){var e=t.key||t.keyCode;"Escape"!==e&&"Esc"!==e&&27!==e||h()},c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t;if(t.background&&(x.style.background=t.background),t.container&&t.container instanceof Object&&(e.container=Oc({},B.container,t.container)),t.template){var n=Ac(t.template)?t.template:document.querySelector(t.template);e.template=n}return B=Oc({},B,e),y.forEach((function(t){t.dispatchEvent(Mc("medium-zoom:update",{detail:{zoom:P}}))})),P},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t(Oc({},B,e))},s=function(){for(var t=arguments.length,e=Array(t),n=0;n0?e.reduce((function(t,e){return[].concat(t,Fc(e))}),[]):y;return o.forEach((function(t){t.classList.remove("medium-zoom-image"),t.dispatchEvent(Mc("medium-zoom:detach",{detail:{zoom:P}}))})),y=y.filter((function(t){return-1===o.indexOf(t)})),P},d=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return y.forEach((function(o){o.addEventListener("medium-zoom:"+t,e,n)})),w.push({type:"medium-zoom:"+t,listener:e,options:n}),P},u=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return y.forEach((function(o){o.removeEventListener("medium-zoom:"+t,e,n)})),w=w.filter((function(n){return!(n.type==="medium-zoom:"+t&&n.listener.toString()===e.toString())})),P},g=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,n=function(){var t={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},e=void 0,n=void 0;if(B.container)if(B.container instanceof Object)e=(t=Oc({},t,B.container)).width-t.left-t.right-2*B.margin,n=t.height-t.top-t.bottom-2*B.margin;else{var o=(Ac(B.container)?B.container:document.querySelector(B.container)).getBoundingClientRect(),i=o.width,r=o.height,a=o.left,c=o.top;t=Oc({},t,{width:i,height:r,left:a,top:c})}e=e||t.width-2*B.margin,n=n||t.height-2*B.margin;var l=D.zoomedHd||D.original,s=Ec(l)?e:l.naturalWidth||e,p=Ec(l)?n:l.naturalHeight||n,d=l.getBoundingClientRect(),u=d.top,g=d.left,h=d.width,m=d.height,f=Math.min(Math.max(h,s),e)/h,v=Math.min(Math.max(m,p),n)/m,b=Math.min(f,v),y="scale("+b+") translate3d("+((e-h)/2-g+B.margin+t.left)/b+"px, "+((n-m)/2-u+B.margin+t.top)/b+"px, 0)";D.zoomed.style.transform=y,D.zoomedHd&&(D.zoomedHd.style.transform=y)};return new o((function(t){if(e&&-1===y.indexOf(e))t(P);else{if(D.zoomed)t(P);else{if(e)D.original=e;else{if(!(y.length>0))return void t(P);var o=y;D.original=o[0]}if(D.original.dispatchEvent(Mc("medium-zoom:open",{detail:{zoom:P}})),_=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,k=!0,D.zoomed=jc(D.original),document.body.appendChild(x),B.template){var i=Ac(B.template)?B.template:document.querySelector(B.template);D.template=document.createElement("div"),D.template.appendChild(i.content.cloneNode(!0)),document.body.appendChild(D.template)}if(D.original.parentElement&&"PICTURE"===D.original.parentElement.tagName&&D.original.currentSrc&&(D.zoomed.src=D.original.currentSrc),document.body.appendChild(D.zoomed),window.requestAnimationFrame((function(){document.body.classList.add("medium-zoom--opened")})),D.original.classList.add("medium-zoom-image--hidden"),D.zoomed.classList.add("medium-zoom-image--opened"),D.zoomed.addEventListener("click",h),D.zoomed.addEventListener("transitionend",(function e(){k=!1,D.zoomed.removeEventListener("transitionend",e),D.original.dispatchEvent(Mc("medium-zoom:opened",{detail:{zoom:P}})),t(P)})),D.original.getAttribute("data-zoom-src")){D.zoomedHd=D.zoomed.cloneNode(),D.zoomedHd.removeAttribute("srcset"),D.zoomedHd.removeAttribute("sizes"),D.zoomedHd.removeAttribute("loading"),D.zoomedHd.src=D.zoomed.getAttribute("data-zoom-src"),D.zoomedHd.onerror=function(){clearInterval(r),console.warn("Unable to reach the zoom image target "+D.zoomedHd.src),D.zoomedHd=null,n()};var r=setInterval((function(){D.zoomedHd.complete&&(clearInterval(r),D.zoomedHd.classList.add("medium-zoom-image--opened"),D.zoomedHd.addEventListener("click",h),document.body.appendChild(D.zoomedHd),n())}),10)}else if(D.original.hasAttribute("srcset")){D.zoomedHd=D.zoomed.cloneNode(),D.zoomedHd.removeAttribute("sizes"),D.zoomedHd.removeAttribute("loading");var a=D.zoomedHd.addEventListener("load",(function(){D.zoomedHd.removeEventListener("load",a),D.zoomedHd.classList.add("medium-zoom-image--opened"),D.zoomedHd.addEventListener("click",h),document.body.appendChild(D.zoomedHd),n()}))}else n()}}}))},h=function(){return new o((function(t){if(!k&&D.original){k=!0,document.body.classList.remove("medium-zoom--opened"),D.zoomed.style.transform="",D.zoomedHd&&(D.zoomedHd.style.transform=""),D.template&&(D.template.style.transition="opacity 150ms",D.template.style.opacity=0),D.original.dispatchEvent(Mc("medium-zoom:close",{detail:{zoom:P}})),D.zoomed.addEventListener("transitionend",(function e(){D.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(D.zoomed),D.zoomedHd&&document.body.removeChild(D.zoomedHd),document.body.removeChild(x),D.zoomed.classList.remove("medium-zoom-image--opened"),D.template&&document.body.removeChild(D.template),k=!1,D.zoomed.removeEventListener("transitionend",e),D.original.dispatchEvent(Mc("medium-zoom:closed",{detail:{zoom:P}})),D.original=null,D.zoomed=null,D.zoomedHd=null,D.template=null,t(P)}))}else t(P)}))},m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target;return D.original?h():g({target:e})},f=function(){return B},v=function(){return y},b=function(){return D.original},y=[],w=[],k=!1,_=0,B=n,D={original:null,zoomed:null,zoomedHd:null,template:null};"[object Object]"===Object.prototype.toString.call(e)?B=e:(e||"string"==typeof e)&&s(e),B=Oc({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},B);var x=$c(B.background);document.addEventListener("click",i),document.addEventListener("keyup",a),document.addEventListener("scroll",r),window.addEventListener("resize",h);var P={open:g,close:h,toggle:m,update:c,clone:l,attach:s,detach:p,on:d,off:u,getOptions:f,getImages:v,getZoomedImage:b};return P},Ic=[fc,_c,xc,Tc,{data:()=>({zoom:null}),mounted(){this.updateZoom()},updated(){this.updateZoom()},methods:{updateZoom(){setTimeout(()=>{this.zoom&&this.zoom.detach(),this.zoom=Rc(".theme-default-content :not(a) > img",void 0)},1e3)}}}],Lc={name:"GlobalLayout",computed:{layout(){const t=this.getLayout();return dc("layout",t),Vn.component(t)}},methods:{getLayout(){if(this.$page.path){const t=this.$page.frontmatter.layout;return t&&(this.$vuepress.getLayoutAsyncComponent(t)||this.$vuepress.getVueComponent(t))?t:"Layout"}return"NotFound"}}},Nc=Object(Kc.a)(Lc,(function(){return(0,this._self._c)(this.layout,{tag:"component"})}),[],!1,null,null,null).exports;!function(t,e,n){switch(e){case"components":t[e]||(t[e]={}),Object.assign(t[e],n);break;case"mixins":t[e]||(t[e]=[]),t[e].push(...n);break;default:throw new Error("Unknown option name.")}}(Nc,"mixins",Ic);const Uc=[{name:"v-330a32a2",path:"/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-330a32a2").then(n)}},{path:"/index.html",redirect:"/"},{name:"v-2c450c3f",path:"/blog/_2023-q4-update/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2c450c3f").then(n)}},{path:"/blog/_2023-q4-update/index.html",redirect:"/blog/_2023-q4-update/"},{path:"/_blog/2023_q4_update.html",redirect:"/blog/_2023-q4-update/"},{name:"v-5e744cf7",path:"/blog/_2024-q1-update/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-5e744cf7").then(n)}},{path:"/blog/_2024-q1-update/index.html",redirect:"/blog/_2024-q1-update/"},{path:"/_blog/2024_q1_update.html",redirect:"/blog/_2024-q1-update/"},{name:"v-7c0c45f9",path:"/blog/bitcoin-core-rpc-demo/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-7c0c45f9").then(n)}},{path:"/blog/bitcoin-core-rpc-demo/index.html",redirect:"/blog/bitcoin-core-rpc-demo/"},{path:"/_blog/Bitcoin_Core_RPC_Demo.html",redirect:"/blog/bitcoin-core-rpc-demo/"},{name:"v-0f4d5d15",path:"/blog/bdk-cli-basics/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-0f4d5d15").then(n)}},{path:"/blog/bdk-cli-basics/index.html",redirect:"/blog/bdk-cli-basics/"},{path:"/_blog/bdk_cli_basics.html",redirect:"/blog/bdk-cli-basics/"},{name:"v-2cebe183",path:"/blog/bdk-core-pt1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2cebe183").then(n)}},{path:"/blog/bdk-core-pt1/index.html",redirect:"/blog/bdk-core-pt1/"},{path:"/_blog/bdk_core_pt1.html",redirect:"/blog/bdk-core-pt1/"},{name:"v-353b78e1",path:"/blog/bdk-with-tor/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-353b78e1").then(n)}},{path:"/blog/bdk-with-tor/index.html",redirect:"/blog/bdk-with-tor/"},{path:"/_blog/bdk_with_tor.html",redirect:"/blog/bdk-with-tor/"},{name:"v-3875825f",path:"/blog/bindings-scope/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-3875825f").then(n)}},{path:"/blog/bindings-scope/index.html",redirect:"/blog/bindings-scope/"},{path:"/_blog/bindings-scope.html",redirect:"/blog/bindings-scope/"},{name:"v-8bd632d6",path:"/blog/bdk-cli-basics-multisig-2of3/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-8bd632d6").then(n)}},{path:"/blog/bdk-cli-basics-multisig-2of3/index.html",redirect:"/blog/bdk-cli-basics-multisig-2of3/"},{path:"/_blog/bdk-cli_basics_multisig_2of3.html",redirect:"/blog/bdk-cli-basics-multisig-2of3/"},{name:"v-3eaa044d",path:"/blog/bdk-rn-making-of/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-3eaa044d").then(n)}},{path:"/blog/bdk-rn-making-of/index.html",redirect:"/blog/bdk-rn-making-of/"},{path:"/_blog/bdk_rn_making_of.html",redirect:"/blog/bdk-rn-making-of/"},{name:"v-07ff1843",path:"/blog/compact-filters-demo/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-07ff1843").then(n)}},{path:"/blog/compact-filters-demo/index.html",redirect:"/blog/compact-filters-demo/"},{path:"/_blog/compact_filters_demo.html",redirect:"/blog/compact-filters-demo/"},{name:"v-9504490e",path:"/blog/descriptor-based-paper-wallet/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-9504490e").then(n)}},{path:"/blog/descriptor-based-paper-wallet/index.html",redirect:"/blog/descriptor-based-paper-wallet/"},{path:"/_blog/descriptor_based_paper_wallet.html",redirect:"/blog/descriptor-based-paper-wallet/"},{name:"v-c6756cce",path:"/blog/descriptors-in-the-wild/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-c6756cce").then(n)}},{path:"/blog/descriptors-in-the-wild/index.html",redirect:"/blog/descriptors-in-the-wild/"},{path:"/_blog/descriptors_in_the_wild.html",redirect:"/blog/descriptors-in-the-wild/"},{name:"v-56536559",path:"/blog/exploring-bdk-flutter/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-56536559").then(n)}},{path:"/blog/exploring-bdk-flutter/index.html",redirect:"/blog/exploring-bdk-flutter/"},{path:"/_blog/exploring_bdk_flutter.html",redirect:"/blog/exploring-bdk-flutter/"},{name:"v-f58ec8f2",path:"/blog/exploring-bdk-rn/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-f58ec8f2").then(n)}},{path:"/blog/exploring-bdk-rn/index.html",redirect:"/blog/exploring-bdk-rn/"},{path:"/_blog/exploring_bdk_rn.html",redirect:"/blog/exploring-bdk-rn/"},{name:"v-2c605799",path:"/blog/2021/01/fee-estimation-for-light-clients-part-2/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2c605799").then(n)}},{path:"/blog/2021/01/fee-estimation-for-light-clients-part-2/index.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{path:"/_blog/fee_estimation_for_light_clients_part_2.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{name:"v-57698579",path:"/blog/2021/01/fee-estimation-for-light-clients-part-3/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-57698579").then(n)}},{path:"/blog/2021/01/fee-estimation-for-light-clients-part-3/index.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{path:"/_blog/fee_estimation_for_light_clients_part_3.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{name:"v-9145467a",path:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-9145467a").then(n)}},{path:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/index.html",redirect:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{path:"/_blog/first_bdk_taproot_tx.html",redirect:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{name:"v-015729b9",path:"/blog/2021/01/fee-estimation-for-light-clients-part-1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-015729b9").then(n)}},{path:"/blog/2021/01/fee-estimation-for-light-clients-part-1/index.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{path:"/_blog/fee_estimation_for_light_clients_part_1.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{name:"v-2cf72b39",path:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2cf72b39").then(n)}},{path:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/index.html",redirect:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{path:"/_blog/first_bdk_taproot_tx_part_2.html",redirect:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{name:"v-11d64359",path:"/blog/getting-started-with-rust-hwi/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-11d64359").then(n)}},{path:"/blog/getting-started-with-rust-hwi/index.html",redirect:"/blog/getting-started-with-rust-hwi/"},{path:"/_blog/getting_started_with_rust_hwi.html",redirect:"/blog/getting-started-with-rust-hwi/"},{name:"v-5d749fce",path:"/blog/2020/12/hello-world/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-5d749fce").then(n)}},{path:"/blog/2020/12/hello-world/index.html",redirect:"/blog/2020/12/hello-world/"},{path:"/_blog/hello-world.html",redirect:"/blog/2020/12/hello-world/"},{name:"v-ab5ba3ce",path:"/blog/hidden-power-of-bitcoin/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-ab5ba3ce").then(n)}},{path:"/blog/hidden-power-of-bitcoin/index.html",redirect:"/blog/hidden-power-of-bitcoin/"},{path:"/_blog/hidden-power-of-bitcoin.html",redirect:"/blog/hidden-power-of-bitcoin/"},{name:"v-d0375c8e",path:"/blog/improving-coin-selection-in-bdk/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-d0375c8e").then(n)}},{path:"/blog/improving-coin-selection-in-bdk/index.html",redirect:"/blog/improving-coin-selection-in-bdk/"},{path:"/_blog/improving_coin_selection_in_BDK.html",redirect:"/blog/improving-coin-selection-in-bdk/"},{name:"v-10852eea",path:"/blog/miniscript-vulnerability/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-10852eea").then(n)}},{path:"/blog/miniscript-vulnerability/index.html",redirect:"/blog/miniscript-vulnerability/"},{path:"/_blog/miniscript_vulnerability.html",redirect:"/blog/miniscript-vulnerability/"},{name:"v-05df4999",path:"/blog/2021/01/release-v0.3.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-05df4999").then(n)}},{path:"/blog/2021/01/release-v0.3.0/index.html",redirect:"/blog/2021/01/release-v0.3.0/"},{path:"/_blog/release-0.3.0.html",redirect:"/blog/2021/01/release-v0.3.0/"},{name:"v-edd5570e",path:"/blog/2020/12/release-v0.2.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-edd5570e").then(n)}},{path:"/blog/2020/12/release-v0.2.0/index.html",redirect:"/blog/2020/12/release-v0.2.0/"},{path:"/_blog/release-0.2.0.html",redirect:"/blog/2020/12/release-v0.2.0/"},{name:"v-0119984e",path:"/blog/2021/03/release-v0.5.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-0119984e").then(n)}},{path:"/blog/2021/03/release-v0.5.0/index.html",redirect:"/blog/2021/03/release-v0.5.0/"},{path:"/_blog/release-0.5.0.html",redirect:"/blog/2021/03/release-v0.5.0/"},{name:"v-75d11339",path:"/blog/2021/06/release-v0.8.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-75d11339").then(n)}},{path:"/blog/2021/06/release-v0.8.0/index.html",redirect:"/blog/2021/06/release-v0.8.0/"},{path:"/_blog/release-0.8.0.html",redirect:"/blog/2021/06/release-v0.8.0/"},{name:"v-7c3d28f9",path:"/blog/2021/04/release-v0.6.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-7c3d28f9").then(n)}},{path:"/blog/2021/04/release-v0.6.0/index.html",redirect:"/blog/2021/04/release-v0.6.0/"},{path:"/_blog/release-0.6.0.html",redirect:"/blog/2021/04/release-v0.6.0/"},{name:"v-0df1c3ce",path:"/blog/2021/05/release-v0.7.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-0df1c3ce").then(n)}},{path:"/blog/2021/05/release-v0.7.0/index.html",redirect:"/blog/2021/05/release-v0.7.0/"},{path:"/_blog/release-0.7.0.html",redirect:"/blog/2021/05/release-v0.7.0/"},{name:"v-55969f39",path:"/blog/road-to-bdk-1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-55969f39").then(n)}},{path:"/blog/road-to-bdk-1/index.html",redirect:"/blog/road-to-bdk-1/"},{path:"/_blog/road_to_bdk_1.html",redirect:"/blog/road-to-bdk-1/"},{name:"v-8534b9c2",path:"/blog/spending-policy-demo/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-8534b9c2").then(n)}},{path:"/blog/spending-policy-demo/index.html",redirect:"/blog/spending-policy-demo/"},{path:"/_blog/spending_policy_demo.html",redirect:"/blog/spending-policy-demo/"},{name:"v-1ac9ef4e",path:"/blog/2021/07/release-v0.9.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-1ac9ef4e").then(n)}},{path:"/blog/2021/07/release-v0.9.0/index.html",redirect:"/blog/2021/07/release-v0.9.0/"},{path:"/_blog/release-0.9.0.html",redirect:"/blog/2021/07/release-v0.9.0/"},{name:"v-faad828e",path:"/blog/2021/02/release-v0.4.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-faad828e").then(n)}},{path:"/blog/2021/02/release-v0.4.0/index.html",redirect:"/blog/2021/02/release-v0.4.0/"},{path:"/_blog/release-0.4.0.html",redirect:"/blog/2021/02/release-v0.4.0/"},{name:"v-aeb70fce",path:"/blog/using-bdk-with-hardware-wallets/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-aeb70fce").then(n)}},{path:"/blog/using-bdk-with-hardware-wallets/index.html",redirect:"/blog/using-bdk-with-hardware-wallets/"},{path:"/_blog/using_bdk_with_hardware_wallets.html",redirect:"/blog/using-bdk-with-hardware-wallets/"},{name:"v-4d760891",path:"/adoption/all/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4d760891").then(n)}},{path:"/adoption/all/index.html",redirect:"/adoption/all/"},{path:"/adoption/all.html",redirect:"/adoption/all/"},{name:"v-30c0037b",path:"/adoption/custodial/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-30c0037b").then(n)}},{path:"/adoption/custodial/index.html",redirect:"/adoption/custodial/"},{path:"/adoption/custodial.html",redirect:"/adoption/custodial/"},{name:"v-4dc135e3",path:"/blog/why-bindings/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-4dc135e3").then(n)}},{path:"/blog/why-bindings/index.html",redirect:"/blog/why-bindings/"},{path:"/_blog/why-bindings.html",redirect:"/blog/why-bindings/"},{name:"v-4bb7844a",path:"/adoption/desktop/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4bb7844a").then(n)}},{path:"/adoption/desktop/index.html",redirect:"/adoption/desktop/"},{path:"/adoption/desktop.html",redirect:"/adoption/desktop/"},{name:"v-b936290e",path:"/adoption/exchange/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-b936290e").then(n)}},{path:"/adoption/exchange/index.html",redirect:"/adoption/exchange/"},{path:"/adoption/exchange.html",redirect:"/adoption/exchange/"},{name:"v-a7c24c4e",path:"/adoption/mobile/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-a7c24c4e").then(n)}},{path:"/adoption/mobile/index.html",redirect:"/adoption/mobile/"},{path:"/adoption/mobile.html",redirect:"/adoption/mobile/"},{name:"v-7afdbb4e",path:"/adoption/hardware/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-7afdbb4e").then(n)}},{path:"/adoption/hardware/index.html",redirect:"/adoption/hardware/"},{path:"/adoption/hardware.html",redirect:"/adoption/hardware/"},{name:"v-4e0b610e",path:"/adoption/infrastructure/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4e0b610e").then(n)}},{path:"/adoption/infrastructure/index.html",redirect:"/adoption/infrastructure/"},{path:"/adoption/infrastructure.html",redirect:"/adoption/infrastructure/"},{name:"v-7a315e41",path:"/bdk-cli/compiler/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-7a315e41").then(n)}},{path:"/bdk-cli/compiler/index.html",redirect:"/bdk-cli/compiler/"},{path:"/bdk-cli/compiler.html",redirect:"/bdk-cli/compiler/"},{name:"v-17019aeb",path:"/adoption/web/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-17019aeb").then(n)}},{path:"/adoption/web/index.html",redirect:"/adoption/web/"},{path:"/adoption/web.html",redirect:"/adoption/web/"},{name:"v-f611a14e",path:"/bdk-cli/concept/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-f611a14e").then(n)}},{path:"/bdk-cli/concept/index.html",redirect:"/bdk-cli/concept/"},{path:"/bdk-cli/concept.html",redirect:"/bdk-cli/concept/"},{name:"v-3acb6e6a",path:"/bdk-cli/installation/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-3acb6e6a").then(n)}},{path:"/bdk-cli/installation/index.html",redirect:"/bdk-cli/installation/"},{path:"/bdk-cli/installation.html",redirect:"/bdk-cli/installation/"},{name:"v-496cb7f9",path:"/bdk-cli/interface/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-496cb7f9").then(n)}},{path:"/bdk-cli/interface/index.html",redirect:"/bdk-cli/interface/"},{path:"/bdk-cli/interface.html",redirect:"/bdk-cli/interface/"},{name:"v-0b3b65ea",path:"/bdk-cli/introduction/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-0b3b65ea").then(n)}},{path:"/bdk-cli/introduction/index.html",redirect:"/bdk-cli/introduction/"},{path:"/bdk-cli/introduction.html",redirect:"/bdk-cli/introduction/"},{name:"v-a76bccee",path:"/bdk-cli/playground/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-a76bccee").then(n)}},{path:"/bdk-cli/playground/index.html",redirect:"/bdk-cli/playground/"},{path:"/bdk-cli/playground.html",redirect:"/bdk-cli/playground/"},{name:"v-05d01c19",path:"/bdk-cli/regtest/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-05d01c19").then(n)}},{path:"/bdk-cli/regtest/index.html",redirect:"/bdk-cli/regtest/"},{path:"/bdk-cli/regtest.html",redirect:"/bdk-cli/regtest/"},{name:"v-11bf335e",path:"/case-studies/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-11bf335e").then(n)}},{path:"/case-studies/index.html",redirect:"/case-studies/"},{path:"/case-studies.html",redirect:"/case-studies/"},{name:"v-a9236c10",path:"/descriptors/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-a9236c10").then(n)}},{path:"/descriptors/index.html",redirect:"/descriptors/"},{name:"v-105750ce",path:"/foundation/grantees/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-105750ce").then(n)}},{path:"/foundation/grantees/index.html",redirect:"/foundation/grantees/"},{path:"/foundation/grantees.html",redirect:"/foundation/grantees/"},{name:"v-29f9f21c",path:"/examples/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-29f9f21c").then(n)}},{path:"/examples/index.html",redirect:"/examples/"},{name:"v-3750297a",path:"/foundation/about/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-3750297a").then(n)}},{path:"/foundation/about/index.html",redirect:"/foundation/about/"},{path:"/foundation/about.html",redirect:"/foundation/about/"},{name:"v-c152529c",path:"/foundation/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-c152529c").then(n)}},{path:"/foundation/index.html",redirect:"/foundation/"},{name:"v-50aa6d4e",path:"/foundation/supporters/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-50aa6d4e").then(n)}},{path:"/foundation/supporters/index.html",redirect:"/foundation/supporters/"},{path:"/foundation/supporters.html",redirect:"/foundation/supporters/"},{name:"v-4bcdac39",path:"/getting-started/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4bcdac39").then(n)}},{path:"/getting-started/index.html",redirect:"/getting-started/"},{path:"/getting-started.html",redirect:"/getting-started/"},{name:"v-424df898",path:"/blog/",component:Nc,beforeEnter:(t,e,n)=>{pc("IndexPost","v-424df898").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/index.html",redirect:"/blog/"},{name:"v-619df59e",path:"/blog/tags/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterKey","v-619df59e").then(n)},meta:{pid:"tags",id:"tags"}},{path:"/blog/tags/index.html",redirect:"/blog/tags/"},{name:"v-b0968728",path:"/blog/author/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterKey","v-b0968728").then(n)},meta:{pid:"author",id:"author"}},{path:"/blog/author/index.html",redirect:"/blog/author/"},{name:"v-5f2600b8",path:"/blog/tags/BDK/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f2600b8").then(n)},meta:{pid:"tags",id:"BDK"}},{path:"/blog/tags/BDK/index.html",redirect:"/blog/tags/BDK/"},{name:"v-398e8fd4",path:"/blog/tags/project/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-398e8fd4").then(n)},meta:{pid:"tags",id:"project"}},{path:"/blog/tags/project/index.html",redirect:"/blog/tags/project/"},{name:"v-da8c869a",path:"/blog/tags/tutorial/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-da8c869a").then(n)},meta:{pid:"tags",id:"tutorial"}},{path:"/blog/tags/tutorial/index.html",redirect:"/blog/tags/tutorial/"},{name:"v-62bbf2ad",path:"/blog/tags/Bitcoin Core/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-62bbf2ad").then(n)},meta:{pid:"tags",id:"Bitcoin Core"}},{path:"/blog/tags/Bitcoin Core/index.html",redirect:"/blog/tags/Bitcoin Core/"},{name:"v-5f171cb0",path:"/blog/tags/RPC/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f171cb0").then(n)},meta:{pid:"tags",id:"RPC"}},{path:"/blog/tags/RPC/index.html",redirect:"/blog/tags/RPC/"},{name:"v-4696dfd8",path:"/blog/tags/Wallet/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4696dfd8").then(n)},meta:{pid:"tags",id:"Wallet"}},{path:"/blog/tags/Wallet/index.html",redirect:"/blog/tags/Wallet/"},{name:"v-c711ccde",path:"/blog/tags/bdk-cli/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-c711ccde").then(n)},meta:{pid:"tags",id:"bdk-cli"}},{path:"/blog/tags/bdk-cli/index.html",redirect:"/blog/tags/bdk-cli/"},{name:"v-e646a928",path:"/blog/tags/basics/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-e646a928").then(n)},meta:{pid:"tags",id:"basics"}},{path:"/blog/tags/basics/index.html",redirect:"/blog/tags/basics/"},{name:"v-1fb58ffb",path:"/blog/tags/novice/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-1fb58ffb").then(n)},meta:{pid:"tags",id:"novice"}},{path:"/blog/tags/novice/index.html",redirect:"/blog/tags/novice/"},{name:"v-c4494744",path:"/blog/tags/architecture/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-c4494744").then(n)},meta:{pid:"tags",id:"architecture"}},{path:"/blog/tags/architecture/index.html",redirect:"/blog/tags/architecture/"},{name:"v-5ef73f54",path:"/blog/tags/tor/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5ef73f54").then(n)},meta:{pid:"tags",id:"tor"}},{path:"/blog/tags/tor/index.html",redirect:"/blog/tags/tor/"},{name:"v-39437010",path:"/blog/tags/wallet/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-39437010").then(n)},meta:{pid:"tags",id:"wallet"}},{path:"/blog/tags/wallet/index.html",redirect:"/blog/tags/wallet/"},{name:"v-7c8563fd",path:"/blog/tags/blockchain/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-7c8563fd").then(n)},meta:{pid:"tags",id:"blockchain"}},{path:"/blog/tags/blockchain/index.html",redirect:"/blog/tags/blockchain/"},{name:"v-1296a8fa",path:"/blog/tags/bindings/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-1296a8fa").then(n)},meta:{pid:"tags",id:"bindings"}},{path:"/blog/tags/bindings/index.html",redirect:"/blog/tags/bindings/"},{name:"v-655ee4a0",path:"/blog/tags/multi-sig/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-655ee4a0").then(n)},meta:{pid:"tags",id:"multi-sig"}},{path:"/blog/tags/multi-sig/index.html",redirect:"/blog/tags/multi-sig/"},{name:"v-876cfade",path:"/blog/tags/BDK-RN/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-876cfade").then(n)},meta:{pid:"tags",id:"BDK-RN"}},{path:"/blog/tags/BDK-RN/index.html",redirect:"/blog/tags/BDK-RN/"},{name:"v-3acc51dc",path:"/blog/tags/Development/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-3acc51dc").then(n)},meta:{pid:"tags",id:"Development"}},{path:"/blog/tags/Development/index.html",redirect:"/blog/tags/Development/"},{name:"v-650ae784",path:"/blog/tags/Architecture/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-650ae784").then(n)},meta:{pid:"tags",id:"Architecture"}},{path:"/blog/tags/Architecture/index.html",redirect:"/blog/tags/Architecture/"},{name:"v-baacba64",path:"/blog/tags/compact_filters/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-baacba64").then(n)},meta:{pid:"tags",id:"compact_filters"}},{path:"/blog/tags/compact_filters/index.html",redirect:"/blog/tags/compact_filters/"},{name:"v-75ccd5f2",path:"/blog/tags/BIP157/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-75ccd5f2").then(n)},meta:{pid:"tags",id:"BIP157"}},{path:"/blog/tags/BIP157/index.html",redirect:"/blog/tags/BIP157/"},{name:"v-4fed1c23",path:"/blog/tags/Neutrino/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4fed1c23").then(n)},meta:{pid:"tags",id:"Neutrino"}},{path:"/blog/tags/Neutrino/index.html",redirect:"/blog/tags/Neutrino/"},{name:"v-a9e0285e",path:"/blog/tags/guide/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-a9e0285e").then(n)},meta:{pid:"tags",id:"guide"}},{path:"/blog/tags/guide/index.html",redirect:"/blog/tags/guide/"},{name:"v-733ed37c",path:"/blog/tags/descriptor/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-733ed37c").then(n)},meta:{pid:"tags",id:"descriptor"}},{path:"/blog/tags/descriptor/index.html",redirect:"/blog/tags/descriptor/"},{name:"v-1144be8a",path:"/blog/tags/paper wallets/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-1144be8a").then(n)},meta:{pid:"tags",id:"paper wallets"}},{path:"/blog/tags/paper wallets/index.html",redirect:"/blog/tags/paper wallets/"},{name:"v-915f8322",path:"/blog/tags/bitcoin/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-915f8322").then(n)},meta:{pid:"tags",id:"bitcoin"}},{path:"/blog/tags/bitcoin/index.html",redirect:"/blog/tags/bitcoin/"},{name:"v-bf53d4d4",path:"/blog/tags/React Native/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-bf53d4d4").then(n)},meta:{pid:"tags",id:"React Native"}},{path:"/blog/tags/React Native/index.html",redirect:"/blog/tags/React Native/"},{name:"v-07eeb15e",path:"/blog/tags/Flutter/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-07eeb15e").then(n)},meta:{pid:"tags",id:"Flutter"}},{path:"/blog/tags/Flutter/index.html",redirect:"/blog/tags/Flutter/"},{name:"v-5f023740",path:"/blog/tags/iOS/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f023740").then(n)},meta:{pid:"tags",id:"iOS"}},{path:"/blog/tags/iOS/index.html",redirect:"/blog/tags/iOS/"},{name:"v-414e735e",path:"/blog/tags/Android/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-414e735e").then(n)},meta:{pid:"tags",id:"Android"}},{path:"/blog/tags/Android/index.html",redirect:"/blog/tags/Android/"},{name:"v-2c94bf22",path:"/blog/tags/mobile/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-2c94bf22").then(n)},meta:{pid:"tags",id:"mobile"}},{path:"/blog/tags/mobile/index.html",redirect:"/blog/tags/mobile/"},{name:"v-dd212a9e",path:"/blog/tags/bdk-rn/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-dd212a9e").then(n)},meta:{pid:"tags",id:"bdk-rn"}},{path:"/blog/tags/bdk-rn/index.html",redirect:"/blog/tags/bdk-rn/"},{name:"v-5f07f0f8",path:"/blog/tags/bdk/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f07f0f8").then(n)},meta:{pid:"tags",id:"bdk"}},{path:"/blog/tags/bdk/index.html",redirect:"/blog/tags/bdk/"},{name:"v-5f0447f2",path:"/blog/tags/fee/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f0447f2").then(n)},meta:{pid:"tags",id:"fee"}},{path:"/blog/tags/fee/index.html",redirect:"/blog/tags/fee/"},{name:"v-e2317b12",path:"/blog/tags/machine learning/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-e2317b12").then(n)},meta:{pid:"tags",id:"machine learning"}},{path:"/blog/tags/machine learning/index.html",redirect:"/blog/tags/machine learning/"},{name:"v-57f3a168",path:"/blog/tags/taproot/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-57f3a168").then(n)},meta:{pid:"tags",id:"taproot"}},{path:"/blog/tags/taproot/index.html",redirect:"/blog/tags/taproot/"},{name:"v-ef7c3fa2",path:"/blog/tags/miniscript/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-ef7c3fa2").then(n)},meta:{pid:"tags",id:"miniscript"}},{path:"/blog/tags/miniscript/index.html",redirect:"/blog/tags/miniscript/"},{name:"v-640144b2",path:"/blog/tags/Hardware Wallets/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-640144b2").then(n)},meta:{pid:"tags",id:"Hardware Wallets"}},{path:"/blog/tags/Hardware Wallets/index.html",redirect:"/blog/tags/Hardware Wallets/"},{name:"v-79c3de4b",path:"/blog/tags/getting started/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-79c3de4b").then(n)},meta:{pid:"tags",id:"getting started"}},{path:"/blog/tags/getting started/index.html",redirect:"/blog/tags/getting started/"},{name:"v-3fee41ed",path:"/blog/tags/rust/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-3fee41ed").then(n)},meta:{pid:"tags",id:"rust"}},{path:"/blog/tags/rust/index.html",redirect:"/blog/tags/rust/"},{name:"v-01a03a08",path:"/blog/tags/bitcoin-cli/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-01a03a08").then(n)},meta:{pid:"tags",id:"bitcoin-cli"}},{path:"/blog/tags/bitcoin-cli/index.html",redirect:"/blog/tags/bitcoin-cli/"},{name:"v-74edfe92",path:"/blog/tags/coin selection/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-74edfe92").then(n)},meta:{pid:"tags",id:"coin selection"}},{path:"/blog/tags/coin selection/index.html",redirect:"/blog/tags/coin selection/"},{name:"v-4e62fa1c",path:"/blog/tags/development/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4e62fa1c").then(n)},meta:{pid:"tags",id:"development"}},{path:"/blog/tags/development/index.html",redirect:"/blog/tags/development/"},{name:"v-0159a747",path:"/blog/tags/summer of bitcoin/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-0159a747").then(n)},meta:{pid:"tags",id:"summer of bitcoin"}},{path:"/blog/tags/summer of bitcoin/index.html",redirect:"/blog/tags/summer of bitcoin/"},{name:"v-0755ed11",path:"/blog/tags/security/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-0755ed11").then(n)},meta:{pid:"tags",id:"security"}},{path:"/blog/tags/security/index.html",redirect:"/blog/tags/security/"},{name:"v-543950a6",path:"/blog/tags/release/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-543950a6").then(n)},meta:{pid:"tags",id:"release"}},{path:"/blog/tags/release/index.html",redirect:"/blog/tags/release/"},{name:"v-a354115e",path:"/blog/author/Steve Myers/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-a354115e").then(n)},meta:{pid:"author",id:"Steve Myers"}},{path:"/blog/author/Steve Myers/index.html",redirect:"/blog/author/Steve Myers/"},{name:"v-22d0e252",path:"/blog/author/Daniela Brozzoni/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-22d0e252").then(n)},meta:{pid:"author",id:"Daniela Brozzoni"}},{path:"/blog/author/Daniela Brozzoni/index.html",redirect:"/blog/author/Daniela Brozzoni/"},{name:"v-82e16b5c",path:"/blog/author/Rajarshi Maitra/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-82e16b5c").then(n)},meta:{pid:"author",id:"Rajarshi Maitra"}},{path:"/blog/author/Rajarshi Maitra/index.html",redirect:"/blog/author/Rajarshi Maitra/"},{name:"v-3e6950f4",path:"/blog/author/waterst0ne/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-3e6950f4").then(n)},meta:{pid:"author",id:"waterst0ne"}},{path:"/blog/author/waterst0ne/index.html",redirect:"/blog/author/waterst0ne/"},{name:"v-600b5b28",path:"/blog/author/Lloyd Fournier/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-600b5b28").then(n)},meta:{pid:"author",id:"Lloyd Fournier"}},{path:"/blog/author/Lloyd Fournier/index.html",redirect:"/blog/author/Lloyd Fournier/"},{name:"v-d2b26530",path:"/blog/author/rorp/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-d2b26530").then(n)},meta:{pid:"author",id:"rorp"}},{path:"/blog/author/rorp/index.html",redirect:"/blog/author/rorp/"},{name:"v-5d54001e",path:"/blog/author/thunderbiscuit/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5d54001e").then(n)},meta:{pid:"author",id:"thunderbiscuit"}},{path:"/blog/author/thunderbiscuit/index.html",redirect:"/blog/author/thunderbiscuit/"},{name:"v-37829241",path:"/blog/author/Bitcoin Zavior/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-37829241").then(n)},meta:{pid:"author",id:"Bitcoin Zavior"}},{path:"/blog/author/Bitcoin Zavior/index.html",redirect:"/blog/author/Bitcoin Zavior/"},{name:"v-624fd61e",path:"/blog/author/Riccardo Casatta/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-624fd61e").then(n)},meta:{pid:"author",id:"Riccardo Casatta"}},{path:"/blog/author/Riccardo Casatta/index.html",redirect:"/blog/author/Riccardo Casatta/"},{name:"v-6b564fb4",path:"/blog/author/Gabriele Domenichini/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-6b564fb4").then(n)},meta:{pid:"author",id:"Gabriele Domenichini"}},{path:"/blog/author/Gabriele Domenichini/index.html",redirect:"/blog/author/Gabriele Domenichini/"},{name:"v-ad00c09c",path:"/blog/author/Alekos Filini/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-ad00c09c").then(n)},meta:{pid:"author",id:"Alekos Filini"}},{path:"/blog/author/Alekos Filini/index.html",redirect:"/blog/author/Alekos Filini/"},{name:"v-4eeab648",path:"/blog/author/Wszdexdrf/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4eeab648").then(n)},meta:{pid:"author",id:"Wszdexdrf"}},{path:"/blog/author/Wszdexdrf/index.html",redirect:"/blog/author/Wszdexdrf/"},{name:"v-91c10894",path:"/blog/author/Sandipan Dey/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-91c10894").then(n)},meta:{pid:"author",id:"Sandipan Dey"}},{path:"/blog/author/Sandipan Dey/index.html",redirect:"/blog/author/Sandipan Dey/"},{name:"v-a0d840b0",path:"/blog/author/César Alvarez Vallero/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-a0d840b0").then(n)},meta:{pid:"author",id:"César Alvarez Vallero"}},{path:"/blog/author/César Alvarez Vallero/index.html",redirect:"/blog/author/César Alvarez Vallero/"},{name:"v-c3507bb6",path:"/blog/page/2/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-c3507bb6").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/page/2/index.html",redirect:"/blog/page/2/"},{name:"v-c3507b78",path:"/blog/page/3/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-c3507b78").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/page/3/index.html",redirect:"/blog/page/3/"},{name:"v-c3507b3a",path:"/blog/page/4/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-c3507b3a").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/page/4/index.html",redirect:"/blog/page/4/"},{name:"v-5f2ac9cb",path:"/blog/author/Alekos Filini/page/2/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-5f2ac9cb").then(n)},meta:{pid:"author",id:"Alekos Filini"}},{path:"/blog/author/Alekos Filini/page/2/index.html",redirect:"/blog/author/Alekos Filini/page/2/"},{path:"*",component:Nc}],zc={title:"Bitcoin Dev Kit Documentation",description:"The Bitcoin Dev Kit (BDK) project (originally called Magical Bitcoin 🧙) aims to build a collection of tools and libraries that are designed to be a solid foundation for cross platform Bitcoin wallets, along with a fully working reference implementation wallet called Magical Bitcoin.",base:"/",headTags:[["meta",{name:"viewport",content:"width=device-width,initial-scale=1.0"}],["link",{rel:"preload",href:"/fonts/ibm-plex-mono-400.woff2",as:"font",crossorigin:!0}],["link",{rel:"apple-touch-icon",sizes:"180x180",href:"/img/favicon/apple-touch-icon.png"}],["link",{rel:"manifest",href:"/site.webmanifest"}],["link",{rel:"stylesheet",href:"/css/variables.css"}],["link",{name:"msapplication-config",content:"/browserconfig.xml"}],["link",{name:"msapplication-TileColor",content:"#ffffff"}],["link",{name:"theme-color",content:"#ffffff"}]],pages:[{title:"Home",frontmatter:{home:!0,heroText:"Bitcoin Dev Kit",tagline:"With BDK, you can seamlessly build cross platform mobile wallets",actionText:"Get started",actionLink:"/getting-started/",features:[{title:"Customizable",details:"Designed from the ground up to be easily customized to your application needs: blockchain backends, databases, signers, coin selection, key management and more.",image:"customizable"},{title:"Focus on what matters",details:"All of the low-level Bitcoin logic is handled by us, so you can focus on crafting custom-tailored user experiences.",image:"focus"},{title:"High performance & compact",details:"As lightweight as you need it to be and optimized to run on all modern-day embedded devices such as mobile phones, IoT devices, PoS terminals and more.",image:"mobile"}],meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"With BDK, you can seamlessly build cross platform mobile wallets"},{property:"og:description",content:"We are building native API's for C, Swift, Java & Kotlin so you can easily integrate Bitcoin in your preferred programming language on mobile."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"With BDK, you can seamlessly build cross platform mobile wallets"},{name:"twitter:description",content:"We are building native API's for C, Swift, Java & Kotlin so you can easily integrate Bitcoin in your preferred programming language on mobile."},{name:"twitter:url",content:"https://bitcoindevkit.org/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/",relativePath:"README.md",key:"v-330a32a2",path:"/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"2023 Q4 Project Update",frontmatter:{title:"2023 Q4 Project Update",description:"2023 Q4 update on the BDK project's progress.",authors:["Steve Myers","Daniela Brozzoni"],date:"2024-02-20",tags:["BDK","project"],draft:!1,meta:[{property:"article:published_time",content:"2024-02-20T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"2023 Q4 Project Update"},{property:"og:description",content:"2023 Q4 update on the BDK project's progress."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/2023_q4_update/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"2023 Q4 Project Update"},{name:"twitter:description",content:"2023 Q4 update on the BDK project's progress."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/2023_q4_update/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, project"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"project"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/2023_q4_update.html",relativePath:"_blog/2023_q4_update.md",key:"v-2c450c3f",path:"/blog/_2023-q4-update/",headers:[{level:3,title:"This Post",slug:"this-post"},{level:3,title:"End of Year Review",slug:"end-of-year-review"},{level:3,title:"Core BDK",slug:"core-bdk"},{level:3,title:"BDK-FFI",slug:"bdk-ffi"},{level:3,title:"BDK contributors spotlight",slug:"bdk-contributors-spotlight"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"2024 Q1 Project Update",frontmatter:{title:"2024 Q1 Project Update",description:"2024 Q1 update on the BDK project's progress.",authors:["Steve Myers"],date:"2024-03-21",tags:["BDK","project"],draft:!1,meta:[{property:"article:published_time",content:"2024-03-21T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"2024 Q1 Project Update"},{property:"og:description",content:"2024 Q1 update on the BDK project's progress."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/2024_q1_update/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"2024 Q1 Project Update"},{name:"twitter:description",content:"2024 Q1 update on the BDK project's progress."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/2024_q1_update/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, project"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"project"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/2024_q1_update.html",relativePath:"_blog/2024_q1_update.md",key:"v-5e744cf7",path:"/blog/_2024-q1-update/",headers:[{level:3,title:"Core BDK",slug:"core-bdk"},{level:3,title:"BDK-FFI",slug:"bdk-ffi"},{level:3,title:"Plans for Next Quarter",slug:"plans-for-next-quarter"},{level:3,title:"BDK contributors spotlight",slug:"bdk-contributors-spotlight"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"BDK wallet with Bitcoin core RPC",frontmatter:{title:"BDK wallet with Bitcoin core RPC ",description:"Tutorial showing usage of Bitcoin core backend with BDK wallet",authors:["Rajarshi Maitra"],date:"2021-08-21",tags:["tutorial","BDK","Bitcoin Core","RPC","Wallet"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2021-08-21T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK wallet with Bitcoin core RPC"},{property:"og:description",content:"Tutorial showing usage of Bitcoin core backend with BDK wallet"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/Bitcoin_Core_RPC_Demo/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK wallet with Bitcoin core RPC"},{name:"twitter:description",content:"Tutorial showing usage of Bitcoin core backend with BDK wallet"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/Bitcoin_Core_RPC_Demo/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, BDK, Bitcoin Core, RPC, Wallet"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"Bitcoin Core"},{property:"article:tag",content:"RPC"},{property:"article:tag",content:"Wallet"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/Bitcoin_Core_RPC_Demo.html",relativePath:"_blog/Bitcoin_Core_RPC_Demo.md",key:"v-7c0c45f9",path:"/blog/bitcoin-core-rpc-demo/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisite",slug:"prerequisite"},{level:2,title:"Setting Up",slug:"setting-up"},{level:2,title:"Setting dependencies",slug:"setting-dependencies"},{level:2,title:"Getting Descriptors",slug:"getting-descriptors"},{level:2,title:"Talking to Bitcoin Core Programmatically",slug:"talking-to-bitcoin-core-programmatically"},{level:2,title:"Get some balance in core wallet.",slug:"get-some-balance-in-core-wallet"},{level:2,title:"Setup the BDK wallet",slug:"setup-the-bdk-wallet"},{level:2,title:"Sending Sats Around",slug:"sending-sats-around"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Command Line introduction to Bitcoin Wallet Development using bdk-cli",frontmatter:{title:"Command Line introduction to Bitcoin Wallet Development using bdk-cli",description:"Intro to bdk-cli and wallet dev",authors:["waterst0ne"],date:"2022-09-22",tags:["bdk-cli","basics","novice"],meta:[{property:"article:published_time",content:"2022-09-22T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Command Line introduction to Bitcoin Wallet Development using bdk-cli"},{property:"og:description",content:"Intro to bdk-cli and wallet dev"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_cli_basics/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Command Line introduction to Bitcoin Wallet Development using bdk-cli"},{name:"twitter:description",content:"Intro to bdk-cli and wallet dev"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_cli_basics/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bdk-cli, basics, novice"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"basics"},{property:"article:tag",content:"novice"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_cli_basics.html",relativePath:"_blog/bdk_cli_basics.md",key:"v-0f4d5d15",path:"/blog/bdk-cli-basics/",headers:[{level:2,title:"Tutorial Goals",slug:"tutorial-goals"},{level:2,title:"A few things before you begin:",slug:"a-few-things-before-you-begin"},{level:3,title:"Outline of Tutorial and Installation notes:",slug:"outline-of-tutorial-and-installation-notes"},{level:3,title:"Brief Outline of Tutorial",slug:"brief-outline-of-tutorial"},{level:3,title:"Rust and Cargo installation:",slug:"rust-and-cargo-installation"},{level:3,title:"bdk-cli installation:",slug:"bdk-cli-installation"},{level:3,title:"Emoji Legend:",slug:"emoji-legend"},{level:2,title:"Step 0: Check Version of bdk-cli",slug:"step-0-check-version-of-bdk-cli"},{level:3,title:"Preview of bdk-cli help menu",slug:"preview-of-bdk-cli-help-menu"},{level:2,title:"Step 1: Seed Generate",slug:"step-1-seed-generate"},{level:3,title:"1a: Mnemonic word-list + XPRV (Extended Private Key) :key:",slug:"1a-mnemonic-word-list-xprv-extended-private-key-"},{level:3,title:"1b: Save XPRV (Extended Private Key) into environment variable",slug:"1b-save-xprv-extended-private-key-into-environment-variable"},{level:3,title:"1c: Verify environment variable XPRV_00 is active",slug:"1c-verify-environment-variable-xprv-00-is-active"},{level:3,title:"1d: Create Descriptor and Save into environment variable",slug:"1d-create-descriptor-and-save-into-environment-variable"},{level:3,title:"1e: Verify environment variable my_descriptor is active",slug:"1e-verify-environment-variable-my-descriptor-is-active"},{level:2,title:"Step 2: Generate Receive-Address",slug:"step-2-generate-receive-address"},{level:2,title:"Step 3: Send testnet bitcoin to the newly created receive-address",slug:"step-3-send-testnet-bitcoin-to-the-newly-created-receive-address"},{level:2,title:"Step 4: Sync the wallet",slug:"step-4-sync-the-wallet"},{level:2,title:"Step 5: Check the balance",slug:"step-5-check-the-balance"},{level:2,title:"Step 6: Create Transaction (PSBT)",slug:"step-6-create-transaction-psbt"},{level:3,title:"6a: export PSBT to environment-variable",slug:"6a-export-psbt-to-environment-variable"},{level:2,title:"Step 7: Sign Transaction (PSBT)",slug:"step-7-sign-transaction-psbt"},{level:3,title:"7a: export signed psbt to environment variable",slug:"7a-export-signed-psbt-to-environment-variable"},{level:2,title:"Step 8: Broadcast Transaction",slug:"step-8-broadcast-transaction"},{level:2,title:"Resources",slug:"resources"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"bdk_core: a new architecture for the Bitcoin Dev Kit",frontmatter:{title:"`bdk_core`: a new architecture for the Bitcoin Dev Kit",description:"A new architecture for the Bitcoin Dev Kit",authors:["Lloyd Fournier"],date:"2022-05-09",tags:["architecture"],draft:!1,meta:[{property:"article:published_time",content:"2022-05-09T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"bdk_core: a new architecture for the Bitcoin Dev Kit"},{property:"og:description",content:"A new architecture for the Bitcoin Dev Kit"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_core_pt1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"bdk_core: a new architecture for the Bitcoin Dev Kit"},{name:"twitter:description",content:"A new architecture for the Bitcoin Dev Kit"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_core_pt1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"architecture"},{property:"article:tag",content:"architecture"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_core_pt1.html",relativePath:"_blog/bdk_core_pt1.md",key:"v-2cebe183",path:"/blog/bdk-core-pt1/",headers:[{level:2,title:"The separation of policy and mechanism",slug:"the-separation-of-policy-and-mechanism"},{level:2,title:"A syncing mechansim without the policy",slug:"a-syncing-mechansim-without-the-policy"},{level:3,title:"A general syncing mechanism",slug:"a-general-syncing-mechanism"},{level:3,title:"How to store and index transactions",slug:"how-to-store-and-index-transactions"},{level:3,title:"Rolling back, rolling forward and syncing to disk",slug:"rolling-back-rolling-forward-and-syncing-to-disk"},{level:2,title:"Examples",slug:"examples"},{level:3,title:"Doing an initial sync of a descriptor that may already contain coins",slug:"doing-an-initial-sync-of-a-descriptor-that-may-already-contain-coins"},{level:3,title:"Doing a sync of a wallet after you already have sync'd",slug:"doing-a-sync-of-a-wallet-after-you-already-have-syncd"},{level:3,title:"Updating state when you get the data in real time",slug:"updating-state-when-you-get-the-data-in-real-time"},{level:2,title:"Feedback",slug:"feedback"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Using BDK with Tor",frontmatter:{title:"Using BDK with Tor",description:"How to integrate Tor client to sync BDK wallet with tor enabled blockchain service",authors:["rorp"],date:"2023-01-03",tags:["tutorial","tor","wallet","blockchain"],meta:[{property:"article:published_time",content:"2023-01-03T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Using BDK with Tor"},{property:"og:description",content:"How to integrate Tor client to sync BDK wallet with tor enabled blockchain service"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_with_tor/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Using BDK with Tor"},{name:"twitter:description",content:"How to integrate Tor client to sync BDK wallet with tor enabled blockchain service"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_with_tor/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, tor, wallet, blockchain"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"tor"},{property:"article:tag",content:"wallet"},{property:"article:tag",content:"blockchain"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_with_tor.html",relativePath:"_blog/bdk_with_tor.md",key:"v-353b78e1",path:"/blog/bdk-with-tor/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisite",slug:"prerequisite"},{level:2,title:"Setting Up",slug:"setting-up"},{level:2,title:"ElectrumBlockchain",slug:"electrumblockchain"},{level:2,title:"Blocking EsploraBlockchain",slug:"blocking-esplorablockchain"},{level:2,title:"Asynchronous EsploraBlockchain",slug:"asynchronous-esplorablockchain"},{level:2,title:"CompactFiltersBlockchain",slug:"compactfiltersblockchain"},{level:2,title:"Integrated Tor daemon",slug:"integrated-tor-daemon"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"BDK's Scope and Approach to Rust Bindings",frontmatter:{title:"BDK's Scope and Approach to Rust Bindings",description:"An outline of BDK's approach to language bindings and how we intend on supporting others build their own.",authors:["thunderbiscuit"],date:"2023-06-02",tags:["BDK","bindings"],meta:[{property:"article:published_time",content:"2023-06-02T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK's Scope and Approach to Rust Bindings"},{property:"og:description",content:"An outline of BDK's approach to language bindings and how we intend on supporting others build their own."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bindings-scope/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK's Scope and Approach to Rust Bindings"},{name:"twitter:description",content:"An outline of BDK's approach to language bindings and how we intend on supporting others build their own."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bindings-scope/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, bindings"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"bindings"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bindings-scope.html",relativePath:"_blog/bindings-scope.md",key:"v-3875825f",path:"/blog/bindings-scope/",headers:[{level:2,title:"Current architecture",slug:"current-architecture"},{level:2,title:"Moving forward: building a family of libraries",slug:"moving-forward-building-a-family-of-libraries"},{level:2,title:"Why can't we just build one big BDK library with everything in it?",slug:"why-cant-we-just-build-one-big-bdk-library-with-everything-in-it"},{level:2,title:"Are you looking to build Rust bindings yourself?",slug:"are-you-looking-to-build-rust-bindings-yourself"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"bdk-cli basics multi-sig 2 of 3 tutorial",frontmatter:{title:"bdk-cli basics multi-sig 2 of 3 tutorial",description:"Tutorial using command-line to create a 2 of 3 multi-sig Wallet and Spend",authors:["waterst0ne"],date:"2022-10-17",tags:["tutorial","bdk-cli","multi-sig"],hidden:!1,draft:!1,meta:[{property:"article:published_time",content:"2022-10-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"bdk-cli basics multi-sig 2 of 3 tutorial"},{property:"og:description",content:"Tutorial using command-line to create a 2 of 3 multi-sig Wallet and Spend"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk-cli_basics_multisig_2of3/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"bdk-cli basics multi-sig 2 of 3 tutorial"},{name:"twitter:description",content:"Tutorial using command-line to create a 2 of 3 multi-sig Wallet and Spend"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk-cli_basics_multisig_2of3/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, bdk-cli, multi-sig"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"multi-sig"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk-cli_basics_multisig_2of3.html",relativePath:"_blog/bdk-cli_basics_multisig_2of3.md",key:"v-8bd632d6",path:"/blog/bdk-cli-basics-multisig-2of3/",headers:[{level:2,title:"2-of-3 Multi-Signature Descriptor Wallet using bdk-cli",slug:"2-of-3-multi-signature-descriptor-wallet-using-bdk-cli"},{level:2,title:"Overview of the tutorial",slug:"overview-of-the-tutorial"},{level:2,title:"Step 1: Generate the XPRVs (Extended-Keys) and Save to environment variables",slug:"step-1-generate-the-xprvs-extended-keys-and-save-to-environment-variables"},{level:3,title:"1a: Verify XPRV environment variables are Active",slug:"1a-verify-xprv-environment-variables-are-active"},{level:2,title:"Step 2: Generate XPUBs (Extended Public Keys) & Save to environment variables",slug:"step-2-generate-xpubs-extended-public-keys-save-to-environment-variables"},{level:3,title:"2a: Verify XPUB environment variables",slug:"2a-verify-xpub-environment-variables"},{level:2,title:"Step 3: Create Single-Wallet Descriptors",slug:"step-3-create-single-wallet-descriptors"},{level:2,title:"Step 4: Create Multi-Sig-Descriptor Wallets",slug:"step-4-create-multi-sig-descriptor-wallets"},{level:3,title:"4a: Verify Multi-Sig-Descriptor environment variables are active",slug:"4a-verify-multi-sig-descriptor-environment-variables-are-active"},{level:2,title:"Step 5: Generate Receive Address by using Multi-Sig-Descriptor Wallets",slug:"step-5-generate-receive-address-by-using-multi-sig-descriptor-wallets"},{level:2,title:"Step 6: Send Testnet Bitcoin to the newly created receive-address",slug:"step-6-send-testnet-bitcoin-to-the-newly-created-receive-address"},{level:2,title:"Step 7: Sync one of the Multi-Sig Wallets",slug:"step-7-sync-one-of-the-multi-sig-wallets"},{level:2,title:"Step 8: Check Balance Multi-Sig Wallets",slug:"step-8-check-balance-multi-sig-wallets"},{level:2,title:"Step 9: Check Multi-Sig Policies on Descriptor Wallet",slug:"step-9-check-multi-sig-policies-on-descriptor-wallet"},{level:3,title:"SpendingPolicyRequired for complex descriptors",slug:"spendingpolicyrequired-for-complex-descriptors"},{level:2,title:"Step 10: Create a Transaction (PSBT)",slug:"step-10-create-a-transaction-psbt"},{level:3,title:"Export UNSIGNED_PSBT to environment variable",slug:"export-unsigned-psbt-to-environment-variable"},{level:3,title:"Verify UNSIGNED_PSBT environment variable",slug:"verify-unsigned-psbt-environment-variable"},{level:2,title:"Step 11: SIGN the Transaction",slug:"step-11-sign-the-transaction"},{level:3,title:"1st Wallet Signs the transaction",slug:"1st-wallet-signs-the-transaction"},{level:3,title:"2nd Wallet Signs the transaction",slug:"2nd-wallet-signs-the-transaction"},{level:2,title:"Step 12: Broadcast Transaction",slug:"step-12-broadcast-transaction"},{level:3,title:"Verify Transaction",slug:"verify-transaction"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"bdk-rn: Behind the scenes",frontmatter:{title:"`bdk-rn`: Behind the scenes",description:"bdk-rn: React Native version of BitcoinDevKit. Insight into how bdk-rn was developed",authors:["Bitcoin Zavior"],date:"2022-07-10",tags:["BDK-RN","Development","Architecture"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-07-10T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"bdk-rn: Behind the scenes"},{property:"og:description",content:"bdk-rn: React Native version of BitcoinDevKit. Insight into how bdk-rn was developed"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_rn_making_of/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"bdk-rn: Behind the scenes"},{name:"twitter:description",content:"bdk-rn: React Native version of BitcoinDevKit. Insight into how bdk-rn was developed"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_rn_making_of/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK-RN, Development, Architecture"},{property:"article:tag",content:"BDK-RN"},{property:"article:tag",content:"Development"},{property:"article:tag",content:"Architecture"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_rn_making_of.html",relativePath:"_blog/bdk_rn_making_of.md",key:"v-3eaa044d",path:"/blog/bdk-rn-making-of/",headers:[{level:2,title:"React Native Architecture",slug:"react-native-architecture"},{level:2,title:"Native Integration",slug:"native-integration"},{level:2,title:"Android Module",slug:"android-module"},{level:2,title:"References",slug:"references"},{level:2,title:"Feedback",slug:"feedback"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"BDK wallet as a BIP157 SPV light client",frontmatter:{title:"BDK wallet as a BIP157 SPV light client",description:"Tutorial showing usage of compact filters (BIP157) using bdk-cli command line tools",authors:["Rajarshi Maitra"],date:"2021-06-20",tags:["tutorial","BDK","bdk-cli","compact_filters","BIP157","Neutrino"],meta:[{property:"article:published_time",content:"2021-06-20T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK wallet as a BIP157 SPV light client"},{property:"og:description",content:"Tutorial showing usage of compact filters (BIP157) using bdk-cli command line tools"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/compact_filters_demo/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK wallet as a BIP157 SPV light client"},{name:"twitter:description",content:"Tutorial showing usage of compact filters (BIP157) using bdk-cli command line tools"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/compact_filters_demo/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, BDK, bdk-cli, compact_filters, BIP157, Neutrino"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"compact_filters"},{property:"article:tag",content:"BIP157"},{property:"article:tag",content:"Neutrino"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/compact_filters_demo.html",relativePath:"_blog/compact_filters_demo.md",key:"v-07ff1843",path:"/blog/compact-filters-demo/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Compact Filters:",slug:"compact-filters"},{level:3,title:"BDK and Compact filters",slug:"bdk-and-compact-filters"},{level:3,title:"bdk-cli",slug:"bdk-cli"},{level:2,title:"Tutorial Scope",slug:"tutorial-scope"},{level:2,title:"Prerequisites",slug:"prerequisites"},{level:3,title:"Install and run bitcoind",slug:"install-and-run-bitcoind"},{level:3,title:"Install and run bdk-cli",slug:"install-and-run-bdk-cli"},{level:2,title:"Tutorial",slug:"tutorial"},{level:3,title:"Bitcoin Core Wallet Generation",slug:"bitcoin-core-wallet-generation"},{level:3,title:"BDK Wallet Generation",slug:"bdk-wallet-generation"},{level:3,title:"Recieve Coins",slug:"recieve-coins"},{level:3,title:"Creating a transaction.",slug:"creating-a-transaction"},{level:3,title:"Sign and Broadcast the transaction",slug:"sign-and-broadcast-the-transaction"},{level:3,title:"Confirming the Transaction",slug:"confirming-the-transaction"},{level:3,title:"Shutdown Docker",slug:"shutdown-docker"},{level:2,title:"End Words",slug:"end-words"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Making Descriptor-based paper wallets",frontmatter:{title:"Making Descriptor-based paper wallets",description:"Demonstrate how to create descriptor-based paper wallet and how to spend them with bdk",authors:["Riccardo Casatta","Steve Myers"],date:"2021-03-30",tags:["guide","descriptor","paper wallets"],meta:[{property:"article:published_time",content:"2021-03-30T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Making Descriptor-based paper wallets"},{property:"og:description",content:"Demonstrate how to create descriptor-based paper wallet and how to spend them with bdk"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/descriptor_based_paper_wallet/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Making Descriptor-based paper wallets"},{name:"twitter:description",content:"Demonstrate how to create descriptor-based paper wallet and how to spend them with bdk"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/descriptor_based_paper_wallet/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"guide, descriptor, paper wallets"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"descriptor"},{property:"article:tag",content:"paper wallets"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/descriptor_based_paper_wallet.html",relativePath:"_blog/descriptor_based_paper_wallet.md",key:"v-9504490e",path:"/blog/descriptor-based-paper-wallet/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"About paper wallets",slug:"about-paper-wallets"},{level:2,title:"Descriptors",slug:"descriptors"},{level:2,title:"Example use case",slug:"example-use-case"},{level:2,title:"Creating the paper wallet",slug:"creating-the-paper-wallet"},{level:2,title:"BDK",slug:"bdk"},{level:2,title:"Funding tx",slug:"funding-tx"},{level:2,title:"Sweep tx",slug:"sweep-tx"},{level:3,title:"Step 1: Alice creates and signs a PSBT",slug:"step-1-alice-creates-and-signs-a-psbt"},{level:3,title:"Step 2: Barbara signs Alice's signed PSBT and broadcasts the tx",slug:"step-2-barbara-signs-alices-signed-psbt-and-broadcasts-the-tx"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"A Multisig between BDK and Core",frontmatter:{title:"A Multisig between BDK and Core",description:"Guide to setup a 2-of-2 multisig using Bitcoin Core and BDK",authors:["Gabriele Domenichini"],date:"2020-11-18",tags:["guide","descriptor"],meta:[{property:"article:published_time",content:"2020-11-18T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"A Multisig between BDK and Core"},{property:"og:description",content:"Guide to setup a 2-of-2 multisig using Bitcoin Core and BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/descriptors_in_the_wild/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"A Multisig between BDK and Core"},{name:"twitter:description",content:"Guide to setup a 2-of-2 multisig using Bitcoin Core and BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/descriptors_in_the_wild/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"guide, descriptor"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"descriptor"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/descriptors_in_the_wild.html",relativePath:"_blog/descriptors_in_the_wild.md",key:"v-c6756cce",path:"/blog/descriptors-in-the-wild/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"The use case",slug:"the-use-case"},{level:2,title:"The role of Descriptors",slug:"the-role-of-descriptors"},{level:2,title:"Our playground",slug:"our-playground"},{level:3,title:"1. Creating the seeds and the derived Extended Public keys",slug:"1-creating-the-seeds-and-the-derived-extended-public-keys"},{level:3,title:"2. Creation of the multi signature descriptor for each wallet",slug:"2-creation-of-the-multi-signature-descriptor-for-each-wallet"},{level:3,title:"3. Use each other's software to receive testnet coins from a faucet",slug:"3-use-each-others-software-to-receive-testnet-coins-from-a-faucet"},{level:3,title:"4. we return part of the satoshis received back to the faucet",slug:"4-we-return-part-of-the-satoshis-received-back-to-the-faucet"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"BDK-FLUTTER: Building Flutter Apps with BDK",frontmatter:{title:"BDK-FLUTTER: Building Flutter Apps with BDK",description:"A tutorial and guide to using bdk-flutter for building bitcoin apps",authors:["Bitcoin Zavior"],date:"2022-10-05",tags:["bitcoin","React Native","Flutter","iOS","Android","mobile","bdk-rn","bdk","tutorial","guide","wallet"],meta:[{property:"article:published_time",content:"2022-10-05T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK-FLUTTER: Building Flutter Apps with BDK"},{property:"og:description",content:"A tutorial and guide to using bdk-flutter for building bitcoin apps"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_flutter/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK-FLUTTER: Building Flutter Apps with BDK"},{name:"twitter:description",content:"A tutorial and guide to using bdk-flutter for building bitcoin apps"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_flutter/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bitcoin, React Native, Flutter, iOS, Android, mobile, bdk-rn, bdk, tutorial, guide, wallet"},{property:"article:tag",content:"bitcoin"},{property:"article:tag",content:"React Native"},{property:"article:tag",content:"Flutter"},{property:"article:tag",content:"iOS"},{property:"article:tag",content:"Android"},{property:"article:tag",content:"mobile"},{property:"article:tag",content:"bdk-rn"},{property:"article:tag",content:"bdk"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"wallet"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/exploring_bdk_flutter.html",relativePath:"_blog/exploring_bdk_flutter.md",key:"v-56536559",path:"/blog/exploring-bdk-flutter/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Prerequisites",slug:"prerequisites"},{level:3,title:"Bitcoin Basics",slug:"bitcoin-basics"},{level:2,title:"Bitcoin Dev Kit and bdk-flutter",slug:"bitcoin-dev-kit-and-bdk-flutter"},{level:2,title:"Getting Started",slug:"getting-started"},{level:2,title:"Setting up Flutter app structure",slug:"setting-up-flutter-app-structure"},{level:2,title:"Installing bdk-flutter",slug:"installing-bdk-flutter"},{level:2,title:"Configuring",slug:"configuring"},{level:2,title:"Importing bdk-flutter",slug:"importing-bdk-flutter"},{level:2,title:"Calling bdk-flutter methods",slug:"calling-bdk-flutter-methods"},{level:2,title:"Creating a wallet",slug:"creating-a-wallet"},{level:2,title:"UTXOs and balance",slug:"utxos-and-balance"},{level:2,title:"Restoring a wallet",slug:"restoring-a-wallet"},{level:2,title:"Sending bitcoin",slug:"sending-bitcoin"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"BDK-RN: Building React Native Apps with BDK",frontmatter:{title:"BDK-RN: Building React Native Apps with BDK",description:"A tutorial and guide to using bdk-rn for building bitcoin apps",authors:["Bitcoin Zavior"],date:"2022-08-05",tags:["bitcoin","React Native","iOS","Android","mobile","bdk-rn","bdk","tutorial","guide","wallet"],meta:[{property:"article:published_time",content:"2022-08-05T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK-RN: Building React Native Apps with BDK"},{property:"og:description",content:"A tutorial and guide to using bdk-rn for building bitcoin apps"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_rn/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK-RN: Building React Native Apps with BDK"},{name:"twitter:description",content:"A tutorial and guide to using bdk-rn for building bitcoin apps"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_rn/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bitcoin, React Native, iOS, Android, mobile, bdk-rn, bdk, tutorial, guide, wallet"},{property:"article:tag",content:"bitcoin"},{property:"article:tag",content:"React Native"},{property:"article:tag",content:"iOS"},{property:"article:tag",content:"Android"},{property:"article:tag",content:"mobile"},{property:"article:tag",content:"bdk-rn"},{property:"article:tag",content:"bdk"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"wallet"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/exploring_bdk_rn.html",relativePath:"_blog/exploring_bdk_rn.md",key:"v-f58ec8f2",path:"/blog/exploring-bdk-rn/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Prerequisites",slug:"prerequisites"},{level:3,title:"Bitcoin Basics",slug:"bitcoin-basics"},{level:2,title:"Bitcoin Dev Kit and bdk-rn",slug:"bitcoin-dev-kit-and-bdk-rn"},{level:2,title:"Getting Started",slug:"getting-started"},{level:2,title:"Setting up styles and RN app structure",slug:"setting-up-styles-and-rn-app-structure"},{level:2,title:"Installing bdk-rn",slug:"installing-bdk-rn"},{level:2,title:"Importing bdk-rn",slug:"importing-bdk-rn"},{level:2,title:"Calling bdk-rn methods",slug:"calling-bdk-rn-methods"},{level:2,title:"Creating a wallet",slug:"creating-a-wallet"},{level:2,title:"UTXOs and balance",slug:"utxos-and-balance"},{level:2,title:"Restoring wallet",slug:"restoring-wallet"},{level:2,title:"Sending bitcoin",slug:"sending-bitcoin"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Fee estimation for light-clients (Part 2)",frontmatter:{title:"Fee estimation for light-clients (Part 2)",description:"Applying machine learning to the bitcoin fee estimation problem",authors:["Riccardo Casatta"],date:"2021-01-25",tags:["fee","machine learning"],permalink:"/blog/2021/01/fee-estimation-for-light-clients-part-2/",meta:[{property:"article:published_time",content:"2021-01-25T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Fee estimation for light-clients (Part 2)"},{property:"og:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Fee estimation for light-clients (Part 2)"},{name:"twitter:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"fee, machine learning"},{property:"article:tag",content:"fee"},{property:"article:tag",content:"machine learning"}],layout:"Post"},regularPath:"/_blog/fee_estimation_for_light_clients_part_2.html",relativePath:"_blog/fee_estimation_for_light_clients_part_2.md",key:"v-2c605799",path:"/blog/2021/01/fee-estimation-for-light-clients-part-2/",headers:[{level:2,title:"The dataset",slug:"the-dataset"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Fee estimation for light-clients (Part 3)",frontmatter:{title:"Fee estimation for light-clients (Part 3)",description:"Applying machine learning to the bitcoin fee estimation problem",authors:["Riccardo Casatta"],date:"2021-01-25",tags:["fee","machine learning"],permalink:"/blog/2021/01/fee-estimation-for-light-clients-part-3/",meta:[{property:"article:published_time",content:"2021-01-25T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Fee estimation for light-clients (Part 3)"},{property:"og:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Fee estimation for light-clients (Part 3)"},{name:"twitter:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"fee, machine learning"},{property:"article:tag",content:"fee"},{property:"article:tag",content:"machine learning"}],layout:"Post"},regularPath:"/_blog/fee_estimation_for_light_clients_part_3.html",relativePath:"_blog/fee_estimation_for_light_clients_part_3.md",key:"v-57698579",path:"/blog/2021/01/fee-estimation-for-light-clients-part-3/",headers:[{level:2,title:"The model",slug:"the-model"},{level:2,title:"The prediction phase",slug:"the-prediction-phase"},{level:2,title:"Conclusion and future development",slug:"conclusion-and-future-development"},{level:2,title:"Acknowledgements",slug:"acknowledgements"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"The first BDK Taproot TX: a look at the code (Part 1)",frontmatter:{title:"The first BDK Taproot TX: a look at the code (Part 1)",description:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction",authors:["Alekos Filini"],date:"2021-11-15",tags:["BDK","taproot","miniscript"],permalink:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1",meta:[{property:"article:published_time",content:"2021-11-15T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"The first BDK Taproot TX: a look at the code (Part 1)"},{property:"og:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"The first BDK Taproot TX: a look at the code (Part 1)"},{name:"twitter:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, taproot, miniscript"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"taproot"},{property:"article:tag",content:"miniscript"}],layout:"Post"},regularPath:"/_blog/first_bdk_taproot_tx.html",relativePath:"_blog/first_bdk_taproot_tx.md",key:"v-9145467a",path:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/",headers:[{level:2,title:"Backstory",slug:"backstory"},{level:2,title:"rust-bitcoin",slug:"rust-bitcoin"},{level:2,title:"rust-miniscript",slug:"rust-miniscript"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Fee estimation for light-clients (Part 1)",frontmatter:{title:"Fee estimation for light-clients (Part 1)",description:"Applying machine learning to the bitcoin fee estimation problem",authors:["Riccardo Casatta"],date:"2021-01-25",tags:["fee","machine learning"],permalink:"/blog/2021/01/fee-estimation-for-light-clients-part-1/",meta:[{property:"article:published_time",content:"2021-01-25T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Fee estimation for light-clients (Part 1)"},{property:"og:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Fee estimation for light-clients (Part 1)"},{name:"twitter:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"fee, machine learning"},{property:"article:tag",content:"fee"},{property:"article:tag",content:"machine learning"}],layout:"Post"},regularPath:"/_blog/fee_estimation_for_light_clients_part_1.html",relativePath:"_blog/fee_estimation_for_light_clients_part_1.md",key:"v-015729b9",path:"/blog/2021/01/fee-estimation-for-light-clients-part-1/",headers:[{level:2,title:"Introduction: what is fee estimation?",slug:"introduction-what-is-fee-estimation"},{level:2,title:"The problem",slug:"the-problem"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"The first BDK Taproot TX: a look at the code (Part 2)",frontmatter:{title:"The first BDK Taproot TX: a look at the code (Part 2)",description:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction",authors:["Alekos Filini"],date:"2021-12-10",tags:["BDK","taproot","miniscript"],permalink:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2",meta:[{property:"article:published_time",content:"2021-12-10T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"The first BDK Taproot TX: a look at the code (Part 2)"},{property:"og:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"The first BDK Taproot TX: a look at the code (Part 2)"},{name:"twitter:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, taproot, miniscript"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"taproot"},{property:"article:tag",content:"miniscript"}],layout:"Post"},regularPath:"/_blog/first_bdk_taproot_tx_part_2.html",relativePath:"_blog/first_bdk_taproot_tx_part_2.md",key:"v-2cf72b39",path:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/",headers:[{level:2,title:"Shortcuts",slug:"shortcuts"},{level:2,title:"Utilities",slug:"utilities"},{level:2,title:"Wrap Fallible Methods",slug:"wrap-fallible-methods"},{level:2,title:"Descriptor Metadata",slug:"descriptor-metadata"},{level:2,title:"Policy",slug:"policy"},{level:2,title:"Signer",slug:"signer"},{level:2,title:"PSBT Metadata",slug:"psbt-metadata"},{level:2,title:"descriptor!() Macro",slug:"descriptor-macro"},{level:3,title:"tr() Descriptors",slug:"tr-descriptors"},{level:3,title:"multi_a() Operator",slug:"multi-a-operator"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Getting Started with rust-hwi",frontmatter:{title:"Getting Started with rust-hwi",description:"This post will help one understand and develop for hardware wallets using BDK",authors:["Wszdexdrf"],date:"2022-08-16",tags:["BDK","Development","Hardware Wallets"],draft:!1,meta:[{property:"article:published_time",content:"2022-08-16T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Getting Started with rust-hwi"},{property:"og:description",content:"This post will help one understand and develop for hardware wallets using BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/getting_started_with_rust_hwi/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Getting Started with rust-hwi"},{name:"twitter:description",content:"This post will help one understand and develop for hardware wallets using BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/getting_started_with_rust_hwi/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, Development, Hardware Wallets"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"Development"},{property:"article:tag",content:"Hardware Wallets"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/getting_started_with_rust_hwi.html",relativePath:"_blog/getting_started_with_rust_hwi.md",key:"v-11d64359",path:"/blog/getting-started-with-rust-hwi/",headers:[{level:2,title:"Fundamentals",slug:"fundamentals"},{level:2,title:"Integration with BDK",slug:"integration-with-bdk"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Hello World!",frontmatter:{title:"Hello World!",description:"Getting started using the BDK library in a very simple Rust project",authors:["Alekos Filini"],date:"2020-12-18",tags:["getting started","rust"],permalink:"/blog/2020/12/hello-world/",meta:[{property:"article:published_time",content:"2020-12-18T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Hello World!"},{property:"og:description",content:"Getting started using the BDK library in a very simple Rust project"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2020/12/hello-world/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Hello World!"},{name:"twitter:description",content:"Getting started using the BDK library in a very simple Rust project"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2020/12/hello-world/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"getting started, rust"},{property:"article:tag",content:"getting started"},{property:"article:tag",content:"rust"}],layout:"Post"},regularPath:"/_blog/hello-world.html",relativePath:"_blog/hello-world.md",key:"v-5d749fce",path:"/blog/2020/12/hello-world/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Design Goals",slug:"design-goals"},{level:2,title:"The Wallet Structure",slug:"the-wallet-structure"},{level:2,title:"Custom Database and Blockchain types",slug:"custom-database-and-blockchain-types"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Hidden Powers of Miniscript Policy & Descriptors",frontmatter:{title:"Hidden Powers of Miniscript Policy & Descriptors",description:"Introduction to Descriptor and Miniscript, making a Multisig Wallet and Testing Miniscript Policies",authors:["Sandipan Dey","Rajarshi Maitra"],date:"2022-01-02",tags:["tutorial","bdk","bdk-cli","miniscript","descriptor","bitcoin-cli"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-01-02T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Hidden Powers of Miniscript Policy & Descriptors"},{property:"og:description",content:"Introduction to Descriptor and Miniscript, making a Multisig Wallet and Testing Miniscript Policies"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/hidden-power-of-bitcoin/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Hidden Powers of Miniscript Policy & Descriptors"},{name:"twitter:description",content:"Introduction to Descriptor and Miniscript, making a Multisig Wallet and Testing Miniscript Policies"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/hidden-power-of-bitcoin/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, bdk, bdk-cli, miniscript, descriptor, bitcoin-cli"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"bdk"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"miniscript"},{property:"article:tag",content:"descriptor"},{property:"article:tag",content:"bitcoin-cli"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/hidden-power-of-bitcoin.html",relativePath:"_blog/hidden-power-of-bitcoin.md",key:"v-ab5ba3ce",path:"/blog/hidden-power-of-bitcoin/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Script",slug:"script"},{level:2,title:"Miniscript",slug:"miniscript"},{level:2,title:"Descriptors",slug:"descriptors"},{level:2,title:"Where it all comes together...",slug:"where-it-all-comes-together"},{level:3,title:"Keys and Generating Addresses",slug:"keys-and-generating-addresses"},{level:3,title:"Making a MultiSig Descriptor for Funds",slug:"making-a-multisig-descriptor-for-funds"},{level:2,title:"Retention Bonus - Smart Contract with Bitcoin",slug:"retention-bonus-smart-contract-with-bitcoin"},{level:2,title:"Inspirations",slug:"inspirations"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Improving coin selection in BDK",frontmatter:{title:"Improving coin selection in BDK",description:"A brief description of the work done in the coin selection module in BDK during Summer of Bitcoin 2022",date:"2022-08-17",tags:["coin selection","BDK","development","summer of bitcoin"],authors:["César Alvarez Vallero"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-08-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Improving coin selection in BDK"},{property:"og:description",content:"A brief description of the work done in the coin selection module in BDK during Summer of Bitcoin 2022"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/improving_coin_selection_in_BDK/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Improving coin selection in BDK"},{name:"twitter:description",content:"A brief description of the work done in the coin selection module in BDK during Summer of Bitcoin 2022"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/improving_coin_selection_in_BDK/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"coin selection, BDK, development, summer of bitcoin"},{property:"article:tag",content:"coin selection"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"development"},{property:"article:tag",content:"summer of bitcoin"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/improving_coin_selection_in_BDK.html",relativePath:"_blog/improving_coin_selection_in_BDK.md",key:"v-d0375c8e",path:"/blog/improving-coin-selection-in-bdk/",headers:[{level:2,title:"Waste",slug:"waste"},{level:3,title:"How it works?",slug:"how-it-works"},{level:3,title:"What has been done",slug:"what-has-been-done"},{level:3,title:"Work in progress",slug:"work-in-progress"},{level:2,title:"Further Improvements",slug:"further-improvements"},{level:3,title:"Privacy",slug:"privacy"},{level:3,title:"Flexibility",slug:"flexibility"},{level:2,title:"Conclusion",slug:"conclusion"},{level:2,title:"Acknowledgements",slug:"acknowledgements"},{level:2,title:"References",slug:"references"},{level:3,title:"About coin selection considerations",slug:"about-coin-selection-considerations"},{level:3,title:"About Waste metric",slug:"about-waste-metric"},{level:3,title:"About improving privacy in coin selection",slug:"about-improving-privacy-in-coin-selection"},{level:3,title:"About bdk_core",slug:"about-bdk-core"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Security Advisory: Miniscript MINIMALIF Bug",frontmatter:{title:"Security Advisory: Miniscript MINIMALIF Bug",description:"Security advisory on the recent Miniscript MINIMALIF bug. How to check if you are affected and what to do next.",authors:["Alekos Filini"],date:"2022-04-19",tags:["miniscript","security"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-04-19T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Security Advisory: Miniscript MINIMALIF Bug"},{property:"og:description",content:"Security advisory on the recent Miniscript MINIMALIF bug. How to check if you are affected and what to do next."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/miniscript_vulnerability/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Security Advisory: Miniscript MINIMALIF Bug"},{name:"twitter:description",content:"Security advisory on the recent Miniscript MINIMALIF bug. How to check if you are affected and what to do next."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/miniscript_vulnerability/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"miniscript, security"},{property:"article:tag",content:"miniscript"},{property:"article:tag",content:"security"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/miniscript_vulnerability.html",relativePath:"_blog/miniscript_vulnerability.md",key:"v-10852eea",path:"/blog/miniscript-vulnerability/",headers:[{level:2,title:"How to check if you are vulnerable",slug:"how-to-check-if-you-are-vulnerable"},{level:2,title:"Next steps",slug:"next-steps"},{level:3,title:"If you are affected",slug:"if-you-are-affected"},{level:3,title:"Everybody",slug:"everybody"},{level:2,title:"Consequences of the update",slug:"consequences-of-the-update"},{level:2,title:"Footnote: How we analyzed the blockchain",slug:"footnote-how-we-analyzed-the-blockchain"},{level:2,title:"Correction (2022-04-25)",slug:"correction-2022-04-25"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Release v0.3.0",frontmatter:{title:"Release v0.3.0",description:"Announcing the v0.3.0 release of BDK",authors:["Alekos Filini"],date:"2021-01-20",tags:["rust","release"],permalink:"/blog/2021/01/release-v0.3.0/",meta:[{property:"article:published_time",content:"2021-01-20T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.3.0"},{property:"og:description",content:"Announcing the v0.3.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/release-v0.3.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.3.0"},{name:"twitter:description",content:"Announcing the v0.3.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/release-v0.3.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.3.0.html",relativePath:"_blog/release-0.3.0.md",key:"v-05df4999",path:"/blog/2021/01/release-v0.3.0/",headers:[{level:2,title:"What's new in v0.3.0",slug:"whats-new-in-v030"},{level:3,title:"Less verbosity when using Wallet::new_offline()",slug:"less-verbosity-when-using-walletnew-offline"},{level:3,title:"No more error conversions in DescriptorTemplate",slug:"no-more-error-conversions-in-descriptortemplate"},{level:3,title:"A new repo for the CLI",slug:"a-new-repo-for-the-cli"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Release v0.2.0",frontmatter:{title:"Release v0.2.0",description:"Announcing the v0.2.0 release of BDK",authors:["Alekos Filini"],date:"2020-12-21",tags:["rust","release"],permalink:"/blog/2020/12/release-v0.2.0/",meta:[{property:"article:published_time",content:"2020-12-21T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.2.0"},{property:"og:description",content:"Announcing the v0.2.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2020/12/release-v0.2.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.2.0"},{name:"twitter:description",content:"Announcing the v0.2.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2020/12/release-v0.2.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.2.0.html",relativePath:"_blog/release-0.2.0.md",key:"v-edd5570e",path:"/blog/2020/12/release-v0.2.0/",headers:[{level:2,title:"What's new in v0.2.0",slug:"whats-new-in-v020"},{level:3,title:"A new name",slug:"a-new-name"},{level:3,title:"Branch and Bound coin selection",slug:"branch-and-bound-coin-selection"},{level:3,title:"Key generation",slug:"key-generation"},{level:3,title:"Generic key types",slug:"generic-key-types"},{level:3,title:"Descriptor templates",slug:"descriptor-templates"},{level:3,title:"Easier creation of Blockchain and Database",slug:"easier-creation-of-blockchain-and-database"},{level:3,title:"descriptor!() macro",slug:"descriptor-macro"},{level:3,title:"Support for sortedmulti()",slug:"support-for-sortedmulti"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Release v0.5.0",frontmatter:{title:"Release v0.5.0",description:"Announcing the v0.5.0 release of BDK",authors:["Alekos Filini"],date:"2021-03-18",tags:["rust","release"],permalink:"/blog/2021/03/release-v0.5.0/",meta:[{property:"article:published_time",content:"2021-03-18T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.5.0"},{property:"og:description",content:"Announcing the v0.5.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/03/release-v0.5.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.5.0"},{name:"twitter:description",content:"Announcing the v0.5.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/03/release-v0.5.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.5.0.html",relativePath:"_blog/release-0.5.0.md",key:"v-0119984e",path:"/blog/2021/03/release-v0.5.0/",headers:[{level:2,title:"What's new in v0.5.0",slug:"whats-new-in-v050"},{level:3,title:"Dual Licensing",slug:"dual-licensing"},{level:3,title:"Spending foreign UTXOs",slug:"spending-foreign-utxos"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Release v0.8.0",frontmatter:{title:"Release v0.8.0",description:"Announcing the v0.8.0 release of BDK",authors:["Alekos Filini"],date:"2021-06-14",tags:["rust","release"],permalink:"/blog/2021/06/release-v0.8.0/",meta:[{property:"article:published_time",content:"2021-06-14T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.8.0"},{property:"og:description",content:"Announcing the v0.8.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/06/release-v0.8.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.8.0"},{name:"twitter:description",content:"Announcing the v0.8.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/06/release-v0.8.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.8.0.html",relativePath:"_blog/release-0.8.0.md",key:"v-75d11339",path:"/blog/2021/06/release-v0.8.0/",headers:[{level:2,title:"What's new in v0.8.0",slug:"whats-new-in-v080"},{level:3,title:"Getting the Derivation Index",slug:"getting-the-derivation-index"},{level:3,title:"Explicitly Enable non-ALL Sighashes",slug:"explicitly-enable-non-all-sighashes"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Release v0.6.0",frontmatter:{title:"Release v0.6.0",description:"Announcing the v0.6.0 release of BDK",authors:["Alekos Filini"],date:"2021-04-15",tags:["rust","release"],permalink:"/blog/2021/04/release-v0.6.0/",meta:[{property:"article:published_time",content:"2021-04-15T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.6.0"},{property:"og:description",content:"Announcing the v0.6.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/04/release-v0.6.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.6.0"},{name:"twitter:description",content:"Announcing the v0.6.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/04/release-v0.6.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.6.0.html",relativePath:"_blog/release-0.6.0.md",key:"v-7c3d28f9",path:"/blog/2021/04/release-v0.6.0/",headers:[{level:2,title:"What's new in v0.6.0",slug:"whats-new-in-v060"},{level:3,title:"A new way to generate addresses",slug:"a-new-way-to-generate-addresses"},{level:3,title:"Easier multiparty transaction creation",slug:"easier-multiparty-transaction-creation"},{level:3,title:"Renamed types",slug:"renamed-types"},{level:3,title:"New MSRV",slug:"new-msrv"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Release v0.7.0",frontmatter:{title:"Release v0.7.0",description:"Announcing the v0.7.0 release of BDK",authors:["Alekos Filini"],date:"2021-05-17",tags:["rust","release"],permalink:"/blog/2021/05/release-v0.7.0/",meta:[{property:"article:published_time",content:"2021-05-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.7.0"},{property:"og:description",content:"Announcing the v0.7.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/05/release-v0.7.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.7.0"},{name:"twitter:description",content:"Announcing the v0.7.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/05/release-v0.7.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.7.0.html",relativePath:"_blog/release-0.7.0.md",key:"v-0df1c3ce",path:"/blog/2021/05/release-v0.7.0/",headers:[{level:2,title:"What's new in v0.7.0",slug:"whats-new-in-v070"},{level:3,title:"New Signing API",slug:"new-signing-api"},{level:3,title:"Support Timelocks in the policy Module",slug:"support-timelocks-in-the-policy-module"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"The Road to BDK 1.0",frontmatter:{title:"The Road to BDK 1.0",description:"Outlining the plan for the 1.0 release of BDK",authors:["Alekos Filini"],date:"2022-10-03",tags:["architecture"],draft:!1,meta:[{property:"article:published_time",content:"2022-10-03T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"The Road to BDK 1.0"},{property:"og:description",content:"Outlining the plan for the 1.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/road_to_bdk_1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"The Road to BDK 1.0"},{name:"twitter:description",content:"Outlining the plan for the 1.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/road_to_bdk_1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"architecture"},{property:"article:tag",content:"architecture"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/road_to_bdk_1.html",relativePath:"_blog/road_to_bdk_1.md",key:"v-55969f39",path:"/blog/road-to-bdk-1/",headers:[{level:2,title:"Goals",slug:"goals"},{level:3,title:"Stable API",slug:"stable-api"},{level:3,title:"Upstreaming our code",slug:"upstreaming-our-code"},{level:3,title:"Partially Syncing a Wallet",slug:"partially-syncing-a-wallet"},{level:3,title:"no_std",slug:"no-std"},{level:3,title:"Lower MSRV",slug:"lower-msrv"},{level:2,title:"Architecture",slug:"architecture"},{level:2,title:"Timeline",slug:"timeline"},{level:2,title:"Feature Freezing BDK",slug:"feature-freezing-bdk"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Spending Policy Decoded",frontmatter:{title:"Spending Policy Decoded",description:"Demonstrate how to use a descriptor wallet with different spending policies",authors:["Steve Myers","thunderbiscuit"],date:"2021-02-23",tags:["guide","descriptor"],meta:[{property:"article:published_time",content:"2021-02-23T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Spending Policy Decoded"},{property:"og:description",content:"Demonstrate how to use a descriptor wallet with different spending policies"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/spending_policy_demo/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Spending Policy Decoded"},{name:"twitter:description",content:"Demonstrate how to use a descriptor wallet with different spending policies"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/spending_policy_demo/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"guide, descriptor"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"descriptor"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/spending_policy_demo.html",relativePath:"_blog/spending_policy_demo.md",key:"v-8534b9c2",path:"/blog/spending-policy-demo/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Initial Setup",slug:"initial-setup"},{level:3,title:"Step 0: Install a recent version bdk-cli",slug:"step-0-install-a-recent-version-bdk-cli"},{level:3,title:"Step 1: Generate private extended keys",slug:"step-1-generate-private-extended-keys"},{level:3,title:"Step 2: Extract private extended keys",slug:"step-2-extract-private-extended-keys"},{level:3,title:"Step 3: Derive public extended keys",slug:"step-3-derive-public-extended-keys"},{level:3,title:"Step 4: Create wallet descriptors for each participant",slug:"step-4-create-wallet-descriptors-for-each-participant"},{level:2,title:"Policy A. Three signatures",slug:"policy-a-three-signatures"},{level:3,title:"Step 1a: Create a testnet segwit0 receive address",slug:"step-1a-create-a-testnet-segwit0-receive-address"},{level:3,title:"Step 2a: Send testnet bitcoin from a faucet to receive address",slug:"step-2a-send-testnet-bitcoin-from-a-faucet-to-receive-address"},{level:3,title:"Step 3a: Sync participant wallets and confirm balance",slug:"step-3a-sync-participant-wallets-and-confirm-balance"},{level:3,title:"Step 4a: View wallet spending policies",slug:"step-4a-view-wallet-spending-policies"},{level:3,title:"Step 5a: Create spending transaction",slug:"step-5a-create-spending-transaction"},{level:3,title:"Step 6a: Sign and finalize PSBTs",slug:"step-6a-sign-and-finalize-psbts"},{level:3,title:"Step 7a: Broadcast finalized PSBT",slug:"step-7a-broadcast-finalized-psbt"},{level:3,title:"Step 8a: Confirm transaction included in a testnet block",slug:"step-8a-confirm-transaction-included-in-a-testnet-block"},{level:2,title:"Policy B. Two signatures after a relative time lock",slug:"policy-b-two-signatures-after-a-relative-time-lock"},{level:3,title:"Step 1b: Create a new testnet receive address",slug:"step-1b-create-a-new-testnet-receive-address"},{level:3,title:"Step 2b: Fund new address from testnet faucet",slug:"step-2b-fund-new-address-from-testnet-faucet"},{level:3,title:"Step 3b: Sync wallet and confirm wallet balance",slug:"step-3b-sync-wallet-and-confirm-wallet-balance"},{level:3,title:"Step 4b: Create spending transaction",slug:"step-4b-create-spending-transaction"},{level:3,title:"Step 5b: Sign and finalize PSBTs",slug:"step-5b-sign-and-finalize-psbts"},{level:3,title:"Step 6b: Broadcast finalized PSBT",slug:"step-6b-broadcast-finalized-psbt"},{level:3,title:"Step 7b: View confirmed transaction",slug:"step-7b-view-confirmed-transaction"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Release v0.9.0",frontmatter:{title:"Release v0.9.0",description:"Announcing the v0.9.0 release of BDK",authors:["Alekos Filini"],date:"2021-07-11",tags:["rust","release"],permalink:"/blog/2021/07/release-v0.9.0/",meta:[{property:"article:published_time",content:"2021-07-11T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.9.0"},{property:"og:description",content:"Announcing the v0.9.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/07/release-v0.9.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.9.0"},{name:"twitter:description",content:"Announcing the v0.9.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/07/release-v0.9.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.9.0.html",relativePath:"_blog/release-0.9.0.md",key:"v-1ac9ef4e",path:"/blog/2021/07/release-v0.9.0/",headers:[{level:2,title:"What's new in v0.9.0",slug:"whats-new-in-v090"},{level:2,title:"Bitcoin Core Blockchain Backend",slug:"bitcoin-core-blockchain-backend"},{level:2,title:"Updated TransactionDetails Struct",slug:"updated-transactiondetails-struct"},{level:2,title:"Verify Downloaded TXs",slug:"verify-downloaded-txs"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Release v0.4.0",frontmatter:{title:"Release v0.4.0",description:"Announcing the v0.4.0 release of BDK",authors:["Alekos Filini"],date:"2021-02-17",tags:["rust","release"],permalink:"/blog/2021/02/release-v0.4.0/",meta:[{property:"article:published_time",content:"2021-02-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.4.0"},{property:"og:description",content:"Announcing the v0.4.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/02/release-v0.4.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.4.0"},{name:"twitter:description",content:"Announcing the v0.4.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/02/release-v0.4.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.4.0.html",relativePath:"_blog/release-0.4.0.md",key:"v-faad828e",path:"/blog/2021/02/release-v0.4.0/",headers:[{level:2,title:"What's new in v0.4.0",slug:"whats-new-in-v040"},{level:3,title:"A new API to build transaction",slug:"a-new-api-to-build-transaction"},{level:3,title:"Upgraded dependencies",slug:"upgraded-dependencies"},{level:3,title:"Compact Filters example",slug:"compact-filters-example"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Using BDK with hardware wallets",frontmatter:{title:"Using BDK with hardware wallets",description:"Tutorial showing how to send funds to a HW and then spend from it using BDK",authors:["Daniela Brozzoni"],date:"2022-10-27",tags:["BDK","Development","Hardware Wallets"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-10-27T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Using BDK with hardware wallets"},{property:"og:description",content:"Tutorial showing how to send funds to a HW and then spend from it using BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/using_bdk_with_hardware_wallets/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Using BDK with hardware wallets"},{name:"twitter:description",content:"Tutorial showing how to send funds to a HW and then spend from it using BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/using_bdk_with_hardware_wallets/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, Development, Hardware Wallets"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"Development"},{property:"article:tag",content:"Hardware Wallets"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/using_bdk_with_hardware_wallets.html",relativePath:"_blog/using_bdk_with_hardware_wallets.md",key:"v-aeb70fce",path:"/blog/using-bdk-with-hardware-wallets/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisites",slug:"prerequisites"},{level:2,title:"Initial setup",slug:"initial-setup"},{level:2,title:"Finding the hardware wallet",slug:"finding-the-hardware-wallet"},{level:2,title:"Receiving funds",slug:"receiving-funds"},{level:2,title:"Spending funds",slug:"spending-funds"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"All",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/all/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/all/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/all.html",relativePath:"adoption/all.md",key:"v-4d760891",path:"/adoption/all/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Custodial",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/custodial/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/custodial/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/custodial.html",relativePath:"adoption/custodial.md",key:"v-30c0037b",path:"/adoption/custodial/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Why Do We Build Bindings?",frontmatter:{title:"Why Do We Build Bindings?",description:"A post exploring why the Bitcoin Dev Kit Foundation produces language bindings for its libraries",authors:["thunderbiscuit"],date:"2024-05-07",tags:["bindings"],meta:[{property:"article:published_time",content:"2024-05-07T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Why Do We Build Bindings?"},{property:"og:description",content:"A post exploring why the Bitcoin Dev Kit Foundation produces language bindings for its libraries"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/why-bindings/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Why Do We Build Bindings?"},{name:"twitter:description",content:"A post exploring why the Bitcoin Dev Kit Foundation produces language bindings for its libraries"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/why-bindings/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bindings"},{property:"article:tag",content:"bindings"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/why-bindings.html",relativePath:"_blog/why-bindings.md",key:"v-4dc135e3",path:"/blog/why-bindings/",headers:[{level:2,title:"Awesome! Producing Bindings Must Be Easy Right?",slug:"awesome-producing-bindings-must-be-easy-right"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Desktop",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/desktop/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/desktop/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/desktop.html",relativePath:"adoption/desktop.md",key:"v-4bb7844a",path:"/adoption/desktop/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Exchange",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/exchange/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/exchange/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/exchange.html",relativePath:"adoption/exchange.md",key:"v-b936290e",path:"/adoption/exchange/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Mobile",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/mobile/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/mobile/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/mobile.html",relativePath:"adoption/mobile.md",key:"v-a7c24c4e",path:"/adoption/mobile/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Hardware",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/hardware/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/hardware/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/hardware.html",relativePath:"adoption/hardware.md",key:"v-7afdbb4e",path:"/adoption/hardware/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Infrastructure",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/infrastructure/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/infrastructure/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/infrastructure.html",relativePath:"adoption/infrastructure.md",key:"v-4e0b610e",path:"/adoption/infrastructure/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Compiler",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Compiler"},{property:"og:description",content:'If you want to play around with more complicated spending policies, you\'ll start to find it harder and harder to manually create the descriptors. This is where the miniscript compiler comes in! The `bdk` library\nincludes a very simple compiler that can produce a descriptor given a spending policy. The syntax used to encode the spending policy is very well described in this pagehttp://bitcoin.sipa.be/miniscript/,\nspecifically in the "Policy to Miniscript compiler". The compiler included in BDK does basically the same job, but produces descriptors for `rust-miniscript` that have some minor differences from\nthe ones made by the C++ implementation used in that website.'},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/compiler/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Compiler"},{name:"twitter:description",content:'If you want to play around with more complicated spending policies, you\'ll start to find it harder and harder to manually create the descriptors. This is where the miniscript compiler comes in! The `bdk` library\nincludes a very simple compiler that can produce a descriptor given a spending policy. The syntax used to encode the spending policy is very well described in this pagehttp://bitcoin.sipa.be/miniscript/,\nspecifically in the "Policy to Miniscript compiler". The compiler included in BDK does basically the same job, but produces descriptors for `rust-miniscript` that have some minor differences from\nthe ones made by the C++ implementation used in that website.'},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/compiler/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/compiler.html",relativePath:"bdk-cli/compiler.md",key:"v-7a315e41",path:"/bdk-cli/compiler/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Installation",slug:"installation"},{level:2,title:"Usage",slug:"usage"},{level:2,title:"Example",slug:"example"},{level:2,title:"Troubleshooting",slug:"troubleshooting"}],codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Web",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/web/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/web/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/web.html",relativePath:"adoption/web.md",key:"v-17019aeb",path:"/adoption/web/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Concept",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Concept"},{property:"og:description",content:"Now, in order to better grasp some of the design choices made by BDK, it's important to understand the main concept driving the development of this project, and the goal that it's trying to\nachieve."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/concept/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Concept"},{name:"twitter:description",content:"Now, in order to better grasp some of the design choices made by BDK, it's important to understand the main concept driving the development of this project, and the goal that it's trying to\nachieve."},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/concept/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/concept.html",relativePath:"bdk-cli/concept.md",key:"v-f611a14e",path:"/bdk-cli/concept/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Installation",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Installation"},{property:"og:description",content:"The only requirement to run the `bdk-cli` tool is a Linux/macOS system with a fairly recent Rust\ntoolchain installed. Since Linux distros tend to lag behind with updates, the quickest way to\ninstall the Rust compiler and Cargo is rustup.rshttps://rustup.rs/. You can head there and\nfollow their instructions, after which you can test if everything went fine by running"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/installation/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Installation"},{name:"twitter:description",content:"The only requirement to run the `bdk-cli` tool is a Linux/macOS system with a fairly recent Rust\ntoolchain installed. Since Linux distros tend to lag behind with updates, the quickest way to\ninstall the Rust compiler and Cargo is rustup.rshttps://rustup.rs/. You can head there and\nfollow their instructions, after which you can test if everything went fine by running"},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/installation/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/installation.html",relativePath:"bdk-cli/installation.md",key:"v-3acb6e6a",path:"/bdk-cli/installation/",headers:[{level:2,title:"Requirements",slug:"requirements"},{level:2,title:"Installing the bdk-cli tool",slug:"installing-the-bdk-cli-tool"}],codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Interface",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Interface"},{property:"og:description",content:"Remember the `bdk-cli --help` command you ran before? Let's analyze its output here to figure out the interface:"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/interface/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Interface"},{name:"twitter:description",content:"Remember the `bdk-cli --help` command you ran before? Let's analyze its output here to figure out the interface:"},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/interface/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/interface.html",relativePath:"bdk-cli/interface.md",key:"v-496cb7f9",path:"/bdk-cli/interface/",headers:[{level:2,title:"Flags",slug:"flags"},{level:3,title:"Verbosity",slug:"verbosity"},{level:2,title:"Options",slug:"options"},{level:2,title:"Subcommands",slug:"subcommands"},{level:2,title:"key",slug:"key"},{level:3,title:"generate",slug:"generate"},{level:3,title:"restore",slug:"restore"},{level:3,title:"derive",slug:"derive"},{level:2,title:"wallet",slug:"wallet"},{level:3,title:"Options",slug:"options-2"},{level:2,title:"Subcommands",slug:"subcommands-2"},{level:3,title:"broadcast",slug:"broadcast"},{level:3,title:"bump_fee",slug:"bump-fee"},{level:3,title:"combine_psbt",slug:"combine-psbt"},{level:3,title:"create_tx",slug:"create-tx"},{level:3,title:"extract_psbt",slug:"extract-psbt"},{level:3,title:"finalize_psbt",slug:"finalize-psbt"},{level:3,title:"get_balance",slug:"get-balance"},{level:3,title:"get_new_address",slug:"get-new-address"},{level:3,title:"list_transactions",slug:"list-transactions"},{level:3,title:"list_unspent",slug:"list-unspent"},{level:3,title:"policies",slug:"policies"},{level:3,title:"public_descriptor",slug:"public-descriptor"},{level:3,title:"help",slug:"help"},{level:3,title:"sign",slug:"sign"},{level:3,title:"sync",slug:"sync"}],codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Introduction",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Introduction"},{property:"og:description",content:"This can also be used as an example application to create your own command line bitcoin wallet tool using bdk."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/introduction/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Introduction"},{name:"twitter:description",content:"This can also be used as an example application to create your own command line bitcoin wallet tool using bdk."},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/introduction/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/introduction.html",relativePath:"bdk-cli/introduction.md",key:"v-0b3b65ea",path:"/bdk-cli/introduction/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Playground",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Playground"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/playground/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Playground"},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/playground/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/playground.html",relativePath:"bdk-cli/playground.md",key:"v-a76bccee",path:"/bdk-cli/playground/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Regtest",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Regtest"},{property:"og:description",content:"Running the `bdk-cli` tool in regtest requires having a local Electrum server set-up. There are two main implementations, `electrs`https://github.com/romanz/electrs in Rust and `ElectrumX`https://github.com/spesmilo/electrumx in Python. Since the Rust toolchain is already required to\nuse BDK, this page will focus mostly on the former."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/regtest/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Regtest"},{name:"twitter:description",content:"Running the `bdk-cli` tool in regtest requires having a local Electrum server set-up. There are two main implementations, `electrs`https://github.com/romanz/electrs in Rust and `ElectrumX`https://github.com/spesmilo/electrumx in Python. Since the Rust toolchain is already required to\nuse BDK, this page will focus mostly on the former."},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/regtest/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/regtest.html",relativePath:"bdk-cli/regtest.md",key:"v-05d01c19",path:"/bdk-cli/regtest/",headers:[{level:2,title:"Troubleshooting",slug:"troubleshooting"},{level:2,title:"Bonus: Docker",slug:"bonus-docker"}],codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{frontmatter:{cases:!0,sidebar:!1,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",actionText:"Add your project",actionLink:"https://github.com/orgs/bitcoindevkit/discussions/64",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/case-studies/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/case-studies/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/case-studies.html",relativePath:"case-studies.md",key:"v-11bf335e",path:"/case-studies/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Descriptors",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Descriptors"},{property:"og:description",content:'Descriptors are a compact and semi-standard way to easily encode, or "describe", how scripts and subsequently, addresses of a wallet should be generated. They can be especially helpful when working with multisigs or even\nmore complex scripts, where the structure of the script itself is not trivial. They are a big step forward in making wallets more portable across different tools and apps, because for the first time they create a common\nlanguage to describe a full bitcoin script that developers can use and integrate in their software.'},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/descriptors/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Descriptors"},{name:"twitter:description",content:'Descriptors are a compact and semi-standard way to easily encode, or "describe", how scripts and subsequently, addresses of a wallet should be generated. They can be especially helpful when working with multisigs or even\nmore complex scripts, where the structure of the script itself is not trivial. They are a big step forward in making wallets more portable across different tools and apps, because for the first time they create a common\nlanguage to describe a full bitcoin script that developers can use and integrate in their software.'},{name:"twitter:url",content:"https://bitcoindevkit.org/descriptors/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/descriptors/",relativePath:"descriptors/README.md",key:"v-a9236c10",path:"/descriptors/",headers:[{level:3,title:"Compatibility Matrix",slug:"compatibility-matrix"},{level:3,title:"Examples",slug:"examples"},{level:3,title:"Implementation Details",slug:"implementation-details"}],codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Current Grantees (Full-Time)",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/grantees/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/grantees/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/grantees.html",relativePath:"foundation/grantees.md",key:"v-105750ce",path:"/foundation/grantees/",headers:[{level:2,title:"Evan Lin",slug:"evan-lin"},{level:2,title:"thunderbiscuit",slug:"thunderbiscuit"},{level:2,title:"Matthew Ramsden",slug:"matthew-ramsden"},{level:2,title:"ValuedMammal",slug:"valuedmammal"},{level:2,title:"Wei Chen",slug:"wei-chen"},{level:2,title:"Manuel Gatti",slug:"manuel-gatti"}],codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Examples",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Examples"},{property:"og:description",content:"Click the links below and learn from community-built example projects."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/examples/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Examples"},{name:"twitter:description",content:"Click the links below and learn from community-built example projects."},{name:"twitter:url",content:"https://bitcoindevkit.org/examples/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/examples/",relativePath:"examples/README.md",key:"v-29f9f21c",path:"/examples/",headers:[{level:2,title:"BDK-CLI",slug:"bdk-cli"},{level:2,title:"DevkitWallet",slug:"devkitwallet"},{level:2,title:"Padawan Wallet",slug:"padawan-wallet"},{level:2,title:"BDKSwiftExampleWallet",slug:"bdkswiftexamplewallet"},{level:2,title:"Tatooine",slug:"tatooine"},{level:2,title:"SEBA Bank Proof of reserves",slug:"seba-bank-proof-of-reserves"},{level:2,title:"Stackmate",slug:"stackmate"},{level:2,title:"Spotbit",slug:"spotbit"}],codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Bitcoin Dev Kit Foundation",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/about/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/about/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/about.html",relativePath:"foundation/about.md",key:"v-3750297a",path:"/foundation/about/",headers:[{level:2,title:"Board",slug:"board"},{level:2,title:"Operations",slug:"operations"}],codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Bitcoin Dev Kit Foundation",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/",relativePath:"foundation/index.md",key:"v-c152529c",path:"/foundation/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Supporters",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/supporters/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/supporters/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/supporters.html",relativePath:"foundation/supporters.md",key:"v-50aa6d4e",path:"/foundation/supporters/",codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{title:"Bitcoin Dev Kit",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin Dev Kit"},{property:"og:description",content:"The Bitcoin Dev Kit BDKhttps://github.com/bitcoindevkit project originally called Magical Bitcoin 🧙 aims to build a collection of tools and libraries that are designed to be a solid foundation for cross platform Bitcoin wallets, along with a fully working reference implementation wallets for various platforms.\nAll BDK components are designed to be lightweight and modular so that they can be adapted for virtually any use-case: from single-sig mobile wallets to multi-billion-dollar cold storage vaults."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/getting-started/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin Dev Kit"},{name:"twitter:description",content:"The Bitcoin Dev Kit BDKhttps://github.com/bitcoindevkit project originally called Magical Bitcoin 🧙 aims to build a collection of tools and libraries that are designed to be a solid foundation for cross platform Bitcoin wallets, along with a fully working reference implementation wallets for various platforms.\nAll BDK components are designed to be lightweight and modular so that they can be adapted for virtually any use-case: from single-sig mobile wallets to multi-billion-dollar cold storage vaults."},{name:"twitter:url",content:"https://bitcoindevkit.org/getting-started/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/getting-started.html",relativePath:"getting-started.md",key:"v-4bcdac39",path:"/getting-started/",headers:[{level:2,title:"Initial Configuration",slug:"initial-configuration"},{level:2,title:"Internal Features",slug:"internal-features"},{level:2,title:"Playground",slug:"playground"},{level:2,title:"Descriptors",slug:"descriptors"}],codeSwitcherOptions:{},lastUpdated:"6/5/2024, 2:21:26 AM",lastUpdatedTimestamp:1717554086e3},{frontmatter:{layout:"IndexPost",title:"Blog",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/",key:"v-424df898",path:"/blog/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterKey",title:"Tags",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/",key:"v-619df59e",path:"/blog/tags/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterKey",title:"Authors",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/",key:"v-b0968728",path:"/blog/author/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"BDK ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/BDK/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/BDK/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/BDK/",key:"v-5f2600b8",path:"/blog/tags/BDK/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"project ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/project/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/project/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/project/",key:"v-398e8fd4",path:"/blog/tags/project/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"tutorial ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/tutorial/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/tutorial/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/tutorial/",key:"v-da8c869a",path:"/blog/tags/tutorial/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Bitcoin Core ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Bitcoin Core/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Bitcoin Core/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Bitcoin%20Core/",key:"v-62bbf2ad",path:"/blog/tags/Bitcoin Core/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"RPC ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/RPC/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/RPC/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/RPC/",key:"v-5f171cb0",path:"/blog/tags/RPC/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Wallet ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Wallet/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Wallet/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Wallet/",key:"v-4696dfd8",path:"/blog/tags/Wallet/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bdk-cli ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bdk-cli/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bdk-cli/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bdk-cli/",key:"v-c711ccde",path:"/blog/tags/bdk-cli/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"basics ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/basics/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/basics/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/basics/",key:"v-e646a928",path:"/blog/tags/basics/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"novice ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/novice/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/novice/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/novice/",key:"v-1fb58ffb",path:"/blog/tags/novice/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"architecture ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/architecture/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/architecture/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/architecture/",key:"v-c4494744",path:"/blog/tags/architecture/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"tor ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/tor/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/tor/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/tor/",key:"v-5ef73f54",path:"/blog/tags/tor/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"wallet ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/wallet/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/wallet/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/wallet/",key:"v-39437010",path:"/blog/tags/wallet/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"blockchain ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/blockchain/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/blockchain/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/blockchain/",key:"v-7c8563fd",path:"/blog/tags/blockchain/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bindings ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bindings/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bindings/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bindings/",key:"v-1296a8fa",path:"/blog/tags/bindings/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"multi-sig ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/multi-sig/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/multi-sig/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/multi-sig/",key:"v-655ee4a0",path:"/blog/tags/multi-sig/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"BDK-RN ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/BDK-RN/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/BDK-RN/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/BDK-RN/",key:"v-876cfade",path:"/blog/tags/BDK-RN/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Development ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Development/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Development/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Development/",key:"v-3acc51dc",path:"/blog/tags/Development/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Architecture ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Architecture/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Architecture/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Architecture/",key:"v-650ae784",path:"/blog/tags/Architecture/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"compact_filters ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/compact_filters/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/compact_filters/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/compact_filters/",key:"v-baacba64",path:"/blog/tags/compact_filters/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"BIP157 ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/BIP157/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/BIP157/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/BIP157/",key:"v-75ccd5f2",path:"/blog/tags/BIP157/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Neutrino ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Neutrino/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Neutrino/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Neutrino/",key:"v-4fed1c23",path:"/blog/tags/Neutrino/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"guide ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/guide/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/guide/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/guide/",key:"v-a9e0285e",path:"/blog/tags/guide/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"descriptor ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/descriptor/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/descriptor/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/descriptor/",key:"v-733ed37c",path:"/blog/tags/descriptor/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"paper wallets ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/paper wallets/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/paper wallets/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/paper%20wallets/",key:"v-1144be8a",path:"/blog/tags/paper wallets/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bitcoin ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bitcoin/",key:"v-915f8322",path:"/blog/tags/bitcoin/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"React Native ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/React Native/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/React Native/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/React%20Native/",key:"v-bf53d4d4",path:"/blog/tags/React Native/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Flutter ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Flutter/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Flutter/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Flutter/",key:"v-07eeb15e",path:"/blog/tags/Flutter/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"iOS ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/iOS/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/iOS/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/iOS/",key:"v-5f023740",path:"/blog/tags/iOS/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Android ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Android/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Android/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Android/",key:"v-414e735e",path:"/blog/tags/Android/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"mobile ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/mobile/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/mobile/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/mobile/",key:"v-2c94bf22",path:"/blog/tags/mobile/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bdk-rn ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bdk-rn/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bdk-rn/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bdk-rn/",key:"v-dd212a9e",path:"/blog/tags/bdk-rn/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bdk ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bdk/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bdk/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bdk/",key:"v-5f07f0f8",path:"/blog/tags/bdk/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"fee ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/fee/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/fee/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/fee/",key:"v-5f0447f2",path:"/blog/tags/fee/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"machine learning ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/machine learning/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/machine learning/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/machine%20learning/",key:"v-e2317b12",path:"/blog/tags/machine learning/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"taproot ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/taproot/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/taproot/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/taproot/",key:"v-57f3a168",path:"/blog/tags/taproot/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"miniscript ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/miniscript/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/miniscript/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/miniscript/",key:"v-ef7c3fa2",path:"/blog/tags/miniscript/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Hardware Wallets ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Hardware Wallets/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Hardware Wallets/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Hardware%20Wallets/",key:"v-640144b2",path:"/blog/tags/Hardware Wallets/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"getting started ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/getting started/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/getting started/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/getting%20started/",key:"v-79c3de4b",path:"/blog/tags/getting started/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"rust ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/rust/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/rust/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/rust/",key:"v-3fee41ed",path:"/blog/tags/rust/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bitcoin-cli ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin-cli/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin-cli/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bitcoin-cli/",key:"v-01a03a08",path:"/blog/tags/bitcoin-cli/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"coin selection ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/coin selection/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/coin selection/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/coin%20selection/",key:"v-74edfe92",path:"/blog/tags/coin selection/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"development ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/development/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/development/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/development/",key:"v-4e62fa1c",path:"/blog/tags/development/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"summer of bitcoin ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/summer of bitcoin/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/summer of bitcoin/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/summer%20of%20bitcoin/",key:"v-0159a747",path:"/blog/tags/summer of bitcoin/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"security ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/security/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/security/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/security/",key:"v-0755ed11",path:"/blog/tags/security/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"release ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/release/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/release/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/release/",key:"v-543950a6",path:"/blog/tags/release/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Steve Myers ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Steve Myers/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Steve Myers/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Steve%20Myers/",key:"v-a354115e",path:"/blog/author/Steve Myers/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Daniela Brozzoni ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Daniela Brozzoni/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Daniela Brozzoni/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Daniela%20Brozzoni/",key:"v-22d0e252",path:"/blog/author/Daniela Brozzoni/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Rajarshi Maitra ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Rajarshi Maitra/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Rajarshi Maitra/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Rajarshi%20Maitra/",key:"v-82e16b5c",path:"/blog/author/Rajarshi Maitra/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"waterst0ne ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/waterst0ne/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/waterst0ne/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/waterst0ne/",key:"v-3e6950f4",path:"/blog/author/waterst0ne/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Lloyd Fournier ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Lloyd Fournier/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Lloyd Fournier/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Lloyd%20Fournier/",key:"v-600b5b28",path:"/blog/author/Lloyd Fournier/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"rorp ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/rorp/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/rorp/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/rorp/",key:"v-d2b26530",path:"/blog/author/rorp/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"thunderbiscuit ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/thunderbiscuit/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/thunderbiscuit/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/thunderbiscuit/",key:"v-5d54001e",path:"/blog/author/thunderbiscuit/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Bitcoin Zavior ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Bitcoin Zavior/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Bitcoin Zavior/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Bitcoin%20Zavior/",key:"v-37829241",path:"/blog/author/Bitcoin Zavior/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Riccardo Casatta ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Riccardo Casatta/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Riccardo Casatta/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Riccardo%20Casatta/",key:"v-624fd61e",path:"/blog/author/Riccardo Casatta/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Gabriele Domenichini ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Gabriele Domenichini/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Gabriele Domenichini/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Gabriele%20Domenichini/",key:"v-6b564fb4",path:"/blog/author/Gabriele Domenichini/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Alekos Filini ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Alekos%20Filini/",key:"v-ad00c09c",path:"/blog/author/Alekos Filini/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Wszdexdrf ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Wszdexdrf/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Wszdexdrf/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Wszdexdrf/",key:"v-4eeab648",path:"/blog/author/Wszdexdrf/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Sandipan Dey ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Sandipan Dey/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Sandipan Dey/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Sandipan%20Dey/",key:"v-91c10894",path:"/blog/author/Sandipan Dey/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"César Alvarez Vallero ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/César Alvarez Vallero/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/César Alvarez Vallero/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/C%C3%A9sar%20Alvarez%20Vallero/",key:"v-a0d840b0",path:"/blog/author/César Alvarez Vallero/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Page 2",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/page/2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/page/2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/page/2/",key:"v-c3507bb6",path:"/blog/page/2/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Page 3",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/page/3/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/page/3/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/page/3/",key:"v-c3507b78",path:"/blog/page/3/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Page 4",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/page/4/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/page/4/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/page/4/",key:"v-c3507b3a",path:"/blog/page/4/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Alekos Filini - Page 2",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/page/2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/page/2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Alekos%20Filini/page/2/",key:"v-5f2ac9cb",path:"/blog/author/Alekos Filini/page/2/",codeSwitcherOptions:{}}],themeConfig:{domain:"https://bitcoindevkit.org",logo:"/img/logo.svg",displayAllHeaders:!1,repo:"bitcoindevkit/bitcoindevkit.org",docsDir:"docs",editLinks:!0,sidebarDepth:0,nav:[{text:"Docs",link:"/getting-started/"},{text:"Adoption",link:"/adoption/all.md"},{text:"Foundation",link:"/foundation/"},{text:"Blog",link:"/blog/"}],sidebar:{"/adoption/":[{title:"Built With BDK",collapsable:!1,children:[["/adoption/all.md","All"],["/adoption/mobile.md","Mobile"],["/adoption/desktop.md","Desktop"],["/adoption/hardware.md","Hardware"],["/adoption/web.md","Web"],["/adoption/custodial.md","Custodial"],["/adoption/exchange.md","Exchange"],["/adoption/infrastructure.md","Infrastructure"]]}],"/_blog/":[{title:"Blog",collapsable:!1,children:[["/blog/","Articles"],["/blog/tags/","Tags"],["/blog/author/","Authors"]]}],"/blog/":[{title:"Blog",collapsable:!1,children:[["/blog/","Articles"],["/blog/tags/","Tags"],["/blog/author/","Authors"]]}],"/foundation/":[{title:"Foundation",collapsable:!1,children:[["/foundation/about.md","About Us"],["/foundation/supporters.md","Supporters"],["/foundation/grantees.md","Grantees"]]}],"/":[{title:"Documentation",collapsable:!1,children:[["/getting-started","Getting Started"],{title:"BDK-CLI",collapsable:!0,children:["/bdk-cli/introduction","/bdk-cli/installation","/bdk-cli/concept","/bdk-cli/interface","/bdk-cli/regtest","/bdk-cli/compiler","/bdk-cli/playground"]},"/descriptors/","/examples/"]},{title:"API Reference",collapsable:!1,children:[["https://docs.rs/bdk_wallet/","Rust Stable Docs"],["https://bitcoindevkit.org/docs-rs/bdk/nightly/latest/bdk_wallet/","Rust Nightly Docs"],["https://bitcoindevkit.org/android/","Android Docs"],["https://bitcoindevkit.org/jvm/","Kotlin/JVM Docs"],["https://bitcoindevkit.org/java/","Java Docs"]]}]},footer:{links:[{title:"Docs",children:[{text:"Getting Started",link:"/getting-started/"},{text:"BDK-CLI",link:"/bdk-cli/installation/"},{text:"Descriptors",link:"/descriptors/"}]},{title:"Community",children:[{text:"GitHub",link:"https://github.com/bitcoindevkit",rel:"noopener noreferrer"},{text:"Nostr",link:"nostr:npub13dk3dke4zm9vdkucm7f6vv7vhqgkevgg3gju9kr2wzumz7nrykdq0dgnvc",rel:"noopener noreferrer"},{text:"Twitter",link:"https://twitter.com/intent/follow?screen_name=bitcoindevkit",rel:"noopener noreferrer"},{text:"Chat on Discord",link:"https://discord.gg/dstn4dQ",rel:"noopener noreferrer"}]},{title:"More",children:[{text:"Blog",link:"/blog/"},{text:"Supporters",link:"/foundation/supporters/"},{text:"BDK Foundation",link:"/foundation/"}]}],copyright:"Copyright © 2024 BDK Developers"}}},{COLOR_MODES:Wc,STORE_ATTR:Hc,setColorMode:Vc}=n(111),qc=t=>"Enter"===t.code||13===(t.keyCode||t.which),Gc=t=>{const e=t.target.matches("#algolia-search-input")&&qc(t);(t.target.matches(".ds-dropdown-menu *")||e)&&document.getElementById("algolia-search-input").blur(),t.target.matches(".ytEmbed")&&(t.preventDefault(),(t=>{const e=t.querySelector("iframe[data-src]");if(e){const t=e.getAttribute("data-src");e.setAttribute("src",t)}})(t.target))};if("undefined"==typeof process||"server"!==process.env.VUE_ENV){const t=window.matchMedia("(prefers-color-scheme: dark)").matches?Wc[1]:Wc[0],e=window.localStorage.getItem(Hc);Vc(Wc.includes(e)?e:t)}n(243);Vn.component("Badge",()=>Promise.all([n.e(0),n.e(8)]).then(n.bind(null,398))),Vn.component("CodeBlock",()=>Promise.all([n.e(0),n.e(9)]).then(n.bind(null,388))),Vn.component("CodeGroup",()=>Promise.all([n.e(0),n.e(10)]).then(n.bind(null,389)));n(244);var Zc={props:{color:{required:!1,default:"rgb(66, 185, 131)"}}},Xc=(n(245),Object(Kc.a)(Zc,(function(){return(0,this._self._c)("div",{staticClass:"spinner",style:{background:this.color}})}),[],!1,null,"1bbcb91a",null).exports);const Yc={name:"Mermaid",props:{id:{type:String,required:!0},graph:{type:String,required:!0}},data:()=>({svg:void 0}),render(t){return void 0===this.svg?t("Loading"):t("div",{domProps:{innerHTML:this.svg,style:"width: 100%"}})},mounted(){n.e(93).then(n.t.bind(null,384,7)).then(t=>{t.initialize({startOnLoad:!0});let e=document.createElement("div");document.body.appendChild(e),t.render(this.id,this.graph,t=>{this.svg=t,document.body.removeChild(e)},e)})},components:{Loading:Xc}};var Jc=n(94),Qc=n.n(Jc);n(246);Vn.component("CodeSwitcher",()=>n.e(44).then(n.bind(null,397)));var tl={tags:{BDK:{key:"BDK",scope:"tags",path:"/blog/tags/BDK/",pageKeys:["v-2c450c3f","v-5e744cf7","v-7c0c45f9","v-3875825f","v-07ff1843","v-9145467a","v-2cf72b39","v-11d64359","v-d0375c8e","v-aeb70fce"]},project:{key:"project",scope:"tags",path:"/blog/tags/project/",pageKeys:["v-2c450c3f","v-5e744cf7"]},tutorial:{key:"tutorial",scope:"tags",path:"/blog/tags/tutorial/",pageKeys:["v-7c0c45f9","v-353b78e1","v-8bd632d6","v-07ff1843","v-56536559","v-f58ec8f2","v-ab5ba3ce"]},"Bitcoin Core":{key:"Bitcoin Core",scope:"tags",path:"/blog/tags/Bitcoin Core/",pageKeys:["v-7c0c45f9"]},RPC:{key:"RPC",scope:"tags",path:"/blog/tags/RPC/",pageKeys:["v-7c0c45f9"]},Wallet:{key:"Wallet",scope:"tags",path:"/blog/tags/Wallet/",pageKeys:["v-7c0c45f9"]},"bdk-cli":{key:"bdk-cli",scope:"tags",path:"/blog/tags/bdk-cli/",pageKeys:["v-0f4d5d15","v-8bd632d6","v-07ff1843","v-ab5ba3ce"]},basics:{key:"basics",scope:"tags",path:"/blog/tags/basics/",pageKeys:["v-0f4d5d15"]},novice:{key:"novice",scope:"tags",path:"/blog/tags/novice/",pageKeys:["v-0f4d5d15"]},architecture:{key:"architecture",scope:"tags",path:"/blog/tags/architecture/",pageKeys:["v-2cebe183","v-55969f39"]},tor:{key:"tor",scope:"tags",path:"/blog/tags/tor/",pageKeys:["v-353b78e1"]},wallet:{key:"wallet",scope:"tags",path:"/blog/tags/wallet/",pageKeys:["v-353b78e1","v-56536559","v-f58ec8f2"]},blockchain:{key:"blockchain",scope:"tags",path:"/blog/tags/blockchain/",pageKeys:["v-353b78e1"]},bindings:{key:"bindings",scope:"tags",path:"/blog/tags/bindings/",pageKeys:["v-3875825f","v-4dc135e3"]},"multi-sig":{key:"multi-sig",scope:"tags",path:"/blog/tags/multi-sig/",pageKeys:["v-8bd632d6"]},"BDK-RN":{key:"BDK-RN",scope:"tags",path:"/blog/tags/BDK-RN/",pageKeys:["v-3eaa044d"]},Development:{key:"Development",scope:"tags",path:"/blog/tags/Development/",pageKeys:["v-3eaa044d","v-11d64359","v-aeb70fce"]},Architecture:{key:"Architecture",scope:"tags",path:"/blog/tags/Architecture/",pageKeys:["v-3eaa044d"]},compact_filters:{key:"compact_filters",scope:"tags",path:"/blog/tags/compact_filters/",pageKeys:["v-07ff1843"]},BIP157:{key:"BIP157",scope:"tags",path:"/blog/tags/BIP157/",pageKeys:["v-07ff1843"]},Neutrino:{key:"Neutrino",scope:"tags",path:"/blog/tags/Neutrino/",pageKeys:["v-07ff1843"]},guide:{key:"guide",scope:"tags",path:"/blog/tags/guide/",pageKeys:["v-9504490e","v-c6756cce","v-56536559","v-f58ec8f2","v-8534b9c2"]},descriptor:{key:"descriptor",scope:"tags",path:"/blog/tags/descriptor/",pageKeys:["v-9504490e","v-c6756cce","v-ab5ba3ce","v-8534b9c2"]},"paper wallets":{key:"paper wallets",scope:"tags",path:"/blog/tags/paper wallets/",pageKeys:["v-9504490e"]},bitcoin:{key:"bitcoin",scope:"tags",path:"/blog/tags/bitcoin/",pageKeys:["v-56536559","v-f58ec8f2"]},"React Native":{key:"React Native",scope:"tags",path:"/blog/tags/React Native/",pageKeys:["v-56536559","v-f58ec8f2"]},Flutter:{key:"Flutter",scope:"tags",path:"/blog/tags/Flutter/",pageKeys:["v-56536559"]},iOS:{key:"iOS",scope:"tags",path:"/blog/tags/iOS/",pageKeys:["v-56536559","v-f58ec8f2"]},Android:{key:"Android",scope:"tags",path:"/blog/tags/Android/",pageKeys:["v-56536559","v-f58ec8f2"]},mobile:{key:"mobile",scope:"tags",path:"/blog/tags/mobile/",pageKeys:["v-56536559","v-f58ec8f2"]},"bdk-rn":{key:"bdk-rn",scope:"tags",path:"/blog/tags/bdk-rn/",pageKeys:["v-56536559","v-f58ec8f2"]},bdk:{key:"bdk",scope:"tags",path:"/blog/tags/bdk/",pageKeys:["v-56536559","v-f58ec8f2","v-ab5ba3ce"]},fee:{key:"fee",scope:"tags",path:"/blog/tags/fee/",pageKeys:["v-2c605799","v-57698579","v-015729b9"]},"machine learning":{key:"machine learning",scope:"tags",path:"/blog/tags/machine learning/",pageKeys:["v-2c605799","v-57698579","v-015729b9"]},taproot:{key:"taproot",scope:"tags",path:"/blog/tags/taproot/",pageKeys:["v-9145467a","v-2cf72b39"]},miniscript:{key:"miniscript",scope:"tags",path:"/blog/tags/miniscript/",pageKeys:["v-9145467a","v-2cf72b39","v-ab5ba3ce","v-10852eea"]},"Hardware Wallets":{key:"Hardware Wallets",scope:"tags",path:"/blog/tags/Hardware Wallets/",pageKeys:["v-11d64359","v-aeb70fce"]},"getting started":{key:"getting started",scope:"tags",path:"/blog/tags/getting started/",pageKeys:["v-5d749fce"]},rust:{key:"rust",scope:"tags",path:"/blog/tags/rust/",pageKeys:["v-5d749fce","v-05df4999","v-edd5570e","v-0119984e","v-75d11339","v-7c3d28f9","v-0df1c3ce","v-1ac9ef4e","v-faad828e"]},"bitcoin-cli":{key:"bitcoin-cli",scope:"tags",path:"/blog/tags/bitcoin-cli/",pageKeys:["v-ab5ba3ce"]},"coin selection":{key:"coin selection",scope:"tags",path:"/blog/tags/coin selection/",pageKeys:["v-d0375c8e"]},development:{key:"development",scope:"tags",path:"/blog/tags/development/",pageKeys:["v-d0375c8e"]},"summer of bitcoin":{key:"summer of bitcoin",scope:"tags",path:"/blog/tags/summer of bitcoin/",pageKeys:["v-d0375c8e"]},security:{key:"security",scope:"tags",path:"/blog/tags/security/",pageKeys:["v-10852eea"]},release:{key:"release",scope:"tags",path:"/blog/tags/release/",pageKeys:["v-05df4999","v-edd5570e","v-0119984e","v-75d11339","v-7c3d28f9","v-0df1c3ce","v-1ac9ef4e","v-faad828e"]}},author:{"Steve Myers":{key:"Steve Myers",scope:"author",path:"/blog/author/Steve Myers/",pageKeys:["v-2c450c3f","v-5e744cf7","v-9504490e","v-8534b9c2"]},"Daniela Brozzoni":{key:"Daniela Brozzoni",scope:"author",path:"/blog/author/Daniela Brozzoni/",pageKeys:["v-2c450c3f","v-aeb70fce"]},"Rajarshi Maitra":{key:"Rajarshi Maitra",scope:"author",path:"/blog/author/Rajarshi Maitra/",pageKeys:["v-7c0c45f9","v-07ff1843","v-ab5ba3ce"]},waterst0ne:{key:"waterst0ne",scope:"author",path:"/blog/author/waterst0ne/",pageKeys:["v-0f4d5d15","v-8bd632d6"]},"Lloyd Fournier":{key:"Lloyd Fournier",scope:"author",path:"/blog/author/Lloyd Fournier/",pageKeys:["v-2cebe183"]},rorp:{key:"rorp",scope:"author",path:"/blog/author/rorp/",pageKeys:["v-353b78e1"]},thunderbiscuit:{key:"thunderbiscuit",scope:"author",path:"/blog/author/thunderbiscuit/",pageKeys:["v-3875825f","v-8534b9c2","v-4dc135e3"]},"Bitcoin Zavior":{key:"Bitcoin Zavior",scope:"author",path:"/blog/author/Bitcoin Zavior/",pageKeys:["v-3eaa044d","v-56536559","v-f58ec8f2"]},"Riccardo Casatta":{key:"Riccardo Casatta",scope:"author",path:"/blog/author/Riccardo Casatta/",pageKeys:["v-9504490e","v-2c605799","v-57698579","v-015729b9"]},"Gabriele Domenichini":{key:"Gabriele Domenichini",scope:"author",path:"/blog/author/Gabriele Domenichini/",pageKeys:["v-c6756cce"]},"Alekos Filini":{key:"Alekos Filini",scope:"author",path:"/blog/author/Alekos Filini/",pageKeys:["v-9145467a","v-2cf72b39","v-5d749fce","v-10852eea","v-05df4999","v-edd5570e","v-0119984e","v-75d11339","v-7c3d28f9","v-0df1c3ce","v-55969f39","v-1ac9ef4e","v-faad828e"]},Wszdexdrf:{key:"Wszdexdrf",scope:"author",path:"/blog/author/Wszdexdrf/",pageKeys:["v-11d64359"]},"Sandipan Dey":{key:"Sandipan Dey",scope:"author",path:"/blog/author/Sandipan Dey/",pageKeys:["v-ab5ba3ce"]},"César Alvarez Vallero":{key:"César Alvarez Vallero",scope:"author",path:"/blog/author/César Alvarez Vallero/",pageKeys:["v-d0375c8e"]}}};class el{constructor(t,e){this._metaMap=Object.assign({},t),Object.keys(this._metaMap).forEach(t=>{const{pageKeys:n}=this._metaMap[t];this._metaMap[t].pages=n.map(t=>function(t,e){for(let n=0;n{const{pages:n,path:o}=this._metaMap[e];t.push({name:e,pages:n,path:o})}),t}getItemByName(t){return this._metaMap[t]}}var nl={blog:(t,e)=>{const o=n(45);return o(t.frontmatter.date)-o(e.frontmatter.date)>0?-1:1},tags:(t,e)=>{const o=n(45);return o(t.frontmatter.date)-o(e.frontmatter.date)>0?-1:1},author:(t,e)=>{const o=n(45);return o(t.frontmatter.date)-o(e.frontmatter.date)>0?-1:1}},ol={blog:function(t,e,n){return t.pid===n&&t.id===e},tags:function(t,e,n){const o=e;return["tags"].some(e=>{const n=t.frontmatter[e];return Array.isArray(n)?n.some(t=>t==o):n==o})},author:function(t,e,n){const o=e;return["author","authors"].some(e=>{const n=t.frontmatter[e];return Array.isArray(n)?n.some(t=>t==o):n==o})}},il=[{pid:"blog",id:"blog",filter:ol.blog,sorter:nl.blog,pages:[{path:"/blog/",interval:[0,9]},{path:"/blog/page/2/",interval:[10,19]},{path:"/blog/page/3/",interval:[20,29]},{path:"/blog/page/4/",interval:[30,36]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"BDK",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/BDK/",interval:[0,9]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"project",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/project/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"tutorial",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/tutorial/",interval:[0,7]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Bitcoin Core",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Bitcoin Core/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"RPC",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/RPC/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Wallet",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Wallet/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bdk-cli",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bdk-cli/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"basics",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/basics/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"novice",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/novice/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"architecture",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/architecture/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"tor",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/tor/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"wallet",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/wallet/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"blockchain",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/blockchain/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bindings",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bindings/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"multi-sig",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/multi-sig/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"BDK-RN",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/BDK-RN/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Development",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Development/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Architecture",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Architecture/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"compact_filters",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/compact_filters/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"BIP157",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/BIP157/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Neutrino",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Neutrino/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"guide",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/guide/",interval:[0,5]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"descriptor",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/descriptor/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"paper wallets",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/paper wallets/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bitcoin",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bitcoin/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"React Native",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/React Native/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Flutter",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Flutter/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"iOS",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/iOS/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Android",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Android/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"mobile",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/mobile/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bdk-rn",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bdk-rn/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bdk",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bdk/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"fee",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/fee/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"machine learning",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/machine learning/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"taproot",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/taproot/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"miniscript",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/miniscript/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Hardware Wallets",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Hardware Wallets/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"getting started",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/getting started/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"rust",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/rust/",interval:[0,9]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bitcoin-cli",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bitcoin-cli/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"coin selection",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/coin selection/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"development",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/development/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"summer of bitcoin",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/summer of bitcoin/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"security",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/security/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"release",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/release/",interval:[0,8]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Steve Myers",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Steve Myers/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Daniela Brozzoni",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Daniela Brozzoni/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Rajarshi Maitra",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Rajarshi Maitra/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"waterst0ne",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/waterst0ne/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Lloyd Fournier",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Lloyd Fournier/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"rorp",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/rorp/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"thunderbiscuit",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/thunderbiscuit/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Bitcoin Zavior",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Bitcoin Zavior/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Riccardo Casatta",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Riccardo Casatta/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Gabriele Domenichini",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Gabriele Domenichini/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Alekos Filini",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Alekos Filini/",interval:[0,9]},{path:"/blog/author/Alekos Filini/page/2/",interval:[10,13]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Wszdexdrf",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Wszdexdrf/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Sandipan Dey",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Sandipan Dey/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"César Alvarez Vallero",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/César Alvarez Vallero/",interval:[0,1]}],prevText:"Prev",nextText:"Next"}],rl=n(95);const al=n.n(rl)()("plugin-blog:pagination");class cl{constructor(t,e,n){al("pagination",t);const{pages:o,prevText:i,nextText:r}=t,{path:a}=n;this._prevText=i,this._nextText=r;for(let t=0,e=o.length;tt.filter(e,t.id,t.pid)).sort(t.sorter)}setIndexPage(t){this._indexPage=t}get length(){return this._paginationPages.length}get pages(){const[t,e]=this._currentPage.interval;return this._matchedPages.slice(t,e+1)}get hasPrev(){return 0!==this.paginationIndex}get prevLink(){return this.hasPrev?this.paginationIndex-1==0&&this._indexPage?this._indexPage:this._paginationPages[this.paginationIndex-1].path:null}get hasNext(){return this.paginationIndex!==this.length-1}get nextLink(){return this.hasNext?this._paginationPages[this.paginationIndex+1].path:null}get prevText(){return this._prevText}get nextText(){return this._nextText}getSpecificPageLink(t){return this._paginationPages[t].path}}const ll=new class{constructor(t){this.paginations=t}get pages(){return Vn.$vuepress.$get("siteData").pages}getPagination(t,e,n){al("id",e),al("pid",t);const o=this.paginations.filter(n=>n.id===e&&n.pid===t)[0];return new cl(o,this.pages,n)}}(il);var sl={comment:{enabled:!1,service:""},email:{enabled:!1},feed:{rss:!1,atom:!1,json:!1}},pl=[({router:t})=>{"undefined"!=typeof process&&"server"===process.env.VUE_ENV||t.onReady(()=>{const{app:e}=t;e.$once("hook:mounted",()=>{setTimeout(()=>{const{hash:t}=document.location;if(t.length>1){const e=t.substring(1),n=document.getElementById(e);n&&n.scrollIntoView()}},500)}),document.addEventListener("click",Gc),document.addEventListener("keyup",t=>{qc(t)&&Gc(t)})})},{},({Vue:t})=>{t.mixin({computed:{$dataBlock(){return this.$options.__data__block__}}})},{},{},({Vue:t})=>{t.component("CodeCopy",Sc)},({Vue:t})=>{t.component("Mermaid",Yc)},({Vue:t})=>t.use(Qc.a),{},{},({Vue:t})=>{const e=Object.keys(tl).map(t=>{const e=tl[t],n="$"+t;return{[n](){const{pages:t}=this.$site;return new el(e,t)},["$current"+(t.charAt(0).toUpperCase()+t.slice(1))](){const t=this.$route.meta.id;return this[n].getItemByName(t)}}}).reduce((t,e)=>(Object.assign(t,e),t),{});e.$frontmatterKey=function(){const t=this["$"+this.$route.meta.id];return t||null},t.mixin({computed:e})},({Vue:t})=>{t.mixin({computed:{$pagination(){return this.$route.meta.pid&&this.$route.meta.id?this.$getPagination(this.$route.meta.pid,this.$route.meta.id):null}},methods:{$getPagination(t,e){return e=e||t,ll.getPagination(t,e,this.$route)}}})},({Vue:t})=>{const e={$service:()=>sl};t.mixin({computed:e})}],dl=[];class ul extends class{constructor(){this.store=new Vn({data:{state:{}}})}$get(t){return this.store.state[t]}$set(t,e){Vn.set(this.store.state,t,e)}$emit(...t){this.store.$emit(...t)}$on(...t){this.store.$on(...t)}}{}Object.assign(ul.prototype,{getPageAsyncComponent:ac,getLayoutAsyncComponent:cc,getAsyncComponent:lc,getVueComponent:sc});var gl={install(t){const e=new ul;t.$vuepress=e,t.prototype.$vuepress=e}};function hl(t,e){const n=e.toLowerCase();return t.options.routes.some(t=>t.path.toLowerCase()===n)}var ml={props:{pageKey:String,slotKey:{type:String,default:"default"}},render(t){const e=this.pageKey||this.$parent.$page.key;return dc("pageKey",e),Vn.component(e)||Vn.component(e,ac(e)),Vn.component(e)?t(e):t("")}},fl={functional:!0,props:{slotKey:String,required:!0},render:(t,{props:e,slots:n})=>t("div",{class:["content__"+e.slotKey]},n()[e.slotKey])},vl={computed:{openInNewWindowTitle(){return this.$themeLocaleConfig.openNewWindowText||"(opens new window)"}}},bl=(n(249),n(250),Object(Kc.a)(vl,(function(){var t=this._self._c;return t("span",[t("svg",{staticClass:"icon outbound",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"}},[t("path",{attrs:{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}}),this._v(" "),t("polygon",{attrs:{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"}})]),this._v(" "),t("span",{staticClass:"sr-only"},[this._v(this._s(this.openInNewWindowTitle))])])}),[],!1,null,null,null).exports),yl={functional:!0,render(t,{parent:e,children:n}){if(e._isMounted)return n;e.$once("hook:mounted",()=>{e.$forceUpdate()})}};Vn.config.productionTip=!1,Vn.use(Wa),Vn.use(gl),Vn.mixin(function(t,e,n=Vn){!function(t){t.locales&&Object.keys(t.locales).forEach(e=>{t.locales[e].path=e});Object.freeze(t)}(e),n.$vuepress.$set("siteData",e);const o=new(t(n.$vuepress.$get("siteData"))),i=Object.getOwnPropertyDescriptors(Object.getPrototypeOf(o)),r={};return Object.keys(i).reduce((t,e)=>(e.startsWith("$")&&(t[e]=i[e].get),t),r),{computed:r}}(t=>class{setPage(t){this.__page=t}get $site(){return t}get $themeConfig(){return this.$site.themeConfig}get $frontmatter(){return this.$page.frontmatter}get $localeConfig(){const{locales:t={}}=this.$site;let e,n;for(const o in t)"/"===o?n=t[o]:0===this.$page.path.indexOf(o)&&(e=t[o]);return e||n||{}}get $siteTitle(){return this.$localeConfig.title||this.$site.title||""}get $canonicalUrl(){const{canonicalUrl:t}=this.$page.frontmatter;return"string"==typeof t&&t}get $title(){const t=this.$page,{metaTitle:e}=this.$page.frontmatter;if("string"==typeof e)return e;const n=this.$siteTitle,o=t.frontmatter.home?null:t.frontmatter.title||t.title;return n?o?o+" | "+n:n:o||"VuePress"}get $description(){const t=function(t){if(t){const e=t.filter(t=>"description"===t.name)[0];if(e)return e.content}}(this.$page.frontmatter.meta);return t||(this.$page.frontmatter.description||this.$localeConfig.description||this.$site.description||"")}get $lang(){return this.$page.frontmatter.lang||this.$localeConfig.lang||"en-US"}get $localePath(){return this.$localeConfig.path||"/"}get $themeLocaleConfig(){return(this.$site.themeConfig.locales||{})[this.$localePath]||{}}get $page(){return this.__page?this.__page:function(t,e){for(let n=0;nn||(t.hash?!Vn.$vuepress.$get("disableScrollBehavior")&&{selector:decodeURIComponent(t.hash)}:{x:0,y:0})});!function(t){t.beforeEach((e,n,o)=>{if(hl(t,e.path))o();else if(/(\/|\.html)$/.test(e.path))if(/\/$/.test(e.path)){const n=e.path.replace(/\/$/,"")+".html";hl(t,n)?o(n):o()}else o();else{const n=e.path+"/",i=e.path+".html";hl(t,i)?o(i):hl(t,n)?o(n):o()}})}(n);const o={};try{await Promise.all(pl.filter(t=>"function"==typeof t).map(e=>e({Vue:Vn,options:o,router:n,siteData:zc,isServer:t})))}catch(t){console.error(t)}return{app:new Vn(Object.assign(o,{router:n,render:t=>t("div",{attrs:{id:"app"}},[t("RouterView",{ref:"layout"}),t("div",{class:"global-ui"},dl.map(e=>t(e)))])})),router:n}}(!1).then(({app:t,router:e})=>{e.onReady(()=>{t.$mount("#app")})})}]); \ No newline at end of file diff --git a/bdk-cli/compiler/index.html b/bdk-cli/compiler/index.html index f525332503..ea582769a5 100644 --- a/bdk-cli/compiler/index.html +++ b/bdk-cli/compiler/index.html @@ -35,7 +35,7 @@ - + @@ -155,7 +155,7 @@ } }

# Troubleshooting

# Nothing is printed

This might mean that you have a RUST_LOG variable set to a value that suppresses the compiler's log. You can try adding miniscriptc=info to your RUST_LOG value and see if that works, or open a new clean -shell.

- + diff --git a/bdk-cli/concept/index.html b/bdk-cli/concept/index.html index 05f42640de..eaac75d238 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/installation/index.html b/bdk-cli/installation/index.html index ac05608a3b..c5169f98fb 100644 --- a/bdk-cli/installation/index.html +++ b/bdk-cli/installation/index.html @@ -35,7 +35,7 @@ - + @@ -112,7 +112,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
    -
    - + diff --git a/bdk-cli/interface/index.html b/bdk-cli/interface/index.html index b7460e8886..fe91ffd068 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.

    - + diff --git a/bdk-cli/introduction/index.html b/bdk-cli/introduction/index.html index 774db48113..93ffad0e54 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 e4d253dc38..7521061579 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 e300d8772a..5a202d0f6e 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.

    - + diff --git a/blog/2020/12/hello-world/index.html b/blog/2020/12/hello-world/index.html index 4c56e634ad..d97a4f18f9 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 571ef24e6c..ba74114f70 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/tags/bdk-cli/index.html b/blog/tags/bdk-cli/index.html index f665646050..19e0c47e7d 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 60ebaa2d41..5d03809cde 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 b3913caa80..9976e28e2c 100644 --- a/blog/tags/bdk/index.html +++ b/blog/tags/bdk/index.html @@ -25,7 +25,7 @@ - + @@ -180,6 +180,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/bindings/index.html b/blog/tags/bindings/index.html index b29d4f60b2..35a73f9c22 100644 --- a/blog/tags/bindings/index.html +++ b/blog/tags/bindings/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/bitcoin-cli/index.html b/blog/tags/bitcoin-cli/index.html index 1a594f5871..529de5bc53 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 c404218727..addf996540 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 d906dad49e..065cbed888 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 bebcc76833..4433170c7b 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 21a83e45f7..84fee7da8c 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 01aa7c6dff..61724ec02b 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 fbe7b5aa2f..e7774c365a 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 5acc63f199..9f968a68ed 100644 --- a/blog/tags/fee/index.html +++ b/blog/tags/fee/index.html @@ -25,7 +25,7 @@ - + @@ -49,7 +49,7 @@ Blog GitHub - (opens new window)

    Posts tagged with Fee

    Fee estimation for light-clients (Part 1)

    + (opens new window)

    - + diff --git a/blog/tags/getting started/index.html b/blog/tags/getting started/index.html index b5d6dcf12f..4d409a6b71 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 c24334244f..fa29760e22 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 f9adc66b0a..48cf9f9b75 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 5465a59a58..9c75474f2e 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 741140d25a..79e45cf91f 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 624c72f6e1..c602e4d578 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 1629f72777..7343e41e8b 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 59e3b6044f..e3988b6b2a 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 712f42fb33..c26c40a931 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 e8dd5d2639..773dec51c2 100644 --- a/blog/tags/project/index.html +++ b/blog/tags/project/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/release/index.html b/blog/tags/release/index.html index 68c24a54b3..6419f3c6ad 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 37b6bbdb20..7542e1692f 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 64c74579a9..94164d1d94 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 554a9f2daa..456b04fcb2 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 e44ea202e7..64a0cf7b58 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 4e602b07f9..e99b695fc8 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 25b8004580..9e7aa2e038 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 78fcc5963e..cee70405b3 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 e85c20e9d2..1729e5211d 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/docs-rs/bdk/nightly/latest/bdk_chain/all.html b/docs-rs/bdk/nightly/latest/bdk_chain/all.html index 884c95991b..39aaa3c2ae 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

    List of all items

    Structs

    Enums

    Traits

    Type Aliases

    Constants

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

    List of all items

    Structs

    Enums

    Traits

    Type Aliases

    Constants

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/index.html b/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/index.html index 8b602141cb..3ecf18ea62 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/index.html @@ -1,3 +1,3 @@ -bdk_chain::indexed_tx_graph - Rust

    Module bdk_chain::indexed_tx_graph

    source ·
    Expand description

    Contains the IndexedTxGraph and associated types. Refer to the +bdk_chain::indexed_tx_graph - Rust

    Module bdk_chain::indexed_tx_graph

    source ·
    Expand description

    Contains the IndexedTxGraph and associated types. Refer to the IndexedTxGraph documentation for more.

    Structs§

    Traits§

    • Utilities for indexing transaction data.
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.html b/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.html index 690933bcee..d2d42096da 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.html @@ -1,4 +1,4 @@ -IndexedTxGraph in bdk_chain::indexed_tx_graph - Rust

    Struct bdk_chain::indexed_tx_graph::IndexedTxGraph

    source ·
    pub struct IndexedTxGraph<A, I> {
    +IndexedTxGraph in bdk_chain::indexed_tx_graph - Rust

    Struct bdk_chain::indexed_tx_graph::IndexedTxGraph

    source ·
    pub struct IndexedTxGraph<A, I> {
         pub index: I,
         /* private fields */
     }
    Expand description

    The IndexedTxGraph combines a TxGraph and an Indexer implementation.

    @@ -73,7 +73,7 @@

    Each inserted transaction’s anchor will be constructed from AnchorFromBlockPosition::from_block_position.

    To only insert relevant transactions, use apply_block_relevant instead.

    -

    Trait Implementations§

    source§

    impl<A: Debug, I: Debug> Debug for IndexedTxGraph<A, I>

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<A, I: Default> Default for IndexedTxGraph<A, I>

    source§

    fn default() -> Self

    Returns the “default value” for a type. Read more

    Auto Trait Implementations§

    §

    impl<A, I> Freeze for IndexedTxGraph<A, I>
    where +

    Trait Implementations§

    source§

    impl<A, I> AsRef<TxGraph<A>> for IndexedTxGraph<A, I>

    source§

    fn as_ref(&self) -> &TxGraph<A>

    Converts this type into a shared reference of the (usually inferred) input type.
    source§

    impl<A: Debug, I: Debug> Debug for IndexedTxGraph<A, I>

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<A, I: Default> Default for IndexedTxGraph<A, I>

    source§

    fn default() -> Self

    Returns the “default value” for a type. Read more

    Auto Trait Implementations§

    §

    impl<A, I> Freeze for IndexedTxGraph<A, I>
    where I: Freeze,

    §

    impl<A, I> RefUnwindSafe for IndexedTxGraph<A, I>

    §

    impl<A, I> Send for IndexedTxGraph<A, I>
    where 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 index 2d1d06a80c..eafd573b9f 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/index.html @@ -1,2 +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.

    Type Aliases§

    • A cache of Arc-wrapped full transactions, identified by their [Txid]s.
    \ No newline at end of file +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 index d9de5da8e1..71829127fb 100644 --- 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 @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"struct":["FullScanRequest","FullScanResult","SyncRequest","SyncResult"],"type":["TxCache"]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"struct":["FullScanRequest","FullScanResult","SyncRequest","SyncResult"]}; \ 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 index efb3f3b51e..84c3e1bc4a 100644 --- 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 @@ -1,6 +1,5 @@ -FullScanRequest in bdk_chain::spk_client - Rust

    Struct bdk_chain::spk_client::FullScanRequest

    source ·
    pub struct FullScanRequest<K> {
    +FullScanRequest in bdk_chain::spk_client - Rust

    Struct bdk_chain::spk_client::FullScanRequest

    source ·
    pub struct FullScanRequest<K> {
         pub chain_tip: CheckPoint,
    -    pub tx_cache: TxCache,
         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 @@ -9,15 +8,9 @@ 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.

    -
    §tx_cache: TxCache

    Cache of full transactions, so the chain-source can avoid re-fetching.

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

    Iterators of script pubkeys indexed by the keychain index.

    -

    Implementations§

    source§

    impl<K: Ord + Clone> FullScanRequest<K>

    source

    pub fn from_chain_tip(chain_tip: CheckPoint) -> Self

    Construct a new FullScanRequest from a given chain_tip.

    -
    source

    pub fn cache_txs<T>(self, full_txs: impl IntoIterator<Item = (Txid, T)>) -> Self
    where - T: Into<Arc<Transaction>>,

    Add to the TxCache held by the request.

    -

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn cache_graph_txs<A>(self, graph: &TxGraph<A>) -> Self

    Add all transactions from TxGraph into the TxCache.

    -

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn from_keychain_txout_index( +

    Implementations§

    source§

    impl<K: Ord + Clone> FullScanRequest<K>

    source

    pub fn from_chain_tip(chain_tip: CheckPoint) -> Self

    Construct a new FullScanRequest from a given chain_tip.

    +
    source

    pub fn from_keychain_txout_index( chain_tip: CheckPoint, index: &KeychainTxOutIndex<K> ) -> Self
    where @@ -25,26 +18,26 @@

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

    -

    source

    pub fn set_spks_for_keychain( +

    source

    pub fn set_spks_for_keychain( self, keychain: K, spks: impl IntoIterator<IntoIter = impl Iterator<Item = (u32, ScriptBuf)> + Send + 'static> ) -> Self

    Set the [Script]s for a given keychain.

    This consumes the FullScanRequest and returns the updated one.

    -
    source

    pub fn chain_spks_for_keychain( +

    source

    pub fn chain_spks_for_keychain( self, keychain: K, spks: impl IntoIterator<IntoIter = impl Iterator<Item = (u32, ScriptBuf)> + Send + 'static> ) -> Self

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

    This consumes the FullScanRequest and returns the updated one.

    -
    source

    pub fn inspect_spks_for_all_keychains( +

    source

    pub fn inspect_spks_for_all_keychains( self, inspect: impl FnMut(K, u32, &Script) + Send + Sync + Clone + 'static ) -> Self
    where K: Send + 'static,

    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.

    -
    source

    pub fn inspect_spks_for_keychain( +

    source

    pub fn inspect_spks_for_keychain( self, keychain: K, inspect: impl FnMut(u32, &Script) + Send + Sync + 'static 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 index 85f716c819..5d736d9069 100644 --- 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 @@ -1,4 +1,4 @@ -FullScanResult in bdk_chain::spk_client - Rust

    Struct bdk_chain::spk_client::FullScanResult

    source ·
    pub struct FullScanResult<K, A = ConfirmationTimeHeightAnchor> {
    +FullScanResult in bdk_chain::spk_client - Rust

    Struct bdk_chain::spk_client::FullScanResult

    source ·
    pub struct FullScanResult<K, A = ConfirmationTimeHeightAnchor> {
         pub graph_update: TxGraph<A>,
         pub chain_update: CheckPoint,
         pub last_active_indices: BTreeMap<K, u32>,
    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
    index eac1a5d639..3dfb9db580 100644
    --- 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
    @@ -1,6 +1,5 @@
    -SyncRequest in bdk_chain::spk_client - Rust

    Struct bdk_chain::spk_client::SyncRequest

    source ·
    pub struct SyncRequest {
    +SyncRequest in bdk_chain::spk_client - Rust

    Struct bdk_chain::spk_client::SyncRequest

    source ·
    pub struct SyncRequest {
         pub chain_tip: CheckPoint,
    -    pub tx_cache: TxCache,
         pub spks: Box<dyn ExactSizeIterator<Item = ScriptBuf> + Send>,
         pub txids: Box<dyn ExactSizeIterator<Item = Txid> + Send>,
         pub outpoints: Box<dyn ExactSizeIterator<Item = OutPoint> + Send>,
    @@ -9,62 +8,56 @@
     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.

    -
    §tx_cache: TxCache

    Cache of full transactions, so the chain-source can avoid re-fetching.

    §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§

    source§

    impl SyncRequest

    source

    pub fn from_chain_tip(cp: CheckPoint) -> Self

    Construct a new SyncRequest from a given cp tip.

    -
    source

    pub fn cache_txs<T>(self, full_txs: impl IntoIterator<Item = (Txid, T)>) -> Self
    where - T: Into<Arc<Transaction>>,

    Add to the TxCache held by the request.

    -

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn cache_graph_txs<A>(self, graph: &TxGraph<A>) -> Self

    Add all transactions from TxGraph into the TxCache.

    -

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn set_spks( +

    Implementations§

    source§

    impl SyncRequest

    source

    pub fn from_chain_tip(cp: CheckPoint) -> Self

    Construct a new SyncRequest from a given cp tip.

    +
    source

    pub fn set_spks( self, spks: impl IntoIterator<IntoIter = impl ExactSizeIterator<Item = ScriptBuf> + Send + 'static> ) -> Self

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn set_txids( +

    source

    pub fn set_txids( self, txids: impl IntoIterator<IntoIter = impl ExactSizeIterator<Item = Txid> + Send + 'static> ) -> Self

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn set_outpoints( +

    source

    pub fn set_outpoints( self, outpoints: impl IntoIterator<IntoIter = impl ExactSizeIterator<Item = OutPoint> + Send + 'static> ) -> Self

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn chain_spks( +

    source

    pub fn chain_spks( self, spks: impl IntoIterator<IntoIter = impl ExactSizeIterator<Item = ScriptBuf> + Send + 'static, Item = ScriptBuf> ) -> Self

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn chain_txids( +

    source

    pub fn chain_txids( self, txids: impl IntoIterator<IntoIter = impl ExactSizeIterator<Item = Txid> + Send + 'static, Item = Txid> ) -> Self

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn chain_outpoints( +

    source

    pub fn chain_outpoints( self, outpoints: impl IntoIterator<IntoIter = impl ExactSizeIterator<Item = OutPoint> + Send + 'static, Item = OutPoint> ) -> Self

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn inspect_spks( +

    source

    pub fn inspect_spks( self, inspect: impl FnMut(&Script) + Send + Sync + 'static ) -> 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.

    -
    source

    pub fn inspect_txids( +

    source

    pub fn inspect_txids( self, inspect: impl FnMut(&Txid) + Send + Sync + 'static ) -> 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.

    -
    source

    pub fn inspect_outpoints( +

    source

    pub fn inspect_outpoints( self, inspect: impl FnMut(&OutPoint) + Send + Sync + 'static ) -> 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.

    -
    source

    pub fn populate_with_revealed_spks<K: Clone + Ord + Debug + Send + Sync>( +

    source

    pub fn populate_with_revealed_spks<K: Clone + Ord + Debug + Send + Sync>( self, index: &KeychainTxOutIndex<K>, spk_range: impl RangeBounds<K> 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 index 450b6b1da6..09d1a71604 100644 --- 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 @@ -1,4 +1,4 @@ -SyncResult in bdk_chain::spk_client - Rust

    Struct bdk_chain::spk_client::SyncResult

    source ·
    pub struct SyncResult<A = ConfirmationTimeHeightAnchor> {
    +SyncResult in bdk_chain::spk_client - Rust

    Struct bdk_chain::spk_client::SyncResult

    source ·
    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.

    diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/type.TxCache.html b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/type.TxCache.html deleted file mode 100644 index c02106a77d..0000000000 --- a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/type.TxCache.html +++ /dev/null @@ -1,3 +0,0 @@ -TxCache in bdk_chain::spk_client - Rust

    Type Alias bdk_chain::spk_client::TxCache

    source ·
    pub type TxCache = HashMap<Txid, Arc<Transaction>>;
    Expand description

    A cache of Arc-wrapped full transactions, identified by their [Txid]s.

    -

    This is used by the chain-source to avoid re-fetching full transactions.

    -

    Aliased Type§

    struct TxCache { /* private fields */ }
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.TxGraph.html b/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.TxGraph.html index 70d94cdc47..78b72bb01b 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.TxGraph.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.TxGraph.html @@ -1,4 +1,4 @@ -TxGraph in bdk_chain::tx_graph - Rust

    Struct bdk_chain::tx_graph::TxGraph

    source ·
    pub struct TxGraph<A = ()> { /* private fields */ }
    Expand description

    A graph of transactions and spends.

    +TxGraph in bdk_chain::tx_graph - Rust

    Struct bdk_chain::tx_graph::TxGraph

    source ·
    pub struct TxGraph<A = ()> { /* private fields */ }
    Expand description

    A graph of transactions and spends.

    See the module-level documentation for more.

    Implementations§

    source§

    impl<A> TxGraph<A>

    source

    pub fn all_txouts(&self) -> impl Iterator<Item = (OutPoint, &TxOut)>

    Iterate over all tx outputs known by TxGraph.

    This includes txouts of both full transactions as well as floating transactions.

    @@ -276,7 +276,7 @@
    §Error
    trust_predicate: impl FnMut(&OI, &Script) -> bool ) -> Balance

    Get the total balance of outpoints that are in chain of chain_tip.

    This is the infallible version of try_balance.

    -

    Trait Implementations§

    source§

    impl<A> AsRef<TxGraph<A>> for TxGraph<A>

    source§

    fn as_ref(&self) -> &TxGraph<A>

    Converts this type into a shared reference of the (usually inferred) input type.
    source§

    impl<A: Clone> Clone for TxGraph<A>

    source§

    fn clone(&self) -> TxGraph<A>

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl<A: Debug> Debug for TxGraph<A>

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<A> Default for TxGraph<A>

    source§

    fn default() -> Self

    Returns the “default value” for a type. Read more
    source§

    impl<A: PartialEq> PartialEq for TxGraph<A>

    source§

    fn eq(&self, other: &TxGraph<A>) -> bool

    This method tests for self and other values to be equal, and is used +

    Trait Implementations§

    source§

    impl<A, I> AsRef<TxGraph<A>> for IndexedTxGraph<A, I>

    source§

    fn as_ref(&self) -> &TxGraph<A>

    Converts this type into a shared reference of the (usually inferred) input type.
    source§

    impl<A> AsRef<TxGraph<A>> for TxGraph<A>

    source§

    fn as_ref(&self) -> &TxGraph<A>

    Converts this type into a shared reference of the (usually inferred) input type.
    source§

    impl<A: Clone> Clone for TxGraph<A>

    source§

    fn clone(&self) -> TxGraph<A>

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl<A: Debug> Debug for TxGraph<A>

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<A> Default for TxGraph<A>

    source§

    fn default() -> Self

    Returns the “default value” for a type. Read more
    source§

    impl<A: PartialEq> PartialEq for TxGraph<A>

    source§

    fn eq(&self, other: &TxGraph<A>) -> bool

    This method tests for self and other values to be equal, and is used by ==.
    1.0.0 · source§

    fn ne(&self, other: &Rhs) -> bool

    This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
    source§

    impl<A> StructuralPartialEq for TxGraph<A>

    Auto Trait Implementations§

    §

    impl<A> Freeze for TxGraph<A>

    §

    impl<A> RefUnwindSafe for TxGraph<A>
    where A: RefUnwindSafe,

    §

    impl<A> Send for TxGraph<A>
    where diff --git a/docs-rs/bdk/nightly/latest/bdk_electrum/all.html b/docs-rs/bdk/nightly/latest/bdk_electrum/all.html index df72b82fd6..1137197c92 100644 --- a/docs-rs/bdk/nightly/latest/bdk_electrum/all.html +++ b/docs-rs/bdk/nightly/latest/bdk_electrum/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_electrum/bdk_electrum_client/struct.BdkElectrumClient.html b/docs-rs/bdk/nightly/latest/bdk_electrum/bdk_electrum_client/struct.BdkElectrumClient.html new file mode 100644 index 0000000000..b71a4377ff --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_electrum/bdk_electrum_client/struct.BdkElectrumClient.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

    Redirecting to ../../bdk_electrum/struct.BdkElectrumClient.html...

    + + + \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_electrum/electrum_ext/struct.ElectrumFullScanResult.html b/docs-rs/bdk/nightly/latest/bdk_electrum/bdk_electrum_client/struct.ElectrumFullScanResult.html similarity index 100% rename from docs-rs/bdk/nightly/latest/bdk_electrum/electrum_ext/struct.ElectrumFullScanResult.html rename to docs-rs/bdk/nightly/latest/bdk_electrum/bdk_electrum_client/struct.ElectrumFullScanResult.html diff --git a/docs-rs/bdk/nightly/latest/bdk_electrum/electrum_ext/struct.ElectrumSyncResult.html b/docs-rs/bdk/nightly/latest/bdk_electrum/bdk_electrum_client/struct.ElectrumSyncResult.html similarity index 100% rename from docs-rs/bdk/nightly/latest/bdk_electrum/electrum_ext/struct.ElectrumSyncResult.html rename to docs-rs/bdk/nightly/latest/bdk_electrum/bdk_electrum_client/struct.ElectrumSyncResult.html diff --git a/docs-rs/bdk/nightly/latest/bdk_electrum/electrum_ext/trait.ElectrumExt.html b/docs-rs/bdk/nightly/latest/bdk_electrum/electrum_ext/trait.ElectrumExt.html deleted file mode 100644 index ba0451aac7..0000000000 --- a/docs-rs/bdk/nightly/latest/bdk_electrum/electrum_ext/trait.ElectrumExt.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

    Redirecting to ../../bdk_electrum/trait.ElectrumExt.html...

    - - - \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_electrum/index.html b/docs-rs/bdk/nightly/latest/bdk_electrum/index.html index d4b0afba73..08d8a29824 100644 --- a/docs-rs/bdk/nightly/latest/bdk_electrum/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_electrum/index.html @@ -1,11 +1,12 @@ -bdk_electrum - Rust

    Crate bdk_electrum

    source ·
    Expand description

    This crate is used for updating structures of bdk_chain with data from an Electrum server.

    -

    The two primary methods are ElectrumExt::sync and ElectrumExt::full_scan. In most cases -ElectrumExt::sync is used to sync the transaction histories of scripts that the application +bdk_electrum - Rust

    Crate bdk_electrum

    source ·
    Expand description

    This crate is used for updating structures of bdk_chain with data from an Electrum server.

    +

    The two primary methods are BdkElectrumClient::sync and BdkElectrumClient::full_scan. In most cases +BdkElectrumClient::sync is used to sync the transaction histories of scripts that the application cares about, for example the scripts for all the receive addresses of a Wallet’s keychain that it -has shown a user. ElectrumExt::full_scan is meant to be used when importing or restoring a +has shown a user. BdkElectrumClient::full_scan is meant to be used when importing or restoring a keychain where the range of possibly used scripts is not known. In this case it is necessary to scan all keychain scripts until a number (the “stop gap”) of unused scripts is discovered. For a sync or full scan the user receives relevant blockchain data and output updates for bdk_chain.

    Refer to example_electrum for a complete example.

    -

    Re-exports§

    Structs§

    Traits§

    • Trait to extend [electrum_client::Client] functionality.
    \ No newline at end of file +

    Re-exports§

    Structs§

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_electrum/sidebar-items.js b/docs-rs/bdk/nightly/latest/bdk_electrum/sidebar-items.js index 77a99e21c4..7497493a32 100644 --- a/docs-rs/bdk/nightly/latest/bdk_electrum/sidebar-items.js +++ b/docs-rs/bdk/nightly/latest/bdk_electrum/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"struct":["ElectrumFullScanResult","ElectrumSyncResult"],"trait":["ElectrumExt"]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"struct":["BdkElectrumClient","ElectrumFullScanResult","ElectrumSyncResult"]}; \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_electrum/struct.BdkElectrumClient.html b/docs-rs/bdk/nightly/latest/bdk_electrum/struct.BdkElectrumClient.html new file mode 100644 index 0000000000..0c6ffa1a46 --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_electrum/struct.BdkElectrumClient.html @@ -0,0 +1,64 @@ +BdkElectrumClient in bdk_electrum - Rust

    Struct bdk_electrum::BdkElectrumClient

    source ·
    pub struct BdkElectrumClient<E> {
    +    pub inner: E,
    +    /* private fields */
    +}
    Expand description

    Wrapper around an [electrum_client::ElectrumApi] which includes an internal in-memory +transaction cache to avoid re-fetching already downloaded transactions.

    +

    Fields§

    §inner: E

    The internal [electrum_client::ElectrumApi]

    +

    Implementations§

    source§

    impl<E: ElectrumApi> BdkElectrumClient<E>

    source

    pub fn new(client: E) -> Self

    Creates a new bdk client from a [electrum_client::ElectrumApi]

    +
    source

    pub fn populate_tx_cache<A>(&self, tx_graph: impl AsRef<TxGraph<A>>)

    Inserts transactions into the transaction cache so that the client will not fetch these +transactions.

    +
    source

    pub fn fetch_tx(&self, txid: Txid) -> Result<Arc<Transaction>, Error>

    Fetch transaction of given txid.

    +

    If it hits the cache it will return the cached version and avoid making the request.

    +
    source

    pub fn transaction_broadcast(&self, tx: &Transaction) -> Result<Txid, Error>

    Broadcasts a transaction to the network.

    +

    This is a re-export of [ElectrumApi::transaction_broadcast].

    +
    source

    pub fn full_scan<K: Ord + Clone>( + &self, + request: FullScanRequest<K>, + stop_gap: usize, + batch_size: usize, + fetch_prev_txouts: bool +) -> Result<ElectrumFullScanResult<K>, Error>

    Full scan the keychain scripts specified with the blockchain (via an Electrum client) and +returns updates for bdk_chain data structures.

    +
      +
    • request: struct with data required to perform a spk-based blockchain client full scan, +see FullScanRequest
    • +
    • stop_gap: the full scan for each keychain stops after a gap of script pubkeys with no +associated transactions
    • +
    • batch_size: specifies the max number of script pubkeys to request for in a single batch +request
    • +
    • fetch_prev_txouts: specifies whether or not we want previous TxOuts for fee
    • +
    +
    source

    pub fn sync( + &self, + request: SyncRequest, + batch_size: usize, + fetch_prev_txouts: bool +) -> Result<ElectrumSyncResult, Error>

    Sync a set of scripts with the blockchain (via an Electrum client) for the data specified +and returns updates for bdk_chain data structures.

    +
      +
    • request: struct with data required to perform a spk-based blockchain client sync, +see SyncRequest
    • +
    • batch_size: specifies the max number of script pubkeys to request for in a single batch +request
    • +
    • fetch_prev_txouts: specifies whether or not we want previous TxOuts for fee +calculation
    • +
    +

    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.

    +

    Trait Implementations§

    source§

    impl<E: Debug> Debug for BdkElectrumClient<E>

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    §

    impl<E> !Freeze for BdkElectrumClient<E>

    §

    impl<E> RefUnwindSafe for BdkElectrumClient<E>
    where + E: RefUnwindSafe,

    §

    impl<E> Send for BdkElectrumClient<E>
    where + E: Send,

    §

    impl<E> Sync for BdkElectrumClient<E>
    where + E: Sync,

    §

    impl<E> Unpin for BdkElectrumClient<E>
    where + E: Unpin,

    §

    impl<E> UnwindSafe for BdkElectrumClient<E>
    where + E: UnwindSafe,

    Blanket Implementations§

    source§

    impl<T> Any for T
    where + T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where + T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where + T: ?Sized,

    source§

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    source§

    impl<T> From<T> for T

    source§

    fn from(t: T) -> T

    Returns the argument unchanged.

    +
    source§

    impl<T, U> Into<U> for T
    where + U: From<T>,

    source§

    fn into(self) -> U

    Calls U::from(self).

    +

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

    +
    source§

    impl<T, U> TryFrom<U> for T
    where + U: Into<T>,

    §

    type Error = Infallible

    The type returned in the event of a conversion error.
    source§

    fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

    Performs the conversion.
    source§

    impl<T, U> TryInto<U> for T
    where + U: TryFrom<T>,

    §

    type Error = <U as TryFrom<T>>::Error

    The type returned in the event of a conversion error.
    source§

    fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

    Performs the conversion.
    §

    impl<V, T> VZip<V> for T
    where + V: MultiLane<T>,

    §

    fn vzip(self) -> V

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_electrum/struct.ElectrumFullScanResult.html b/docs-rs/bdk/nightly/latest/bdk_electrum/struct.ElectrumFullScanResult.html index 7fdceb3ad4..af7641afbe 100644 --- a/docs-rs/bdk/nightly/latest/bdk_electrum/struct.ElectrumFullScanResult.html +++ b/docs-rs/bdk/nightly/latest/bdk_electrum/struct.ElectrumFullScanResult.html @@ -1,12 +1,12 @@ -ElectrumFullScanResult in bdk_electrum - Rust

    Struct bdk_electrum::ElectrumFullScanResult

    source ·
    pub struct ElectrumFullScanResult<K>(/* private fields */);
    Expand description

    The result of ElectrumExt::full_scan.

    +ElectrumFullScanResult in bdk_electrum - Rust

    Struct bdk_electrum::ElectrumFullScanResult

    source ·
    pub struct ElectrumFullScanResult<K>(/* private fields */);
    Expand description

    The result of BdkElectrumClient::full_scan.

    This can be transformed into a FullScanResult with either ConfirmationHeightAnchor or ConfirmationTimeHeightAnchor anchor types.

    -

    Implementations§

    Auto Trait Implementations§

    §

    impl<K> Freeze for ElectrumFullScanResult<K>

    §

    impl<K> RefUnwindSafe for ElectrumFullScanResult<K>
    where diff --git a/docs-rs/bdk/nightly/latest/bdk_electrum/struct.ElectrumSyncResult.html b/docs-rs/bdk/nightly/latest/bdk_electrum/struct.ElectrumSyncResult.html index e9179b3f00..473e7642e0 100644 --- a/docs-rs/bdk/nightly/latest/bdk_electrum/struct.ElectrumSyncResult.html +++ b/docs-rs/bdk/nightly/latest/bdk_electrum/struct.ElectrumSyncResult.html @@ -1,12 +1,12 @@ -ElectrumSyncResult in bdk_electrum - Rust

    Struct bdk_electrum::ElectrumSyncResult

    source ·
    pub struct ElectrumSyncResult(/* private fields */);
    Expand description

    The result of ElectrumExt::sync.

    +ElectrumSyncResult in bdk_electrum - Rust

    Struct bdk_electrum::ElectrumSyncResult

    source ·
    pub struct ElectrumSyncResult(/* private fields */);
    Expand description

    The result of BdkElectrumClient::sync.

    This can be transformed into a SyncResult with either ConfirmationHeightAnchor or ConfirmationTimeHeightAnchor anchor types.

    -

    Implementations§

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where diff --git a/docs-rs/bdk/nightly/latest/bdk_electrum/trait.ElectrumExt.html b/docs-rs/bdk/nightly/latest/bdk_electrum/trait.ElectrumExt.html deleted file mode 100644 index e173937b5b..0000000000 --- a/docs-rs/bdk/nightly/latest/bdk_electrum/trait.ElectrumExt.html +++ /dev/null @@ -1,52 +0,0 @@ -ElectrumExt in bdk_electrum - Rust

    Trait bdk_electrum::ElectrumExt

    source ·
    pub trait ElectrumExt {
    -    // Required methods
    -    fn full_scan<K: Ord + Clone>(
    -        &self,
    -        request: FullScanRequest<K>,
    -        stop_gap: usize,
    -        batch_size: usize,
    -        fetch_prev_txouts: bool
    -    ) -> Result<ElectrumFullScanResult<K>, Error>;
    -    fn sync(
    -        &self,
    -        request: SyncRequest,
    -        batch_size: usize,
    -        fetch_prev_txouts: bool
    -    ) -> Result<ElectrumSyncResult, Error>;
    -}
    Expand description

    Trait to extend [electrum_client::Client] functionality.

    -

    Required Methods§

    source

    fn full_scan<K: Ord + Clone>( - &self, - request: FullScanRequest<K>, - stop_gap: usize, - batch_size: usize, - fetch_prev_txouts: bool -) -> Result<ElectrumFullScanResult<K>, Error>

    Full scan the keychain scripts specified with the blockchain (via an Electrum client) and -returns updates for bdk_chain data structures.

    -
      -
    • request: struct with data required to perform a spk-based blockchain client full scan, -see FullScanRequest
    • -
    • stop_gap: the full scan for each keychain stops after a gap of script pubkeys with no -associated transactions
    • -
    • batch_size: specifies the max number of script pubkeys to request for in a single batch -request
    • -
    • fetch_prev_txouts: specifies whether or not we want previous TxOuts for fee -calculation
    • -
    -
    source

    fn sync( - &self, - request: SyncRequest, - batch_size: usize, - fetch_prev_txouts: bool -) -> Result<ElectrumSyncResult, Error>

    Sync a set of scripts with the blockchain (via an Electrum client) for the data specified -and returns updates for bdk_chain data structures.

    -
      -
    • request: struct with data required to perform a spk-based blockchain client sync, -see SyncRequest
    • -
    • batch_size: specifies the max number of script pubkeys to request for in a single batch -request
    • -
    • fetch_prev_txouts: specifies whether or not we want previous TxOuts for fee -calculation
    • -
    -

    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.

    -

    Object Safety§

    This trait is not object safe.

    Implementors§

    source§

    impl<E: ElectrumApi> ElectrumExt for E

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/fn.wallet_name_from_descriptor.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/fn.wallet_name_from_descriptor.html index 77958946e3..dc8dccd17f 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/fn.wallet_name_from_descriptor.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/fn.wallet_name_from_descriptor.html @@ -1,4 +1,4 @@ -wallet_name_from_descriptor in bdk_wallet::wallet - Rust

    Function bdk_wallet::wallet::wallet_name_from_descriptor

    source ·
    pub fn wallet_name_from_descriptor<T>(
    +wallet_name_from_descriptor in bdk_wallet::wallet - Rust

    Function bdk_wallet::wallet::wallet_name_from_descriptor

    source ·
    pub fn wallet_name_from_descriptor<T>(
         descriptor: T,
         change_descriptor: Option<T>,
         network: Network,
    diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/index.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/index.html
    index 59d29fd813..11cab42e76 100644
    --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/index.html
    +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/index.html
    @@ -1,4 +1,4 @@
    -bdk_wallet::wallet - Rust

    Module bdk_wallet::wallet

    source ·
    Expand description

    Wallet

    +bdk_wallet::wallet - Rust

    Module bdk_wallet::wallet

    source ·
    Expand description

    Wallet

    This module defines the Wallet.

    Modules§

    Structs§

    • A derived address and the index it was found at. For convenience this automatically derefs to Address
    • Balance, differentiated into various categories.
    • An update to Wallet.
    • A Bitcoin wallet

    Enums§

    Traits§

    • Trait to check if a value is below the dust limit. diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/struct.Wallet.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/struct.Wallet.html index b0c5cef78c..a72e268a05 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/struct.Wallet.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/struct.Wallet.html @@ -411,18 +411,18 @@
      §Example
      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.

      -

    source§

    impl Wallet

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

    -
    source

    pub fn start_sync_with_revealed_spks(&self) -> SyncRequest

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

    +
    source§

    impl Wallet

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

    +
    source

    pub fn start_sync_with_revealed_spks(&self) -> SyncRequest

    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.

    -
    source

    pub fn start_full_scan(&self) -> FullScanRequest<KeychainKind>

    Create a `FullScanRequest for this wallet.

    +
    source

    pub fn start_full_scan(&self) -> FullScanRequest<KeychainKind>

    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§

    source§

    impl AsRef<TxGraph<ConfirmationTimeHeightAnchor>> for Wallet

    source§

    fn as_ref(&self) -> &TxGraph<ConfirmationTimeHeightAnchor>

    Converts this type into a shared reference of the (usually inferred) input type.
    source§

    impl Debug for Wallet

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    §

    impl Freeze for Wallet

    §

    impl !RefUnwindSafe for Wallet

    §

    impl Send for Wallet

    §

    impl Sync for Wallet

    §

    impl Unpin for Wallet

    §

    impl !UnwindSafe for Wallet

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl AsRef<TxGraph<ConfirmationTimeHeightAnchor>> for Wallet

    source§

    fn as_ref(&self) -> &TxGraph<ConfirmationTimeHeightAnchor>

    Converts this type into a shared reference of the (usually inferred) input type.
    source§

    impl Debug for Wallet

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    §

    impl Freeze for Wallet

    §

    impl !RefUnwindSafe for Wallet

    §

    impl Send for Wallet

    §

    impl Sync for Wallet

    §

    impl Unpin for Wallet

    §

    impl !UnwindSafe for Wallet

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where T: ?Sized,

    source§

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    source§

    impl<T> From<T> for T

    source§

    fn from(t: T) -> T

    Returns the argument unchanged.

    diff --git a/docs-rs/bdk/nightly/latest/example_cli/index.html b/docs-rs/bdk/nightly/latest/example_cli/index.html index f3a1e90733..fc27e23af3 100644 --- a/docs-rs/bdk/nightly/latest/example_cli/index.html +++ b/docs-rs/bdk/nightly/latest/example_cli/index.html @@ -1,2 +1,2 @@ -example_cli - Rust

    Crate example_cli

    source ·

    Re-exports§

    • pub use anyhow;
    • pub use bdk_file_store;
    • pub use clap;

    Structs§

    Enums§

    Functions§

    • Parses command line arguments and initializes all components, creating +example_cli - Rust

      Crate example_cli

      source ·

      Re-exports§

      Structs§

      Enums§

      Functions§

      Type Aliases§

      \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_electrum/fn.main.html b/docs-rs/bdk/nightly/latest/example_electrum/fn.main.html index a0e96a282f..d61dd2103e 100644 --- a/docs-rs/bdk/nightly/latest/example_electrum/fn.main.html +++ b/docs-rs/bdk/nightly/latest/example_electrum/fn.main.html @@ -1 +1 @@ -main in example_electrum - Rust

      Function example_electrum::main

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

      Function example_electrum::main

      source ·
      pub(crate) fn main() -> Result<()>
      \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_electrum/index.html b/docs-rs/bdk/nightly/latest/example_electrum/index.html index 39d9ba5f12..3695de6e4d 100644 --- a/docs-rs/bdk/nightly/latest/example_electrum/index.html +++ b/docs-rs/bdk/nightly/latest/example_electrum/index.html @@ -1 +1 @@ -example_electrum - Rust

      Crate example_electrum

      source ·

      Structs§

      Enums§

      Constants§

      Functions§

      Type Aliases§

      \ No newline at end of file +example_electrum - Rust

      Crate example_electrum

      source ·

      Structs§

      Enums§

      Constants§

      Functions§

      Type Aliases§

      \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/search-index.js b/docs-rs/bdk/nightly/latest/search-index.js index dcf43ac7b2..e5738923c8 100644 --- a/docs-rs/bdk/nightly/latest/search-index.js +++ b/docs-rs/bdk/nightly/latest/search-index.js @@ -1,8 +1,8 @@ var searchIndex = new Map(JSON.parse('[\ ["bdk_bitcoind_rpc",{"t":"KFFEONNNNNNONNNNNNMNNNNNNNNNNNN","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":[[0,"bdk_bitcoind_rpc"],[31,"bitcoin::hash_types::newtypes"],[32,"bdk_chain::chain_data"],[33,"core::fmt"],[34,"bitcoin::blockdata::transaction"],[35,"alloc::vec"],[36,"bitcoincore_rpc::error"],[37,"core::result"],[38,"bitcoincore_rpc::client"],[39,"bdk_chain::local_chain"],[40,"bitcoin::blockdata::block"],[41,"core::option"],[42,"core::any"]],"i":[0,0,0,0,1,1,1,12,1,12,1,1,1,1,12,1,12,1,10,12,12,12,12,12,1,12,1,12,1,12,1],"f":"`````{{{d{{b{c}}}}}f{}}{{{d{{b{c}}}}}h{}}{{{d{c}}}{{d{e}}}{}{}}0{{{d{jc}}}{{d{je}}}{}{}}0`{{{d{{b{c}}}}}l{}}{{{d{{b{c}}}}{d{jn}}}A`Ab}{cc{}}0{ce{}{}}0{{{d{Ad}}}Af}{{{d{j{Ah{c}}}}}{{Bd{{B`{{An{AjAl}}}}Bb}}}Bf}{{{d{c}}Bhh}{{Ah{c}}}Bf}{{{d{j{Ah{c}}}}}{{Bd{{Bl{{b{Bj}}}}Bb}}}Bf}{{{d{j{Ah{c}}}}}{{Bd{{Bl{{b{Bn}}}}Bb}}}Bf}{c{{Bd{e}}}{}{}}000{{{d{c}}}C`{}}077","D":"Bd","p":[[5,"BlockEvent",0],[1,"reference"],[5,"BlockHash",31],[1,"u32"],[0,"mut"],[5,"BlockId",32],[5,"Formatter",33],[8,"Result",33],[10,"Debug",33],[10,"BitcoindRpcErrorExt",0],[1,"bool"],[5,"Emitter",0],[5,"Transaction",34],[1,"u64"],[1,"tuple"],[5,"Vec",35],[6,"Error",36],[6,"Result",37],[10,"RpcApi",38],[5,"CheckPoint",39],[5,"Block",40],[6,"Option",41],[5,"Header",40],[5,"TypeId",42]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAA0ABAAEAAAACAADAA4AAAAYAAcA"}],\ -["bdk_chain",{"t":"KKKSFSKGFGFPPKFRFEFFEPPNNMNNNOOMNNNNNENNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNONNNNNMNNNNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNMNNNNNNOONNNNCNNNNNNNNNNNNMNNNMNONNNCCNENNNNNONNNNNNNNNNNNDNNNNNONCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNONNNNNNNNNNNNNNNNNNNNNNNOOOFRFKNNNMNNNNNNNNNNNNNNNNNNNNNNOOMMOMNNNNNNNNMNNNNNNNNNNNFFFNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNONNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNONNNNNFGPFIFFPFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNONNNNNNNFFFFINNNNNNNNNNNNNNNOONOONNNNNNNOONNNNNNNNNOONNNNNOONNNNNNNNOOONNNNNNNNGFFPPFFFFNNNOONNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNONOONNNNNNNNNNNNNNNNNN","n":["Anchor","AnchorFromBlockPosition","Append","BIP32_MAX_INDEX","BlockId","COINBASE_MATURITY","ChainOracle","ChainPosition","ConfirmationHeightAnchor","ConfirmationTime","ConfirmationTimeHeightAnchor","Confirmed","Confirmed","DescriptorExt","DescriptorId","Error","FullTxOut","IndexedTxGraph","SpkIterator","SpkTxOutIndex","TxGraph","Unconfirmed","Unconfirmed","all_spks","all_zeros","anchor_block","anchor_block","anchor_block","anchor_block","anchor_block","anchor_block","append","apply_changeset","as_byte_array","as_raw_hash","as_ref","as_ref","bitcoin","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","chain_position","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","cloned","cmp","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","descriptor_id","deserialize","deserialize","deserialize","deserialize","deserialize","dust_value","engine","eq","eq","eq","eq","eq","eq","eq","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_block_position","from_block_position","from_block_position","from_block_position","from_byte_array","from_engine","from_raw_hash","from_slice","from_slice_delegated","from_str","get_chain_tip","hash","hash","hash","hash","hash","hash","hash","height","index","index_of_spk","index_tx","index_txout","indexed_tx_graph","initial_changeset","insert_spk","into","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","partial_cmp","scan","scan_txout","sent_and_received","serde","serialize","serialize","serialize","serialize","serialize","spent_by","spk_at_index","spk_client","to_byte_array","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_raw_hash","to_string","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","tx_graph","txout","txout","txouts","txouts_in_tx","type_id","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","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","all_unbounded_spk_iters","append","apply_changeset","apply_changeset","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","get_descriptor","immature","index_of_spk","index_tx","index_txout","initial_changeset","inner","insert_descriptor","into","into","into","is_empty","is_tx_relevant","is_used","keychain_outpoints","keychain_outpoints_in_range","keychains","keychains_added","last_revealed","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","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","TxCache","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","cache_graph_txs","cache_graph_txs","cache_txs","cache_txs","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","tx_cache","tx_cache","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","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":[[0,"bdk_chain"],[269,"bdk_chain::ConfirmationTime"],[272,"bdk_chain::indexed_tx_graph"],[328,"bdk_chain::keychain"],[430,"bdk_chain::local_chain"],[572,"bdk_chain::spk_client"],[643,"bdk_chain::tx_graph"],[804,"bdk_chain::spk_txout_index"],[805,"bitcoin::blockdata::script::owned"],[806,"alloc::collections::btree::map"],[807,"core::clone"],[808,"core::cmp"],[809,"bdk_chain::descriptor_ext"],[810,"bdk_chain::tx_data_traits"],[811,"bdk_chain::chain_data"],[812,"bitcoin_hashes::sha256"],[813,"bdk_chain::spk_iter"],[814,"core::option"],[815,"miniscript::descriptor::key"],[816,"miniscript::descriptor"],[817,"core::borrow"],[818,"core::result"],[819,"serde::de"],[820,"core::fmt"],[821,"bitcoin::hash_types::newtypes"],[822,"bitcoin::blockdata::block"],[823,"bitcoin_hashes"],[824,"bdk_chain::chain_oracle"],[825,"core::hash"],[826,"core::slice::index"],[827,"bitcoin::blockdata::script::borrowed"],[828,"bitcoin::blockdata::transaction"],[829,"bitcoin::amount"],[830,"core::ops::range"],[831,"alloc::collections::btree::set"],[832,"core::iter::traits::double_ended"],[833,"serde::ser"],[834,"alloc::string"],[835,"core::iter::traits::exact_size"],[836,"core::any"],[837,"core::iter::traits::collect"],[838,"core::default"],[839,"bdk_chain::keychain::txout_index"],[840,"core::iter::traits::iterator"],[841,"alloc::sync"],[842,"core::convert"],[843,"core::marker"],[844,"core::ops::function"],[845,"std::collections::hash::set"]],"i":[0,0,0,0,0,0,0,0,0,0,0,19,20,0,0,46,0,0,0,0,0,19,20,1,7,8,9,10,11,10,11,13,1,7,7,7,7,0,1,19,20,9,10,11,21,7,7,22,1,19,20,9,10,11,21,7,22,21,1,19,20,9,10,11,21,7,22,1,19,20,9,10,11,21,7,22,19,19,20,9,10,11,21,7,10,11,8,8,19,10,11,11,1,9,10,11,22,29,20,9,10,11,7,29,7,19,20,9,10,11,21,7,1,19,20,9,10,11,21,7,7,7,7,1,19,20,20,9,9,9,10,11,21,7,7,22,42,9,10,11,7,7,7,7,7,7,46,19,20,9,10,11,7,9,9,7,1,1,1,0,1,1,1,19,20,9,10,11,21,7,22,22,46,19,20,21,13,21,21,1,1,1,0,0,1,0,1,22,22,22,22,21,1,1,19,20,9,10,11,21,7,1,1,1,0,20,9,10,11,7,21,1,0,7,1,19,20,9,10,11,21,7,22,7,7,1,19,20,9,10,11,21,7,22,1,19,20,9,10,11,21,7,22,0,1,21,1,1,1,19,20,9,10,11,21,7,22,20,1,1,1,19,20,9,10,11,21,7,22,105,106,105,0,68,0,0,66,67,67,68,67,67,67,67,67,67,66,67,66,66,66,67,66,66,66,67,66,67,66,66,66,67,66,67,68,68,66,68,67,67,67,67,67,67,66,66,68,67,66,66,67,66,67,66,67,66,67,66,0,0,0,77,78,75,78,78,75,78,77,75,78,77,75,78,77,75,78,77,77,75,78,77,75,77,75,77,75,78,77,77,75,78,77,78,77,78,78,78,78,78,78,75,78,77,75,78,78,78,78,78,75,75,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,75,77,78,75,78,77,77,77,77,77,75,78,77,75,78,77,78,78,78,75,78,77,78,78,77,78,78,75,78,77,0,0,84,0,0,0,0,84,0,0,79,79,79,79,85,87,85,79,81,86,83,84,87,85,79,81,86,83,84,85,79,81,86,83,84,85,79,81,86,83,84,79,85,79,81,86,83,84,85,85,79,81,81,86,86,83,83,84,84,87,85,79,81,86,83,84,85,79,79,79,85,79,79,85,79,79,85,85,86,79,85,79,87,85,79,81,86,83,84,87,85,79,85,79,85,87,86,85,85,85,79,79,85,79,81,86,83,84,81,86,83,84,87,85,79,81,86,83,84,83,87,85,79,81,86,83,84,87,85,79,81,86,83,84,86,87,85,79,81,86,83,84,0,0,0,0,0,89,107,90,108,89,107,90,108,89,90,89,90,89,89,90,89,90,89,107,108,89,107,90,108,89,90,90,107,108,89,89,90,90,89,89,107,90,108,108,89,89,89,89,90,89,89,90,89,107,90,108,89,107,90,108,89,90,89,89,107,90,108,89,107,90,108,0,0,0,99,99,0,0,0,0,70,70,74,100,74,74,70,70,70,70,70,102,103,70,100,101,99,74,102,103,70,100,101,99,74,70,101,102,102,103,103,70,100,101,74,70,100,101,74,100,101,70,74,100,74,70,70,100,101,99,74,70,70,70,70,100,101,99,99,74,102,103,70,100,101,99,74,70,70,70,70,70,70,70,70,70,70,70,102,103,70,100,101,99,74,102,103,70,74,74,100,70,70,74,70,102,103,70,100,101,74,70,100,101,74,99,70,70,70,102,103,70,100,101,99,74,70,70,102,103,70,100,101,99,74,70,100,101,70,70,100,74,74,74,102,103,70,100,101,99,74,70,102,103,70,100,101,99,74,70,70,70],"f":"```````````````````````{{{d{{b{c}}}}}{{d{{h{cf}}}}}{jl}}{{}n}{{{d{A`}}}Ab}{{{d{Ab}}}Ab}{{{d{Ad}}}Ab}{{{d{Af}}}Ab}``{{{d{AhAj}}Aj}Al}{{{d{Ah{b{c}}}}e}Al{jl}{}}{{{d{n}}}{{d{c}}}{}}{{{d{n}}}{{d{An}}}}{{{d{n}}}{{d{{Bb{B`}}}}}}{{{d{n}}}{{d{{Bd{B`}}}}}}`{{{d{c}}}{{d{e}}}{}{}}000000020{{{d{Ahc}}}{{d{Ahe}}}{}{}}00000000`{{{d{{b{c}}}}}{{b{c}}}j}{{{d{{Bf{c}}}}}{{Bf{c}}}j}{{{d{Bh}}}Bh}={{{d{Ad}}}Ad}{{{d{Af}}}Af}{{{d{{Bj{c}}}}}{{Bj{c}}}j}{{{d{n}}}n}{{{d{{Bl{c}}}}}{{Bl{c}}}j}{{{d{c}}{d{Ahe}}}Al{}{}}00000000{{{Bf{{d{c}}}}}{{Bf{c}}}j}{{{d{{Bf{c}}}}{d{{Bf{c}}}}}Bnl}{{{d{Bh}}{d{Bh}}}Bn}{{{d{Ab}}{d{Ab}}}Bn}{{{d{Ad}}{d{Ad}}}Bn}{{{d{Af}}{d{Af}}}Bn}{{{d{{Bj{c}}}}{d{{Bj{c}}}}}Bnl}{{{d{n}}{d{n}}}Bn}``{{{d{A`}}}C`}0{{{d{{Bf{c}}}}}{{Cb{C`}}}A`}{{{d{Ad}}}C`}{{{d{Af}}}C`}`{{}{{b{c}}}{}}{{}Ab}{{}Ad}{{}Af}{{{d{{Bl{c}}}}}{{d{c}}}{{Ch{{Cf{Cd}}}}}}{{{d{Cj}}}n}{c{{Cl{Bh}}}Cn}{c{{Cl{Ab}}}Cn}{c{{Cl{Ad}}}Cn}{c{{Cl{Af}}}Cn}{c{{Cl{n}}}Cn}{{{d{Cj}}}D`}{{}c{}}{{{d{{Bf{c}}}}{d{{Bf{c}}}}}DbDd}{{{d{Bh}}{d{Bh}}}Db}{{{d{Ab}}{d{Ab}}}Db}{{{d{Ad}}{d{Ad}}}Db}{{{d{Af}}{d{Af}}}Db}{{{d{{Bj{c}}}}{d{{Bj{c}}}}}DbDd}{{{d{n}}{d{n}}}Db}{{{d{{b{c}}}}{d{AhDf}}}DhDj}{{{d{{Bf{c}}}}{d{AhDf}}}DhDj}{{{d{Bh}}{d{AhDf}}}Dh}{{{d{Ab}}{d{AhDf}}}Dh}{{{d{Ad}}{d{AhDf}}}Dh}{{{d{Af}}{d{AhDf}}}Dh}{{{d{{Bj{c}}}}{d{AhDf}}}DhDj}{{{d{n}}{d{AhDf}}}Dh}000{cc{}}00{{{Bf{Af}}}Bh}{{{Dn{C`Dl}}}Ab}{{{Dn{{d{C`}}{d{Dl}}}}}Ab}33333{Ann}4{{{d{E`}}AbEb}Ed}{{{d{E`}}AbEb}Ab}{{{d{E`}}AbEb}Ad}{{{d{E`}}AbEb}Af}{cn{}}05{{{d{{Bb{B`}}}}}{{Cl{nEf}}}}0{{{d{Eh}}}{{Cl{nc}}}{}}{{{d{{El{}{{Ej{c}}}}}}}{{Cl{Abc}}}Dj}{{{d{{Bf{c}}}}{d{Ahe}}}AlEnF`}{{{d{Bh}}{d{Ahc}}}AlF`}{{{d{Ab}}{d{Ahc}}}AlF`}{{{d{Ad}}{d{Ahc}}}AlF`}{{{d{Af}}{d{Ahc}}}AlF`}{{{d{n}}{d{Ahc}}}AlF`}``{{{d{n}}c}{{d{e}}}{{Fb{{Bb{B`}}}}}{}}{{{d{{b{c}}}}{d{Fd}}}{{Cb{{d{c}}}}}{jl}}{{{d{Ah{b{c}}}}{d{Ff}}}e{jl}{}}{{{d{Ah{b{c}}}}Fh{d{Fj}}}e{jl}{}}`{{{d{{b{c}}}}}e{jl}{}}{{{d{Ah{b{c}}}}cf}Db{jl}}{ce{}{}}000000000{{{d{{El{}{{Ej{c}}}}}}AbAb}{{Cl{{Cb{Db}}c}}}Dj}{{{d{{Bf{c}}}}}Db{}}{{{d{Bh}}}Db}{{{d{{Bj{c}}}}C`}DbA`}{{{d{Aj}}}Db}1`{{{d{{b{c}}}}{d{Ff}}}Db{jl}}0{{{d{{b{c}}}}{d{c}}}Db{jl}}``{{{d{Ah{b{c}}}}{d{c}}}Db{jl}}`{{{d{{b{c}}}}{d{Ff}}e}Fl{jl}{{Fn{c}}}}{c{{Bl{c}}}{{Ch{{Cf{Cd}}}}}}{{ce}{{Bl{c}}}{{Ch{{Cf{Cd}}}}}{{Fn{C`}}}}{{{d{Ah{Bl{c}}}}}{{Cb{e}}}{{Ch{{Cf{Cd}}}}}{}}{{{d{Ah{Bl{c}}}}Eb}{{Cb{e}}}{{Ch{{Cf{Cd}}}}}{}}`{{{d{{b{c}}}}}{{d{{G`{{Dn{cFh}}}}}}}{jl}}{{{d{{b{c}}}}e}{{`{{Gd{}{{Gb{{Dn{{d{c}}Fh}}}}}}}}}{jl}{{Fn{c}}}}{{{d{{Bf{c}}}}{d{{Bf{c}}}}}{{Cb{Bn}}}Gf}{{{d{Bh}}{d{Bh}}}{{Cb{Bn}}}}{{{d{Ab}}{d{Ab}}}{{Cb{Bn}}}}{{{d{Ad}}{d{Ad}}}{{Cb{Bn}}}}{{{d{Af}}{d{Af}}}{{Cb{Bn}}}}{{{d{{Bj{c}}}}{d{{Bj{c}}}}}{{Cb{Bn}}}Gf}{{{d{n}}{d{n}}}{{Cb{Bn}}}}{{{d{Ah{b{c}}}}{d{Ff}}}{{G`{c}}}{jl}}{{{d{Ah{b{c}}}}Fh{d{Fj}}}{{Cb{{d{c}}}}}{jl}}{{{d{{b{c}}}}{d{Ff}}e}{{Dn{GhGh}}}{jl}{{Fn{c}}}}`{{{d{Bh}}c}ClGj}{{{d{Ab}}c}ClGj}{{{d{Ad}}c}ClGj}{{{d{Af}}c}ClGj}{{{d{n}}c}ClGj}`{{{d{{b{c}}}}{d{c}}}{{Cb{{d{Fd}}}}}{jl}}`{nc{}}{{{d{c}}}e{}{}}00000000{nAn}{{{d{c}}}Gl{}}{c{{Cl{e}}}{}{}}00000000000000000`{{{d{{b{c}}}}Fh}{{Cb{{Dn{{d{c}}{d{Fj}}}}}}}{jl}}`{{{d{{b{c}}}}}{{`{{Gd{}{{Gb{{Dn{{d{c}}Fh{d{Fj}}}}}}}}Gn}}}{jl}}{{{d{{b{c}}}}H`}{{`{{Gd{}{{Gb{{Dn{{d{c}}Fh{d{Fj}}}}}}}}}}}{jl}}{{{d{c}}}Hb{}}00000000{D`Bh}{{{d{Ah{b{c}}}}{d{c}}}Db{jl}}{{{d{{b{c}}}}e}{{`{{Gd{}{{Gb{{Dn{{d{c}}{d{Fd}}}}}}}}j}}}{jl}{{Fn{c}}}}{ce{}{}}00000000```````{{{d{Ah{Hd{ce}}}}{Hd{ce}}}AlA`Aj}{{{d{Ah{Hf{ce}}}}E`C`}{{Hd{c}}}{EdA`}Hh}{{{d{Ah{Hf{ce}}}}{d{E`}}C`}{{Hd{c}}}{EdA`}Hh}{{{d{Ah{Hh{}{{Hj{c}}}}}}c}Al{}}{{{d{Ah{Hf{ce}}}}{Hd{c}}}AlA`Hh}{{{d{Ah{Hf{ce}}}}{Hl{c}}}{{Hd{c}}}A`Hh}{{{d{Ah{Hf{ce}}}}i}{{Hd{c}}}A`Hh{{Hn{}{{Gb{c}}}}}{{Hn{}{{Gb{{Dn{{d{Ff}}g}}}}}}}}{{{d{Ah{Hf{ce}}}}g}{{Hd{c}}}A`Hh{{Hn{}{{Gb{{Dn{{d{Ff}}D`}}}}}}}}{{{d{Ah{Hf{ce}}}}g}{{Hd{c}}}A`Hh{{Hn{}{{Gb{{Dn{FfD`}}}}}}}}{{{d{c}}}{{d{e}}}{}{}}0{{{d{Ahc}}}{{d{Ahe}}}{}{}}0{{{d{{Hd{ce}}}}}{{Hd{ce}}}jj}{{{d{c}}{d{Ahe}}}Al{}{}}{{}{{Hf{ce}}}{}I`}{{}{{Hd{ce}}}{}I`}{c{{Cl{{Hd{eg}}}}}Cn{lIb}Ib}{{{d{{Hd{ce}}}}{d{{Hd{ce}}}}}DbDdDd}{{{d{{Hf{ce}}}}{d{AhDf}}}DhDjDj}{{{d{{Hd{ce}}}}{d{AhDf}}}DhDjDj}{cc{}}{{{Id{c}}}{{Hd{ce}}}{}I`}1{{{If{c}}}{{Hd{e{If{c}}}}}{}{}}{{{d{{Hf{ce}}}}}{{d{{Hl{c}}}}}{}{}}``{{{d{Ah{Hh{}{{Hj{c}}}}}}{d{Ff}}}c{}}{{{d{Ah{Hh{}{{Hj{c}}}}}}Fh{d{Fj}}}c{}}`{{{d{{Hh{}{{Hj{c}}}}}}}c{}}{{{d{{Hf{ce}}}}}{{Hd{c}}}A`Hh}{{{d{Ah{Hf{ce}}}}H`c}{{Hd{c}}}A`Hh}{{{d{Ah{Hf{ce}}}}H`D`}{{Hd{c}}}A`Hh}{{{d{Ah{Hf{ce}}}}Ff}{{Hd{c}}}A`Hh}{{{d{Ah{Hf{ce}}}}FhFj}{{Hd{c}}}A`Hh}{ce{}{}}0{{{d{{Hd{ce}}}}}DbA`Aj}{{{d{{Hh{}{{Hj{c}}}}}}{d{Ff}}}Db{}}{c{{Hf{ec}}}{}{}}{{{d{{Hd{ce}}}}g}Cl{lIh}IhGj}{{{d{c}}}e{}{}}{c{{Cl{e}}}{}{}}000{{{d{c}}}Hb{}}077```{{IjIj}Ij}{{{d{{Il{c}}}}}{{h{c{Bl{{Cf{Cd}}}}}}}{jlDj}}{{{d{Ah{If{c}}}}{If{c}}}All}{{{d{Ah{Il{c}}}}{If{c}}}Al{jlDj}}{{{d{Ah{Il{c}}}}e}Al{jlDj}{}}{{{d{c}}}{{d{e}}}{}{}}00{{{d{Ahc}}}{{d{Ahe}}}{}{}}00{{{d{{If{c}}}}}{{If{c}}}j}{{{d{{Il{c}}}}}{{Il{c}}}j}{{{d{Ij}}}Ij}{{{d{c}}{d{Ahe}}}Al{}{}}00`{{}{{If{c}}}{}}{{}{{Il{c}}}{}}{{}Ij}{c{{Cl{{If{e}}}}}Cn{lIb}}{c{{Cl{Ij}}}Cn}{{{d{{If{c}}}}{d{{If{c}}}}}DbDd}{{{d{Ij}}{d{Ij}}}Db}{{{d{{If{c}}}}{d{AhDf}}}DhDj}{{{d{{Il{c}}}}{d{AhDf}}}DhDj}{{{d{Ij}}{d{AhDf}}}Dh}0{cc{}}00{{{d{{Il{c}}}}{d{c}}}{{Cb{{d{{Cf{Cd}}}}}}}{jlDj}}`{{{d{{Il{c}}}}{d{Fd}}}{{Cb{{Dn{cC`}}}}}{jlDj}}{{{d{Ah{Il{c}}}}{d{Ff}}}e{jlDj}{}}{{{d{Ah{Il{c}}}}Fh{d{Fj}}}e{jlDj}{}}{{{d{{Il{c}}}}}e{jlDj}{}}{{{d{{Il{c}}}}}{{d{{b{{Dn{nC`}}}}}}}{jlDj}}{{{d{Ah{Il{c}}}}c{Cf{Cd}}}{{If{c}}}{jlDj}}{ce{}{}}00{{{d{{If{c}}}}}Dbl}{{{d{{Il{c}}}}{d{Ff}}}Db{jlDj}}{{{d{{Il{c}}}}cC`}Db{jlDj}}{{{d{{Il{c}}}}{d{c}}}{{`{{Gd{}{{Gb{{Dn{C`Fh}}}}}}}}}{jlDj}}{{{d{{Il{c}}}}e}{{`{{Gd{}{{Gb{{Dn{{d{c}}C`Fh}}}}}}}}}{jlDj}{{Fn{c}}}}{{{d{{Il{c}}}}}{{`{{Gd{}{{Gb{{Dn{{d{c}}{d{{Cf{Cd}}}}}}}}}}Gn}}}{jlDj}}``{{{d{{Il{c}}}}{d{c}}}{{Cb{C`}}}{jlDj}}{{{d{{Il{c}}}}}{{h{cC`}}}{jlDj}}10{{{d{{Il{c}}}}}C`{jlDj}}{{{d{Ah{Il{c}}}}{d{c}}C`}Al{jlDj}}{{{d{Ah{Il{c}}}}cC`}Db{jlDj}}{{{d{{Il{c}}}}{d{Ff}}e}Fl{jlDj}{{Fn{c}}}}{C`{{Il{c}}}{}}{{{d{{Il{c}}}}{d{c}}}{{Cb{{Dn{C`Db}}}}}{jlDj}}{{{d{Ah{Il{c}}}}{d{c}}}{{Cb{{Dn{{Dn{C`{d{Fd}}}}{If{c}}}}}}}{jlDj}}{{{d{{Il{c}}}}}{{`{{Gd{}{{Gb{{Dn{{Dn{cC`}}Fh}}}}}}}}}{jlDj}}1{{{d{Ah{Il{c}}}}{d{c}}C`}{{Cb{{Dn{{Bl{{Cf{Cd}}}}{If{c}}}}}}}{jlDj}}{{{d{Ah{Il{c}}}}{d{{h{cC`}}}}}{{Dn{{h{c{Bl{{Cf{Cd}}}}}}{If{c}}}}}{jlDj}}{{{d{{Il{c}}}}{d{c}}}{{`{{Gd{}{{Gb{{Dn{C`{d{Fd}}}}}}}}}}}{jlDj}}{{{d{{Il{c}}}}e}{{`{{Gd{}{{Gb{{Dn{{d{c}}C`{d{Fd}}}}}}}}j}}}{jlDj}{{Fn{c}}}}{{{d{{Il{c}}}}{d{Ff}}e}{{Dn{GhGh}}}{jlDj}{{Fn{c}}}}{{{d{{If{c}}}}e}Cl{lIh}Gj}{{{d{Ij}}c}ClGj}{{{d{{Il{c}}}}cC`}{{Cb{{d{Fd}}}}}{jlDj}}{{{d{c}}}e{}{}}00{{{d{c}}}Gl{}}{{{d{Ij}}}Gh}`0{c{{Cl{e}}}{}{}}00000{{{d{{Il{c}}}}Fh}{{Cb{{Dn{cC`{d{Fj}}}}}}}{jlDj}}{{{d{{Il{c}}}}}{{`{{Gd{}{{Gb{{Dn{cC`Fh{d{Fj}}}}}}}}}}}{jlDj}}{{{d{{Il{c}}}}H`}{{`{{Gd{}{{Gb{{Dn{cC`Fh{d{Fj}}}}}}}}}}}{jlDj}}{{{d{c}}}Hb{}}00{{{d{{Il{c}}}}{d{c}}}{{Cb{{Bl{{Cf{Cd}}}}}}}{jlDj}}{{{d{Ah{Il{c}}}}cC`}Db{jlDj}}`{{{d{{Il{c}}}}{d{c}}}{{`{{Gd{}{{Gb{{Dn{C`{d{Fd}}}}}}}}j}}}{jlDj}}{{{d{{Il{c}}}}}{{`{{Gd{}{{Gb{{Dn{cC`{d{Fd}}}}}}}}j}}}{jlDj}}{ce{}{}}00``````````{{{d{AhIn}}{d{J`}}}{{Cl{AlJb}}}}{{{d{AhIn}}{d{Jd}}C`}{{Cl{J`Jf}}}}{{{d{AhIn}}{d{Jd}}C`Ab}{{Cl{J`Jh}}}}{{{d{AhIn}}Jj}{{Cl{J`Jf}}}}{{{d{Jj}}}Ab}{{{d{c}}}{{d{e}}}{}{}}000000{{{d{Ahc}}}{{d{Ahe}}}{}{}}000000{{{d{Jj}}}Jj}{{{d{In}}}In}{{{d{Jb}}}Jb}{{{d{Jl}}}Jl}{{{d{Jf}}}Jf}{{{d{Jh}}}Jh}{{{d{c}}{d{Ahe}}}Al{}{}}00000{{{d{AhIn}}Ab}{{Cl{J`Jb}}}}{{{d{Jj}}{d{Jj}}}Db}{{{d{In}}{d{In}}}Db}{{{d{Jb}}{d{Jb}}}Db}{{{d{Jl}}{d{Jl}}}Db}{{{d{Jf}}{d{Jf}}}Db}{{{d{Jh}}{d{Jh}}}Db}{{Jjc}{{Cl{JjJj}}}{{Hn{}{{Gb{Ab}}}}}}{{{d{Jj}}{d{AhDf}}}Dh}{{{d{In}}{d{AhDf}}}Dh}{{{d{Jb}}{d{AhDf}}}Dh}0{{{d{Jl}}{d{AhDf}}}Dh}0{{{d{Jf}}{d{AhDf}}}Dh}0{{{d{Jh}}{d{AhDf}}}Dh}0{cc{}}000000{c{{Cl{Jj{Cb{Jj}}}}}{{Hn{}{{Gb{Ab}}}}}}{{{h{C`Dl}}}{{Cl{InJb}}}}{J`{{Cl{InJb}}}}{Dl{{Dn{InJ`}}}}{{{d{Jd}}C`}Jj}{Jj{{Cl{InJb}}}}{{{d{In}}}Dl}{{{d{Jj}}C`}{{Cb{Jj}}}}{{{d{In}}C`}{{Cb{Jj}}}}{{{d{In}}}{{Cl{Abc}}}{}}{{{d{Jj}}}Dl}{{{d{Jj}}}C`}`{{{d{In}}}J`}{{JjAb}Jj}{{{d{AhIn}}Ab}{{Cl{J`Jl}}}}{ce{}{}}0000000{Jjc{}}{{{d{In}}AbAb}{{Cl{{Cb{Db}}c}}}{}}{{{d{Jj}}}Jn}{{{d{In}}}Jn}{AbJj}{{{d{AhJn}}}{{Cb{c}}}{}}`{{{d{Jj}}}{{Cb{Jj}}}}{{JjAb}{{Cl{JjJj}}}}{{{d{Jj}}c}{{`{{K`{}{{Gb{Jj}}}}}}}{{Fn{C`}}}}{{{d{In}}c}{{`{{K`{}{{Gb{Jj}}}}}}}{{Fn{C`}}}}{{{d{In}}}Jj}{{{d{c}}}e{}{}}00000{{{d{c}}}Gl{}}000{c{{Cl{e}}}{}{}}000000`0000000{{{d{c}}}Hb{}}000000`???????`````{{{d{c}}}{{d{e}}}{}{}}000{{{d{Ahc}}}{{d{Ahe}}}{}{}}000{{Kb{d{{Hl{c}}}}}Kb{}}{{{Kd{c}}{d{{Hl{e}}}}}{{Kd{c}}}{lj}{}}{{Kbe}Kb{{Kh{{Kf{Ff}}}}}{{Hn{}{{Gb{{Dn{H`c}}}}}}}}{{{Kd{c}}g}{{Kd{c}}}{lj}{{Kh{{Kf{Ff}}}}}{{Hn{}{{Gb{{Dn{H`e}}}}}}}}{{Kbe}Kb{{Gn{}{{Gb{Fh}}}}Kj}{{Hn{}{{Kl{c}}{Gb{Fh}}}}}}{{Kbe}Kb{{Gn{}{{Gb{f}}}}Kj}{{Hn{}{{Kl{c}}{Gb{f}}}}}}{{{Kd{c}}cg}{{Kd{c}}}{lj}{{K`{}{{Gb{{Dn{C`f}}}}}}Kj}{{Hn{}{{Kl{e}}}}}}``{{Kbe}Kb{{Gn{}{{Gb{H`}}}}Kj}{{Hn{}{{Kl{c}}{Gb{H`}}}}}}``{cc{}}000{JjKb}{Jj{{Kd{c}}}{lj}}{{Jj{d{{Il{c}}}}}{{Kd{c}}}{Djlj}}``{{Kbc}Kb{{Kn{{d{Fh}}}}KjL`}}{{Kbc}Kb{{Kn{{d{Fd}}}}KjL`}}{{{Kd{c}}e}{{Kd{c}}}{Kjlj}{{Kn{cC`{d{Fd}}}}KjL`j}}{{{Kd{c}}ce}{{Kd{c}}}{Kjlj}{{Kn{C`{d{Fd}}}}KjL`}}{{Kbc}Kb{{Kn{{d{H`}}}}KjL`}}{ce{}{}}000``{{Kb{d{{Il{c}}}}e}Kb{jlDjKjL`}{{Fn{c}}}}{{Kbe}Kb{{Gn{}{{Gb{Fh}}}}Kj}{{Hn{}{{Kl{c}}}}}}{{Kbe}Kb{{Gn{}{{Gb{f}}}}Kj}{{Hn{}{{Kl{c}}}}}}>{{Kbe}Kb{{Gn{}{{Gb{H`}}}}Kj}{{Hn{}{{Kl{c}}}}}}``{c{{Cl{e}}}{}{}}0000000```{{{d{c}}}Hb{}}0006666`````````{{{d{{Hl{c}}}}}{{d{{G`{{Dn{cH`}}}}}}}{}}{{{d{{Hl{c}}}}}{{`{{K`{}{{Gb{{Dn{Fh{d{Fj}}}}}}}}}}}{}}{{{d{{Id{c}}}}}{{`{{K`{}{{Gb{C`}}}}}}}A`}``{{{d{Ah{Id{c}}}}{Id{c}}}All}{{{d{Ah{Hl{c}}}}{Id{c}}}Al{jl}}{{{d{Ah{Hl{c}}}}{Hl{c}}}{{Id{c}}}{jl}}{{{d{{Hl{c}}}}}{{d{{Hl{c}}}}}{}}{{{d{{Hl{c}}}}{d{e}}Abik}IjA`{{El{}{{Ej{Lb}}}}}j{{Hn{}{{Gb{{Dn{gFh}}}}}}}{{Kn{{d{g}}{d{Fd}}}{{Ld{Db}}}}}}{{{d{Ah{Hl{c}}}}e}{{Id{c}}}{jl}{{Hn{}{{Gb{{Dn{FfD`}}}}}}}}{{{d{c}}}{{d{e}}}{}{}}000000{{{d{Ahc}}}{{d{Ahe}}}{}{}}000000{{{d{{Hl{c}}}}{d{Ff}}}{{Cl{GhLf}}}{}}`{c{{Cb{Fl}}}{}}{c{{Cb{Gh}}}{}}01{{{d{{Hl{c}}}}}{{Hl{c}}}j}{{{d{{Lh{ce}}}}}{{Lh{ce}}}jj}{{{d{{Lj{ce}}}}}{{Lj{ce}}}jj}{{{d{{Id{c}}}}}{{Id{c}}}j}{{{d{c}}{d{Ahe}}}Al{}{}}000{{{d{{Lh{ce}}}}{d{{Lh{ce}}}}}Bnll}{{{d{{Lj{ce}}}}{d{{Lj{ce}}}}}Bnll}{{}{{Hl{c}}}{}}{{}{{Id{c}}}{}}{{{d{{Lh{ce}}}}}{{d{g}}}{}{}{}}{c{{Cl{{Id{e}}}}}Cn{lIb}}{{{d{{Hl{c}}}}{d{Ff}}}{{`{{K`{}{{Gb{{Dn{EbH`}}}}}}}}}{}}{{{d{{Hl{c}}}}{d{{Hl{c}}}}}DbDd}{{{d{{Lh{ce}}}}{d{{Lh{ce}}}}}DbDdDd}{{{d{{Lj{ce}}}}{d{{Lj{ce}}}}}DbDdDd}{{{d{Lf}}{d{Lf}}}Db}{{{d{{Id{c}}}}{d{{Id{c}}}}}DbDd}{{{d{{Hl{c}}}}{d{e}}Abi}{{`{{K`{}{{Gb{{Dn{g{Bj{c}}}}}}}}}}}A`{{El{}{{Ej{Lb}}}}}j{{Hn{}{{Gb{{Dn{gFh}}}}}}}}0{{{d{{Hl{c}}}}}{{`{{K`{}{{Gb{{Dn{Fh{d{Fj}}}}}}}}}}}{}}{{{d{{Hl{c}}}}{d{AhDf}}}DhDj}{{{d{{Lh{ce}}}}{d{AhDf}}}DhDjDj}{{{d{{Lj{ce}}}}{d{AhDf}}}DhDjDj}{{{d{Lf}}{d{AhDf}}}Dh}0{{{d{{Id{c}}}}{d{AhDf}}}DhDj}{cc{}}000000{{{d{{Hl{c}}}}}{{`{{K`{}{{Gb{{Lh{{Kf{Ff}}c}}}}}}}}}{}}{{{d{{Hl{c}}}}{d{e}}AbH`}{{Cb{{Bf{{d{c}}}}}}}A`{{El{}{{Ej{Lb}}}}}}{{{d{{Hl{c}}}}{d{e}}AbFh}{{Cb{{Dn{{Bf{{d{c}}}}H`}}}}}A`{{El{}{{Ej{Lb}}}}}}{{{d{{Hl{c}}}}H`}{{Cb{{Kf{Ff}}}}}{}}{{{d{{Hl{c}}}}H`}{{Cb{{Lh{{Kf{Ff}}c}}}}}{}}{{{d{{Hl{c}}}}Fh}{{Cb{{d{Fj}}}}}{}}{{{d{{Hl{c}}}}}{{Id{c}}}{jl}}{{{d{Ah{Hl{c}}}}H`c}{{Id{c}}}{jl}}{{{d{Ah{Hl{c}}}}H`D`}{{Id{c}}}{jl}}{{{d{Ah{Hl{c}}}}e}{{Id{c}}}{jl}{{Kh{{Kf{Ff}}}}}}{{{d{Ah{Hl{c}}}}FhFj}{{Id{c}}}{jl}}{ce{}{}}00000000{{{d{{Hl{c}}}}}Db{}}{{{d{{Id{c}}}}}Dbl}``{{{d{{Hl{c}}}}{d{e}}Ab}{{`{{K`{}{{Gb{{Lj{{Kf{Ff}}c}}}}}}}}}A`El}{{{Hl{c}}g}{{Hl{e}}}{jl}{jl}{{Kn{c}{{Ld{e}}}}}}{{{Id{c}}g}{{Id{e}}}ll{{Kn{c}{{Ld{e}}}}}}{c{{Hl{e}}}{{Hn{}{{Gb{Ff}}}}}{jl}}{{{d{Ah{Ll{cg}}}}}{{Cb{i}}}{}{}{{Kn{Eb{Kf{Ff}}}{{Ld{{Cb{e}}}}}}}{}}{{{d{Ah{Ln{cg}}}}}{{Cb{i}}}{}{}{{Kn{EbH`}{{Ld{{Cb{e}}}}}}}{}}{{{d{{Hl{c}}}}Fh}{{d{{M`{H`}}}}}{}}{{{d{{Lh{ce}}}}{d{{Lh{ce}}}}}{{Cb{Bn}}}GfGf}{{{d{{Lj{ce}}}}{d{{Lj{ce}}}}}{{Cb{Bn}}}GfGf}{{{d{{Id{c}}}}e}Cl{lIh}Gj}{{{d{c}}}e{}{}}000{{{d{c}}}Gl{}}{{{d{{Hl{c}}}}{d{e}}Abik}{{Cl{Ij}}}A`Elj{{Hn{}{{Gb{{Dn{gFh}}}}}}}{{Kn{{d{g}}{d{Fd}}}{{Ld{Db}}}}}}{{{d{{Hl{c}}}}{d{e}}Abi}{{`{{K`{}{{Gb{{Cl{{Dn{g{Bj{c}}}}}}}}}}}}}A`Elj{{Hn{}{{Gb{{Dn{gFh}}}}}}}}0{c{{Cl{e}}}{}{}}000000{{{d{{Hl{c}}}}{d{e}}AbH`}{{Cl{{Cb{{Bf{{d{c}}}}}}}}}A`El}{{{d{{Hl{c}}}}{d{e}}AbFh}{{Cl{{Cb{{Dn{{Bf{{d{c}}}}H`}}}}}}}A`El}2222222{{{d{{Hl{c}}}}{d{e}}Ab}{{`{{K`{}{{Gb{{Cl{{Lj{{Kf{Ff}}c}}}}}}}}}}}A`El}``{{{d{{Hl{c}}}}H`}{{Cb{{h{C`{d{Fj}}}}}}}{}}{{{d{{Hl{c}}}}H`}{{`{{Gd{}{{Gb{{Dn{C`{d{{M`{H`}}}}}}}}}}}}}{}}`{{{d{{Id{c}}}}}{{`{{K`{}{{Gb{{Dn{Fh{d{Fj}}}}}}}}}}}{}}``{{{d{c}}}Hb{}}000000{{{d{Ah{Hl{c}}}}D`}{{Id{c}}}{jl}}{ce{}{}}000000{{{d{{Hl{c}}}}ei}{{Ll{ci}}}{jl}{{Kh{{Kf{Ff}}}}}{}{{Kn{Eb{Kf{Ff}}}{{Ld{{Cb{g}}}}}}}}{{{d{{Hl{c}}}}{d{Ff}}g}{{Ln{cg}}}{}{}{{Kn{EbH`}{{Ld{{Cb{e}}}}}}}}{{{d{{Hl{c}}}}H`g}{{Ln{cg}}}{jl}{}{{Kn{EbH`}{{Ld{{Cb{e}}}}}}}}","D":"BMj","p":[[5,"SpkTxOutIndex",0,804],[1,"reference"],[5,"ScriptBuf",805],[5,"BTreeMap",806],[10,"Clone",807],[10,"Ord",808],[5,"DescriptorId",0,809],[10,"Anchor",0,810],[5,"BlockId",0,811],[5,"ConfirmationHeightAnchor",0,811],[5,"ConfirmationTimeHeightAnchor",0,811],[0,"mut"],[10,"Append",0,810],[1,"unit"],[5,"Hash",812],[1,"u8"],[1,"slice"],[1,"array"],[6,"ChainPosition",0,811],[6,"ConfirmationTime",0,811],[5,"FullTxOut",0,811],[5,"SpkIterator",0,813],[6,"Ordering",808],[1,"u32"],[6,"Option",814],[6,"DescriptorPublicKey",815],[6,"Descriptor",816],[10,"Borrow",817],[10,"DescriptorExt",0,809],[6,"Result",818],[10,"Deserializer",819],[1,"u64"],[1,"bool"],[10,"PartialEq",808],[5,"Formatter",820],[8,"Result",820],[10,"Debug",820],[5,"BlockHash",821],[1,"tuple"],[5,"Block",822],[1,"usize"],[10,"AnchorFromBlockPosition",0,810],[5,"FromSliceError",823],[1,"str"],[17,"Error"],[10,"ChainOracle",0,824],[10,"Hash",825],[10,"Hasher",825],[10,"SliceIndex",826],[5,"Script",827],[5,"Transaction",828],[5,"OutPoint",828],[5,"TxOut",828],[5,"SignedAmount",829],[10,"RangeBounds",830],[5,"BTreeSet",831],[17,"Item"],[10,"DoubleEndedIterator",832],[10,"PartialOrd",808],[5,"Amount",829],[10,"Serializer",833],[5,"String",834],[10,"ExactSizeIterator",835],[5,"Txid",821],[5,"TypeId",836],[5,"ChangeSet",272],[5,"IndexedTxGraph",272],[10,"Indexer",272],[17,"ChangeSet"],[5,"TxGraph",643],[10,"IntoIterator",837],[10,"Default",838],[10,"Deserialize",819],[5,"ChangeSet",643],[5,"ChangeSet",328,839],[10,"Serialize",833],[5,"Balance",328],[5,"KeychainTxOutIndex",328,839],[5,"LocalChain",430],[8,"ChangeSet",430],[5,"MissingGenesisError",430],[5,"Header",822],[5,"CannotConnectError",430],[6,"ApplyHeaderError",430],[5,"CheckPoint",430],[5,"AlterCheckPointError",430],[5,"CheckPointIter",430],[10,"Iterator",840],[5,"SyncRequest",572],[5,"FullScanRequest",572],[5,"Arc",841],[10,"Into",842],[10,"Send",843],[17,"IntoIter"],[10,"FnMut",844],[10,"Sync",843],[6,"Infallible",842],[17,"Output"],[6,"CalculateFeeError",643],[5,"TxNode",643],[5,"CanonicalTx",643],[5,"TxAncestors",643],[5,"TxDescendants",643],[5,"HashSet",845],[15,"Confirmed",269],[15,"Unconfirmed",269],[5,"SyncResult",572],[5,"FullScanResult",572]],"r":[[0,810],[1,810],[2,810],[3,813],[4,811],[6,824],[7,811],[8,811],[9,811],[10,811],[13,809],[14,809],[16,811],[17,272],[18,813],[19,804],[20,643],[329,839],[330,839]],"b":[[35,"impl-AsRef%3C%5Bu8%5D%3E-for-DescriptorId"],[36,"impl-AsRef%3C%5Bu8;+%3C%24hash+as+%24crate::Hash%3E::LEN%5D%3E-for-DescriptorId"],[119,"impl-Debug-for-DescriptorId"],[120,"impl-UpperHex-for-DescriptorId"],[121,"impl-LowerHex-for-DescriptorId"],[122,"impl-Display-for-DescriptorId"],[127,"impl-From%3C(u32,+BlockHash)%3E-for-BlockId"],[128,"impl-From%3C(%26u32,+%26BlockHash)%3E-for-BlockId"],[298,"impl-From%3CChangeSet%3CA%3E%3E-for-ChangeSet%3CA,+IA%3E"],[300,"impl-From%3CChangeSet%3CK%3E%3E-for-ChangeSet%3CA,+ChangeSet%3CK%3E%3E"],[334,"impl-KeychainTxOutIndex%3CK%3E"],[335,"impl-Indexer-for-KeychainTxOutIndex%3CK%3E"],[358,"impl-Display-for-Balance"],[359,"impl-Debug-for-Balance"],[481,"impl-Display-for-MissingGenesisError"],[482,"impl-Debug-for-MissingGenesisError"],[483,"impl-Display-for-AlterCheckPointError"],[484,"impl-Debug-for-AlterCheckPointError"],[485,"impl-Debug-for-CannotConnectError"],[486,"impl-Display-for-CannotConnectError"],[487,"impl-Debug-for-ApplyHeaderError"],[488,"impl-Display-for-ApplyHeaderError"],[709,"impl-Display-for-CalculateFeeError"],[710,"impl-Debug-for-CalculateFeeError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAALcBSAASAAAAFQAAABkAAAAbAAIAIQABACQAFQA7ABEATgAGAFoAAQBdAAMAYwAEAGkAEgB/AAIAhwAAAIoABACQAAIAlAAFAJwAAACeAAEAoQAAAKwAAAC1AAAAugAAAL4AAQDDAAYAzQAFANYACQDhABIA+QAIAAUBCAAVAQAAHgELACsBAAAtAQAAPAEAAD8BCQBMAQAAUAEMAF4BCgBvAQIAeAEAAJEBAQCUAQMAmwEFAKQBAgCsAQIAvgEZANkBBQDgAQkA+gEAAAgCAgAOAgAAFQIQACcCDQA2AgYAQgIHAHECBwB8AgcAkgIAAJUCAACYAg0AqAIRALsCBADDAgUA4gIBAOUCAADsAgEA7wIHAPoCBgADAwYAEwMGABsDBgA="}],\ +["bdk_chain",{"t":"KKKSFSKGFGFPPKFRFEFFEPPNNMNNNOOMNNNNNENNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNONNNNNMNNNNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNMNNNNNNOONNNNCNNNNNNNNNNNNMNNNMNONNNCCNENNNNNONNNNNNNNNNNNDNNNNNONCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNONNNNNNNNNNNNNNNNNNNNNNNOOOFRFKNNNMNNNNNNNNNNNNNNNNNNNNNNNOOMMOMNNNNNNNNMNNNNNNNNNNNFFFNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNONNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNONNNNNFGPFIFFPFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNONNNNNNNFFFFNNNNNNNNNNNOONOONNNNNNNOONNNNNNNNNOONNNNNOONNNNNNNNONNNNNNNNGFFPPFFFFNNNOONNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNONOONNNNNNNNNNNNNNNNNN","n":["Anchor","AnchorFromBlockPosition","Append","BIP32_MAX_INDEX","BlockId","COINBASE_MATURITY","ChainOracle","ChainPosition","ConfirmationHeightAnchor","ConfirmationTime","ConfirmationTimeHeightAnchor","Confirmed","Confirmed","DescriptorExt","DescriptorId","Error","FullTxOut","IndexedTxGraph","SpkIterator","SpkTxOutIndex","TxGraph","Unconfirmed","Unconfirmed","all_spks","all_zeros","anchor_block","anchor_block","anchor_block","anchor_block","anchor_block","anchor_block","append","apply_changeset","as_byte_array","as_raw_hash","as_ref","as_ref","bitcoin","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","chain_position","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","cloned","cmp","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","descriptor_id","deserialize","deserialize","deserialize","deserialize","deserialize","dust_value","engine","eq","eq","eq","eq","eq","eq","eq","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_block_position","from_block_position","from_block_position","from_block_position","from_byte_array","from_engine","from_raw_hash","from_slice","from_slice_delegated","from_str","get_chain_tip","hash","hash","hash","hash","hash","hash","hash","height","index","index_of_spk","index_tx","index_txout","indexed_tx_graph","initial_changeset","insert_spk","into","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","partial_cmp","scan","scan_txout","sent_and_received","serde","serialize","serialize","serialize","serialize","serialize","spent_by","spk_at_index","spk_client","to_byte_array","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_raw_hash","to_string","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","tx_graph","txout","txout","txouts","txouts_in_tx","type_id","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","vzip","height","last_seen","time","ChangeSet","ChangeSet","IndexedTxGraph","Indexer","append","apply_block","apply_block_relevant","apply_changeset","apply_changeset","apply_update","as_ref","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","all_unbounded_spk_iters","append","apply_changeset","apply_changeset","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","get_descriptor","immature","index_of_spk","index_tx","index_txout","initial_changeset","inner","insert_descriptor","into","into","into","is_empty","is_tx_relevant","is_used","keychain_outpoints","keychain_outpoints_in_range","keychains","keychains_added","last_revealed","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","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","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":[[0,"bdk_chain"],[269,"bdk_chain::ConfirmationTime"],[272,"bdk_chain::indexed_tx_graph"],[329,"bdk_chain::keychain"],[431,"bdk_chain::local_chain"],[573,"bdk_chain::spk_client"],[637,"bdk_chain::tx_graph"],[798,"bdk_chain::spk_txout_index"],[799,"bitcoin::blockdata::script::owned"],[800,"alloc::collections::btree::map"],[801,"core::clone"],[802,"core::cmp"],[803,"bdk_chain::descriptor_ext"],[804,"bdk_chain::tx_data_traits"],[805,"bdk_chain::chain_data"],[806,"bitcoin_hashes::sha256"],[807,"bdk_chain::spk_iter"],[808,"core::option"],[809,"miniscript::descriptor::key"],[810,"miniscript::descriptor"],[811,"core::borrow"],[812,"core::result"],[813,"serde::de"],[814,"core::fmt"],[815,"bitcoin::hash_types::newtypes"],[816,"bitcoin::blockdata::block"],[817,"bitcoin_hashes"],[818,"bdk_chain::chain_oracle"],[819,"core::hash"],[820,"core::slice::index"],[821,"bitcoin::blockdata::script::borrowed"],[822,"bitcoin::blockdata::transaction"],[823,"bitcoin::amount"],[824,"core::ops::range"],[825,"alloc::collections::btree::set"],[826,"core::iter::traits::double_ended"],[827,"serde::ser"],[828,"alloc::string"],[829,"core::iter::traits::exact_size"],[830,"core::any"],[831,"core::iter::traits::collect"],[832,"core::default"],[833,"bdk_chain::keychain::txout_index"],[834,"core::iter::traits::iterator"],[835,"core::marker"],[836,"core::ops::function"],[837,"core::convert"],[838,"alloc::sync"],[839,"std::collections::hash::set"]],"i":[0,0,0,0,0,0,0,0,0,0,0,19,20,0,0,46,0,0,0,0,0,19,20,1,7,8,9,10,11,10,11,13,1,7,7,7,7,0,1,19,20,9,10,11,21,7,7,22,1,19,20,9,10,11,21,7,22,21,1,19,20,9,10,11,21,7,22,1,19,20,9,10,11,21,7,22,19,19,20,9,10,11,21,7,10,11,8,8,19,10,11,11,1,9,10,11,22,29,20,9,10,11,7,29,7,19,20,9,10,11,21,7,1,19,20,9,10,11,21,7,7,7,7,1,19,20,20,9,9,9,10,11,21,7,7,22,42,9,10,11,7,7,7,7,7,7,46,19,20,9,10,11,7,9,9,7,1,1,1,0,1,1,1,19,20,9,10,11,21,7,22,22,46,19,20,21,13,21,21,1,1,1,0,0,1,0,1,22,22,22,22,21,1,1,19,20,9,10,11,21,7,1,1,1,0,20,9,10,11,7,21,1,0,7,1,19,20,9,10,11,21,7,22,7,7,1,19,20,9,10,11,21,7,22,1,19,20,9,10,11,21,7,22,0,1,21,1,1,1,19,20,9,10,11,21,7,22,20,1,1,1,19,20,9,10,11,21,7,22,105,106,105,0,68,0,0,66,67,67,68,67,67,67,67,67,67,67,66,67,66,66,66,67,66,66,66,67,66,67,66,66,66,67,66,67,68,68,66,68,67,67,67,67,67,67,66,66,68,67,66,66,67,66,67,66,67,66,67,66,0,0,0,77,78,75,78,78,75,78,77,75,78,77,75,78,77,75,78,77,77,75,78,77,75,77,75,77,75,78,77,77,75,78,77,78,77,78,78,78,78,78,78,75,78,77,75,78,78,78,78,78,75,75,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,75,77,78,75,78,77,77,77,77,77,75,78,77,75,78,77,78,78,78,75,78,77,78,78,77,78,78,75,78,77,0,0,84,0,0,0,0,84,0,0,79,79,79,79,85,87,85,79,81,86,83,84,87,85,79,81,86,83,84,85,79,81,86,83,84,85,79,81,86,83,84,79,85,79,81,86,83,84,85,85,79,81,81,86,86,83,83,84,84,87,85,79,81,86,83,84,85,79,79,79,85,79,79,85,79,79,85,85,86,79,85,79,87,85,79,81,86,83,84,87,85,79,85,79,85,87,86,85,85,85,79,79,85,79,81,86,83,84,81,86,83,84,87,85,79,81,86,83,84,83,87,85,79,81,86,83,84,87,85,79,81,86,83,84,86,87,85,79,81,86,83,84,0,0,0,0,89,107,92,108,89,107,92,108,89,89,92,89,92,89,107,108,89,107,92,108,89,92,92,107,108,89,89,92,92,89,89,107,92,108,108,89,89,89,89,92,89,89,92,89,107,92,108,89,107,92,108,89,89,107,92,108,89,107,92,108,0,0,0,97,97,0,0,0,0,70,70,74,98,74,74,70,70,70,70,70,102,103,70,98,99,97,74,102,103,70,98,99,97,74,70,99,102,102,103,103,70,98,99,74,70,98,99,74,98,99,70,74,98,74,70,70,98,99,97,74,70,70,70,70,98,99,97,97,74,102,103,70,98,99,97,74,70,70,70,70,70,70,70,70,70,70,70,102,103,70,98,99,97,74,102,103,70,74,74,98,70,70,74,70,102,103,70,98,99,74,70,98,99,74,97,70,70,70,102,103,70,98,99,97,74,70,70,102,103,70,98,99,97,74,70,98,99,70,70,98,74,74,74,102,103,70,98,99,97,74,70,102,103,70,98,99,97,74,70,70,70],"f":"```````````````````````{{{d{{b{c}}}}}{{d{{h{cf}}}}}{jl}}{{}n}{{{d{A`}}}Ab}{{{d{Ab}}}Ab}{{{d{Ad}}}Ab}{{{d{Af}}}Ab}``{{{d{AhAj}}Aj}Al}{{{d{Ah{b{c}}}}e}Al{jl}{}}{{{d{n}}}{{d{c}}}{}}{{{d{n}}}{{d{An}}}}{{{d{n}}}{{d{{Bb{B`}}}}}}{{{d{n}}}{{d{{Bd{B`}}}}}}`{{{d{c}}}{{d{e}}}{}{}}000000020{{{d{Ahc}}}{{d{Ahe}}}{}{}}00000000`{{{d{{b{c}}}}}{{b{c}}}j}{{{d{{Bf{c}}}}}{{Bf{c}}}j}{{{d{Bh}}}Bh}={{{d{Ad}}}Ad}{{{d{Af}}}Af}{{{d{{Bj{c}}}}}{{Bj{c}}}j}{{{d{n}}}n}{{{d{{Bl{c}}}}}{{Bl{c}}}j}{{{d{c}}{d{Ahe}}}Al{}{}}00000000{{{Bf{{d{c}}}}}{{Bf{c}}}j}{{{d{{Bf{c}}}}{d{{Bf{c}}}}}Bnl}{{{d{Bh}}{d{Bh}}}Bn}{{{d{Ab}}{d{Ab}}}Bn}{{{d{Ad}}{d{Ad}}}Bn}{{{d{Af}}{d{Af}}}Bn}{{{d{{Bj{c}}}}{d{{Bj{c}}}}}Bnl}{{{d{n}}{d{n}}}Bn}``{{{d{A`}}}C`}0{{{d{{Bf{c}}}}}{{Cb{C`}}}A`}{{{d{Ad}}}C`}{{{d{Af}}}C`}`{{}{{b{c}}}{}}{{}Ab}{{}Ad}{{}Af}{{{d{{Bl{c}}}}}{{d{c}}}{{Ch{{Cf{Cd}}}}}}{{{d{Cj}}}n}{c{{Cl{Bh}}}Cn}{c{{Cl{Ab}}}Cn}{c{{Cl{Ad}}}Cn}{c{{Cl{Af}}}Cn}{c{{Cl{n}}}Cn}{{{d{Cj}}}D`}{{}c{}}{{{d{{Bf{c}}}}{d{{Bf{c}}}}}DbDd}{{{d{Bh}}{d{Bh}}}Db}{{{d{Ab}}{d{Ab}}}Db}{{{d{Ad}}{d{Ad}}}Db}{{{d{Af}}{d{Af}}}Db}{{{d{{Bj{c}}}}{d{{Bj{c}}}}}DbDd}{{{d{n}}{d{n}}}Db}{{{d{{b{c}}}}{d{AhDf}}}DhDj}{{{d{{Bf{c}}}}{d{AhDf}}}DhDj}{{{d{Bh}}{d{AhDf}}}Dh}{{{d{Ab}}{d{AhDf}}}Dh}{{{d{Ad}}{d{AhDf}}}Dh}{{{d{Af}}{d{AhDf}}}Dh}{{{d{{Bj{c}}}}{d{AhDf}}}DhDj}{{{d{n}}{d{AhDf}}}Dh}000{cc{}}0{{{Bf{Af}}}Bh}1{{{Dn{{d{C`}}{d{Dl}}}}}Ab}{{{Dn{C`Dl}}}Ab}33333{Ann}4{{{d{E`}}AbEb}Ed}{{{d{E`}}AbEb}Ab}{{{d{E`}}AbEb}Ad}{{{d{E`}}AbEb}Af}{cn{}}05{{{d{{Bb{B`}}}}}{{Cl{nEf}}}}0{{{d{Eh}}}{{Cl{nc}}}{}}{{{d{{El{}{{Ej{c}}}}}}}{{Cl{Abc}}}Dj}{{{d{{Bf{c}}}}{d{Ahe}}}AlEnF`}{{{d{Bh}}{d{Ahc}}}AlF`}{{{d{Ab}}{d{Ahc}}}AlF`}{{{d{Ad}}{d{Ahc}}}AlF`}{{{d{Af}}{d{Ahc}}}AlF`}{{{d{n}}{d{Ahc}}}AlF`}``{{{d{n}}c}{{d{e}}}{{Fb{{Bb{B`}}}}}{}}{{{d{{b{c}}}}{d{Fd}}}{{Cb{{d{c}}}}}{jl}}{{{d{Ah{b{c}}}}{d{Ff}}}e{jl}{}}{{{d{Ah{b{c}}}}Fh{d{Fj}}}e{jl}{}}`{{{d{{b{c}}}}}e{jl}{}}{{{d{Ah{b{c}}}}cf}Db{jl}}{ce{}{}}000000000{{{d{{El{}{{Ej{c}}}}}}AbAb}{{Cl{{Cb{Db}}c}}}Dj}{{{d{{Bf{c}}}}}Db{}}{{{d{Bh}}}Db}{{{d{{Bj{c}}}}C`}DbA`}{{{d{Aj}}}Db}1`{{{d{{b{c}}}}{d{Ff}}}Db{jl}}0{{{d{{b{c}}}}{d{c}}}Db{jl}}``{{{d{Ah{b{c}}}}{d{c}}}Db{jl}}`{{{d{{b{c}}}}{d{Ff}}e}Fl{jl}{{Fn{c}}}}{c{{Bl{c}}}{{Ch{{Cf{Cd}}}}}}{{ce}{{Bl{c}}}{{Ch{{Cf{Cd}}}}}{{Fn{C`}}}}{{{d{Ah{Bl{c}}}}}{{Cb{e}}}{{Ch{{Cf{Cd}}}}}{}}{{{d{Ah{Bl{c}}}}Eb}{{Cb{e}}}{{Ch{{Cf{Cd}}}}}{}}`{{{d{{b{c}}}}}{{d{{G`{{Dn{cFh}}}}}}}{jl}}{{{d{{b{c}}}}e}{{`{{Gd{}{{Gb{{Dn{{d{c}}Fh}}}}}}}}}{jl}{{Fn{c}}}}{{{d{{Bf{c}}}}{d{{Bf{c}}}}}{{Cb{Bn}}}Gf}{{{d{Bh}}{d{Bh}}}{{Cb{Bn}}}}{{{d{Ab}}{d{Ab}}}{{Cb{Bn}}}}{{{d{Ad}}{d{Ad}}}{{Cb{Bn}}}}{{{d{Af}}{d{Af}}}{{Cb{Bn}}}}{{{d{{Bj{c}}}}{d{{Bj{c}}}}}{{Cb{Bn}}}Gf}{{{d{n}}{d{n}}}{{Cb{Bn}}}}{{{d{Ah{b{c}}}}{d{Ff}}}{{G`{c}}}{jl}}{{{d{Ah{b{c}}}}Fh{d{Fj}}}{{Cb{{d{c}}}}}{jl}}{{{d{{b{c}}}}{d{Ff}}e}{{Dn{GhGh}}}{jl}{{Fn{c}}}}`{{{d{Bh}}c}ClGj}{{{d{Ab}}c}ClGj}{{{d{Ad}}c}ClGj}{{{d{Af}}c}ClGj}{{{d{n}}c}ClGj}`{{{d{{b{c}}}}{d{c}}}{{Cb{{d{Fd}}}}}{jl}}`{nc{}}{{{d{c}}}e{}{}}00000000{nAn}{{{d{c}}}Gl{}}{c{{Cl{e}}}{}{}}00000000000000000`{{{d{{b{c}}}}Fh}{{Cb{{Dn{{d{c}}{d{Fj}}}}}}}{jl}}`{{{d{{b{c}}}}}{{`{{Gd{}{{Gb{{Dn{{d{c}}Fh{d{Fj}}}}}}}}Gn}}}{jl}}{{{d{{b{c}}}}H`}{{`{{Gd{}{{Gb{{Dn{{d{c}}Fh{d{Fj}}}}}}}}}}}{jl}}{{{d{c}}}Hb{}}00000000{D`Bh}{{{d{Ah{b{c}}}}{d{c}}}Db{jl}}{{{d{{b{c}}}}e}{{`{{Gd{}{{Gb{{Dn{{d{c}}{d{Fd}}}}}}}}j}}}{jl}{{Fn{c}}}}{ce{}{}}00000000```````{{{d{Ah{Hd{ce}}}}{Hd{ce}}}AlA`Aj}{{{d{Ah{Hf{ce}}}}E`C`}{{Hd{c}}}{EdA`}Hh}{{{d{Ah{Hf{ce}}}}{d{E`}}C`}{{Hd{c}}}{EdA`}Hh}{{{d{Ah{Hh{}{{Hj{c}}}}}}c}Al{}}{{{d{Ah{Hf{ce}}}}{Hd{c}}}AlA`Hh}{{{d{Ah{Hf{ce}}}}{Hl{c}}}{{Hd{c}}}A`Hh}{{{d{{Hf{ce}}}}}{{d{{Hl{c}}}}}{}{}}{{{d{Ah{Hf{ce}}}}i}{{Hd{c}}}A`Hh{{Hn{}{{Gb{c}}}}}{{Hn{}{{Gb{{Dn{{d{Ff}}g}}}}}}}}{{{d{Ah{Hf{ce}}}}g}{{Hd{c}}}A`Hh{{Hn{}{{Gb{{Dn{{d{Ff}}D`}}}}}}}}{{{d{Ah{Hf{ce}}}}g}{{Hd{c}}}A`Hh{{Hn{}{{Gb{{Dn{FfD`}}}}}}}}{{{d{c}}}{{d{e}}}{}{}}0{{{d{Ahc}}}{{d{Ahe}}}{}{}}0{{{d{{Hd{ce}}}}}{{Hd{ce}}}jj}{{{d{c}}{d{Ahe}}}Al{}{}}{{}{{Hf{ce}}}{}I`}{{}{{Hd{ce}}}{}I`}{c{{Cl{{Hd{eg}}}}}Cn{lIb}Ib}{{{d{{Hd{ce}}}}{d{{Hd{ce}}}}}DbDdDd}{{{d{{Hf{ce}}}}{d{AhDf}}}DhDjDj}{{{d{{Hd{ce}}}}{d{AhDf}}}DhDjDj}{cc{}}{{{Id{c}}}{{Hd{ce}}}{}I`}1{{{If{c}}}{{Hd{e{If{c}}}}}{}{}}{{{d{{Hf{ce}}}}}{{d{{Hl{c}}}}}{}{}}``{{{d{Ah{Hh{}{{Hj{c}}}}}}{d{Ff}}}c{}}{{{d{Ah{Hh{}{{Hj{c}}}}}}Fh{d{Fj}}}c{}}`{{{d{{Hh{}{{Hj{c}}}}}}}c{}}{{{d{{Hf{ce}}}}}{{Hd{c}}}A`Hh}{{{d{Ah{Hf{ce}}}}H`c}{{Hd{c}}}A`Hh}{{{d{Ah{Hf{ce}}}}H`D`}{{Hd{c}}}A`Hh}{{{d{Ah{Hf{ce}}}}Ff}{{Hd{c}}}A`Hh}{{{d{Ah{Hf{ce}}}}FhFj}{{Hd{c}}}A`Hh}{ce{}{}}0{{{d{{Hd{ce}}}}}DbA`Aj}{{{d{{Hh{}{{Hj{c}}}}}}{d{Ff}}}Db{}}{c{{Hf{ec}}}{}{}}{{{d{{Hd{ce}}}}g}Cl{lIh}IhGj}{{{d{c}}}e{}{}}{c{{Cl{e}}}{}{}}000{{{d{c}}}Hb{}}077```{{IjIj}Ij}{{{d{{Il{c}}}}}{{h{c{Bl{{Cf{Cd}}}}}}}{jlDj}}{{{d{Ah{If{c}}}}{If{c}}}All}{{{d{Ah{Il{c}}}}{If{c}}}Al{jlDj}}{{{d{Ah{Il{c}}}}e}Al{jlDj}{}}{{{d{c}}}{{d{e}}}{}{}}00{{{d{Ahc}}}{{d{Ahe}}}{}{}}00{{{d{{If{c}}}}}{{If{c}}}j}{{{d{{Il{c}}}}}{{Il{c}}}j}{{{d{Ij}}}Ij}{{{d{c}}{d{Ahe}}}Al{}{}}00`{{}{{If{c}}}{}}{{}{{Il{c}}}{}}{{}Ij}{c{{Cl{{If{e}}}}}Cn{lIb}}{c{{Cl{Ij}}}Cn}{{{d{{If{c}}}}{d{{If{c}}}}}DbDd}{{{d{Ij}}{d{Ij}}}Db}{{{d{{If{c}}}}{d{AhDf}}}DhDj}{{{d{{Il{c}}}}{d{AhDf}}}DhDj}{{{d{Ij}}{d{AhDf}}}Dh}0{cc{}}00{{{d{{Il{c}}}}{d{c}}}{{Cb{{d{{Cf{Cd}}}}}}}{jlDj}}`{{{d{{Il{c}}}}{d{Fd}}}{{Cb{{Dn{cC`}}}}}{jlDj}}{{{d{Ah{Il{c}}}}{d{Ff}}}e{jlDj}{}}{{{d{Ah{Il{c}}}}Fh{d{Fj}}}e{jlDj}{}}{{{d{{Il{c}}}}}e{jlDj}{}}{{{d{{Il{c}}}}}{{d{{b{{Dn{nC`}}}}}}}{jlDj}}{{{d{Ah{Il{c}}}}c{Cf{Cd}}}{{If{c}}}{jlDj}}{ce{}{}}00{{{d{{If{c}}}}}Dbl}{{{d{{Il{c}}}}{d{Ff}}}Db{jlDj}}{{{d{{Il{c}}}}cC`}Db{jlDj}}{{{d{{Il{c}}}}{d{c}}}{{`{{Gd{}{{Gb{{Dn{C`Fh}}}}}}}}}{jlDj}}{{{d{{Il{c}}}}e}{{`{{Gd{}{{Gb{{Dn{{d{c}}C`Fh}}}}}}}}}{jlDj}{{Fn{c}}}}{{{d{{Il{c}}}}}{{`{{Gd{}{{Gb{{Dn{{d{c}}{d{{Cf{Cd}}}}}}}}}}Gn}}}{jlDj}}``{{{d{{Il{c}}}}{d{c}}}{{Cb{C`}}}{jlDj}}{{{d{{Il{c}}}}}{{h{cC`}}}{jlDj}}10{{{d{{Il{c}}}}}C`{jlDj}}{{{d{Ah{Il{c}}}}{d{c}}C`}Al{jlDj}}{{{d{Ah{Il{c}}}}cC`}Db{jlDj}}{{{d{{Il{c}}}}{d{Ff}}e}Fl{jlDj}{{Fn{c}}}}{C`{{Il{c}}}{}}{{{d{{Il{c}}}}{d{c}}}{{Cb{{Dn{C`Db}}}}}{jlDj}}{{{d{Ah{Il{c}}}}{d{c}}}{{Cb{{Dn{{Dn{C`{d{Fd}}}}{If{c}}}}}}}{jlDj}}{{{d{{Il{c}}}}}{{`{{Gd{}{{Gb{{Dn{{Dn{cC`}}Fh}}}}}}}}}{jlDj}}1{{{d{Ah{Il{c}}}}{d{c}}C`}{{Cb{{Dn{{Bl{{Cf{Cd}}}}{If{c}}}}}}}{jlDj}}{{{d{Ah{Il{c}}}}{d{{h{cC`}}}}}{{Dn{{h{c{Bl{{Cf{Cd}}}}}}{If{c}}}}}{jlDj}}{{{d{{Il{c}}}}{d{c}}}{{`{{Gd{}{{Gb{{Dn{C`{d{Fd}}}}}}}}}}}{jlDj}}{{{d{{Il{c}}}}e}{{`{{Gd{}{{Gb{{Dn{{d{c}}C`{d{Fd}}}}}}}}j}}}{jlDj}{{Fn{c}}}}{{{d{{Il{c}}}}{d{Ff}}e}{{Dn{GhGh}}}{jlDj}{{Fn{c}}}}{{{d{{If{c}}}}e}Cl{lIh}Gj}{{{d{Ij}}c}ClGj}{{{d{{Il{c}}}}cC`}{{Cb{{d{Fd}}}}}{jlDj}}{{{d{c}}}e{}{}}00{{{d{c}}}Gl{}}{{{d{Ij}}}Gh}`0{c{{Cl{e}}}{}{}}00000{{{d{{Il{c}}}}Fh}{{Cb{{Dn{cC`{d{Fj}}}}}}}{jlDj}}{{{d{{Il{c}}}}}{{`{{Gd{}{{Gb{{Dn{cC`Fh{d{Fj}}}}}}}}}}}{jlDj}}{{{d{{Il{c}}}}H`}{{`{{Gd{}{{Gb{{Dn{cC`Fh{d{Fj}}}}}}}}}}}{jlDj}}{{{d{c}}}Hb{}}00{{{d{{Il{c}}}}{d{c}}}{{Cb{{Bl{{Cf{Cd}}}}}}}{jlDj}}{{{d{Ah{Il{c}}}}cC`}Db{jlDj}}`{{{d{{Il{c}}}}{d{c}}}{{`{{Gd{}{{Gb{{Dn{C`{d{Fd}}}}}}}}j}}}{jlDj}}{{{d{{Il{c}}}}}{{`{{Gd{}{{Gb{{Dn{cC`{d{Fd}}}}}}}}j}}}{jlDj}}{ce{}{}}00``````````{{{d{AhIn}}{d{J`}}}{{Cl{AlJb}}}}{{{d{AhIn}}{d{Jd}}C`}{{Cl{J`Jf}}}}{{{d{AhIn}}{d{Jd}}C`Ab}{{Cl{J`Jh}}}}{{{d{AhIn}}Jj}{{Cl{J`Jf}}}}{{{d{Jj}}}Ab}{{{d{c}}}{{d{e}}}{}{}}000000{{{d{Ahc}}}{{d{Ahe}}}{}{}}000000{{{d{Jj}}}Jj}{{{d{In}}}In}{{{d{Jb}}}Jb}{{{d{Jl}}}Jl}{{{d{Jf}}}Jf}{{{d{Jh}}}Jh}{{{d{c}}{d{Ahe}}}Al{}{}}00000{{{d{AhIn}}Ab}{{Cl{J`Jb}}}}{{{d{Jj}}{d{Jj}}}Db}{{{d{In}}{d{In}}}Db}{{{d{Jb}}{d{Jb}}}Db}{{{d{Jl}}{d{Jl}}}Db}{{{d{Jf}}{d{Jf}}}Db}{{{d{Jh}}{d{Jh}}}Db}{{Jjc}{{Cl{JjJj}}}{{Hn{}{{Gb{Ab}}}}}}{{{d{Jj}}{d{AhDf}}}Dh}{{{d{In}}{d{AhDf}}}Dh}{{{d{Jb}}{d{AhDf}}}Dh}0{{{d{Jl}}{d{AhDf}}}Dh}0{{{d{Jf}}{d{AhDf}}}Dh}0{{{d{Jh}}{d{AhDf}}}Dh}0{cc{}}000000{c{{Cl{Jj{Cb{Jj}}}}}{{Hn{}{{Gb{Ab}}}}}}{{{h{C`Dl}}}{{Cl{InJb}}}}{J`{{Cl{InJb}}}}{Dl{{Dn{InJ`}}}}{{{d{Jd}}C`}Jj}{Jj{{Cl{InJb}}}}{{{d{In}}}Dl}{{{d{Jj}}C`}{{Cb{Jj}}}}{{{d{In}}C`}{{Cb{Jj}}}}{{{d{In}}}{{Cl{Abc}}}{}}{{{d{Jj}}}Dl}{{{d{Jj}}}C`}`{{{d{In}}}J`}{{JjAb}Jj}{{{d{AhIn}}Ab}{{Cl{J`Jl}}}}{ce{}{}}0000000{Jjc{}}{{{d{In}}AbAb}{{Cl{{Cb{Db}}c}}}{}}{{{d{Jj}}}Jn}{{{d{In}}}Jn}{AbJj}{{{d{AhJn}}}{{Cb{c}}}{}}`{{{d{Jj}}}{{Cb{Jj}}}}{{JjAb}{{Cl{JjJj}}}}{{{d{Jj}}c}{{`{{K`{}{{Gb{Jj}}}}}}}{{Fn{C`}}}}{{{d{In}}c}{{`{{K`{}{{Gb{Jj}}}}}}}{{Fn{C`}}}}{{{d{In}}}Jj}{{{d{c}}}e{}{}}00000{{{d{c}}}Gl{}}000{c{{Cl{e}}}{}{}}000000`0000000{{{d{c}}}Hb{}}000000`???????````{{{d{c}}}{{d{e}}}{}{}}000{{{d{Ahc}}}{{d{Ahe}}}{}{}}000{{Kbe}Kb{{Gn{}{{Gb{Fh}}}}Kd}{{Hn{}{{Kf{c}}{Gb{Fh}}}}}}{{Kbe}Kb{{Gn{}{{Gb{f}}}}Kd}{{Hn{}{{Kf{c}}{Gb{f}}}}}}{{{Kh{c}}cg}{{Kh{c}}}{lj}{{K`{}{{Gb{{Dn{C`f}}}}}}Kd}{{Hn{}{{Kf{e}}}}}}``{{Kbe}Kb{{Gn{}{{Gb{H`}}}}Kd}{{Hn{}{{Kf{c}}{Gb{H`}}}}}}``{cc{}}000{JjKb}{Jj{{Kh{c}}}{lj}}{{Jj{d{{Il{c}}}}}{{Kh{c}}}{Djlj}}``{{Kbc}Kb{{Kj{{d{Fh}}}}KdKl}}{{Kbc}Kb{{Kj{{d{Fd}}}}KdKl}}{{{Kh{c}}e}{{Kh{c}}}{Kdlj}{{Kj{cC`{d{Fd}}}}KdKlj}}{{{Kh{c}}ce}{{Kh{c}}}{Kdlj}{{Kj{C`{d{Fd}}}}KdKl}}{{Kbc}Kb{{Kj{{d{H`}}}}KdKl}}{ce{}{}}000``{{Kb{d{{Il{c}}}}e}Kb{jlDjKdKl}{{Fn{c}}}}{{Kbe}Kb{{Gn{}{{Gb{Fh}}}}Kd}{{Hn{}{{Kf{c}}}}}}{{Kbe}Kb{{Gn{}{{Gb{f}}}}Kd}{{Hn{}{{Kf{c}}}}}}>{{Kbe}Kb{{Gn{}{{Gb{H`}}}}Kd}{{Hn{}{{Kf{c}}}}}}``{c{{Cl{e}}}{}{}}0000000`{{{d{c}}}Hb{}}0006666`````````{{{d{{Hl{c}}}}}{{d{{G`{{Dn{cH`}}}}}}}{}}{{{d{{Hl{c}}}}}{{`{{K`{}{{Gb{{Dn{Fh{d{Fj}}}}}}}}}}}{}}{{{d{{Id{c}}}}}{{`{{K`{}{{Gb{C`}}}}}}}A`}``{{{d{Ah{Id{c}}}}{Id{c}}}All}{{{d{Ah{Hl{c}}}}{Id{c}}}Al{jl}}{{{d{Ah{Hl{c}}}}{Hl{c}}}{{Id{c}}}{jl}}{{{d{{Hl{c}}}}}{{d{{Hl{c}}}}}{}}{{{d{{Hl{c}}}}{d{e}}Abik}IjA`{{El{}{{Ej{Kn}}}}}j{{Hn{}{{Gb{{Dn{gFh}}}}}}}{{Kj{{d{g}}{d{Fd}}}{{L`{Db}}}}}}{{{d{Ah{Hl{c}}}}e}{{Id{c}}}{jl}{{Hn{}{{Gb{{Dn{FfD`}}}}}}}}{{{d{c}}}{{d{e}}}{}{}}000000{{{d{Ahc}}}{{d{Ahe}}}{}{}}000000{{{d{{Hl{c}}}}{d{Ff}}}{{Cl{GhLb}}}{}}`{c{{Cb{Gh}}}{}}{c{{Cb{Fl}}}{}}01{{{d{{Hl{c}}}}}{{Hl{c}}}j}{{{d{{Ld{ce}}}}}{{Ld{ce}}}jj}{{{d{{Lf{ce}}}}}{{Lf{ce}}}jj}{{{d{{Id{c}}}}}{{Id{c}}}j}{{{d{c}}{d{Ahe}}}Al{}{}}000{{{d{{Ld{ce}}}}{d{{Ld{ce}}}}}Bnll}{{{d{{Lf{ce}}}}{d{{Lf{ce}}}}}Bnll}{{}{{Hl{c}}}{}}{{}{{Id{c}}}{}}{{{d{{Ld{ce}}}}}{{d{g}}}{}{}{}}{c{{Cl{{Id{e}}}}}Cn{lIb}}{{{d{{Hl{c}}}}{d{Ff}}}{{`{{K`{}{{Gb{{Dn{EbH`}}}}}}}}}{}}{{{d{{Hl{c}}}}{d{{Hl{c}}}}}DbDd}{{{d{{Ld{ce}}}}{d{{Ld{ce}}}}}DbDdDd}{{{d{{Lf{ce}}}}{d{{Lf{ce}}}}}DbDdDd}{{{d{Lb}}{d{Lb}}}Db}{{{d{{Id{c}}}}{d{{Id{c}}}}}DbDd}{{{d{{Hl{c}}}}{d{e}}Abi}{{`{{K`{}{{Gb{{Dn{g{Bj{c}}}}}}}}}}}A`{{El{}{{Ej{Kn}}}}}j{{Hn{}{{Gb{{Dn{gFh}}}}}}}}0{{{d{{Hl{c}}}}}{{`{{K`{}{{Gb{{Dn{Fh{d{Fj}}}}}}}}}}}{}}{{{d{{Hl{c}}}}{d{AhDf}}}DhDj}{{{d{{Ld{ce}}}}{d{AhDf}}}DhDjDj}{{{d{{Lf{ce}}}}{d{AhDf}}}DhDjDj}{{{d{Lb}}{d{AhDf}}}Dh}0{{{d{{Id{c}}}}{d{AhDf}}}DhDj}{cc{}}000000{{{d{{Hl{c}}}}}{{`{{K`{}{{Gb{{Ld{{Lh{Ff}}c}}}}}}}}}{}}{{{d{{Hl{c}}}}{d{e}}AbH`}{{Cb{{Bf{{d{c}}}}}}}A`{{El{}{{Ej{Kn}}}}}}{{{d{{Hl{c}}}}{d{e}}AbFh}{{Cb{{Dn{{Bf{{d{c}}}}H`}}}}}A`{{El{}{{Ej{Kn}}}}}}{{{d{{Hl{c}}}}H`}{{Cb{{Lh{Ff}}}}}{}}{{{d{{Hl{c}}}}H`}{{Cb{{Ld{{Lh{Ff}}c}}}}}{}}{{{d{{Hl{c}}}}Fh}{{Cb{{d{Fj}}}}}{}}{{{d{{Hl{c}}}}}{{Id{c}}}{jl}}{{{d{Ah{Hl{c}}}}H`c}{{Id{c}}}{jl}}{{{d{Ah{Hl{c}}}}H`D`}{{Id{c}}}{jl}}{{{d{Ah{Hl{c}}}}e}{{Id{c}}}{jl}{{Lj{{Lh{Ff}}}}}}{{{d{Ah{Hl{c}}}}FhFj}{{Id{c}}}{jl}}{ce{}{}}00000000{{{d{{Hl{c}}}}}Db{}}{{{d{{Id{c}}}}}Dbl}``{{{d{{Hl{c}}}}{d{e}}Ab}{{`{{K`{}{{Gb{{Lf{{Lh{Ff}}c}}}}}}}}}A`El}{{{Hl{c}}g}{{Hl{e}}}{jl}{jl}{{Kj{c}{{L`{e}}}}}}{{{Id{c}}g}{{Id{e}}}ll{{Kj{c}{{L`{e}}}}}}{c{{Hl{e}}}{{Hn{}{{Gb{Ff}}}}}{jl}}{{{d{Ah{Ll{cg}}}}}{{Cb{i}}}{}{}{{Kj{Eb{Lh{Ff}}}{{L`{{Cb{e}}}}}}}{}}{{{d{Ah{Ln{cg}}}}}{{Cb{i}}}{}{}{{Kj{EbH`}{{L`{{Cb{e}}}}}}}{}}{{{d{{Hl{c}}}}Fh}{{d{{M`{H`}}}}}{}}{{{d{{Ld{ce}}}}{d{{Ld{ce}}}}}{{Cb{Bn}}}GfGf}{{{d{{Lf{ce}}}}{d{{Lf{ce}}}}}{{Cb{Bn}}}GfGf}{{{d{{Id{c}}}}e}Cl{lIh}Gj}{{{d{c}}}e{}{}}000{{{d{c}}}Gl{}}{{{d{{Hl{c}}}}{d{e}}Abik}{{Cl{Ij}}}A`Elj{{Hn{}{{Gb{{Dn{gFh}}}}}}}{{Kj{{d{g}}{d{Fd}}}{{L`{Db}}}}}}{{{d{{Hl{c}}}}{d{e}}Abi}{{`{{K`{}{{Gb{{Cl{{Dn{g{Bj{c}}}}}}}}}}}}}A`Elj{{Hn{}{{Gb{{Dn{gFh}}}}}}}}0{c{{Cl{e}}}{}{}}000000{{{d{{Hl{c}}}}{d{e}}AbH`}{{Cl{{Cb{{Bf{{d{c}}}}}}}}}A`El}{{{d{{Hl{c}}}}{d{e}}AbFh}{{Cl{{Cb{{Dn{{Bf{{d{c}}}}H`}}}}}}}A`El}2222222{{{d{{Hl{c}}}}{d{e}}Ab}{{`{{K`{}{{Gb{{Cl{{Lf{{Lh{Ff}}c}}}}}}}}}}}A`El}``{{{d{{Hl{c}}}}H`}{{Cb{{h{C`{d{Fj}}}}}}}{}}{{{d{{Hl{c}}}}H`}{{`{{Gd{}{{Gb{{Dn{C`{d{{M`{H`}}}}}}}}}}}}}{}}`{{{d{{Id{c}}}}}{{`{{K`{}{{Gb{{Dn{Fh{d{Fj}}}}}}}}}}}{}}``{{{d{c}}}Hb{}}000000{{{d{Ah{Hl{c}}}}D`}{{Id{c}}}{jl}}{ce{}{}}000000{{{d{{Hl{c}}}}ei}{{Ll{ci}}}{jl}{{Lj{{Lh{Ff}}}}}{}{{Kj{Eb{Lh{Ff}}}{{L`{{Cb{g}}}}}}}}{{{d{{Hl{c}}}}{d{Ff}}g}{{Ln{cg}}}{}{}{{Kj{EbH`}{{L`{{Cb{e}}}}}}}}{{{d{{Hl{c}}}}H`g}{{Ln{cg}}}{jl}{}{{Kj{EbH`}{{L`{{Cb{e}}}}}}}}","D":"BLl","p":[[5,"SpkTxOutIndex",0,798],[1,"reference"],[5,"ScriptBuf",799],[5,"BTreeMap",800],[10,"Clone",801],[10,"Ord",802],[5,"DescriptorId",0,803],[10,"Anchor",0,804],[5,"BlockId",0,805],[5,"ConfirmationHeightAnchor",0,805],[5,"ConfirmationTimeHeightAnchor",0,805],[0,"mut"],[10,"Append",0,804],[1,"unit"],[5,"Hash",806],[1,"u8"],[1,"slice"],[1,"array"],[6,"ChainPosition",0,805],[6,"ConfirmationTime",0,805],[5,"FullTxOut",0,805],[5,"SpkIterator",0,807],[6,"Ordering",802],[1,"u32"],[6,"Option",808],[6,"DescriptorPublicKey",809],[6,"Descriptor",810],[10,"Borrow",811],[10,"DescriptorExt",0,803],[6,"Result",812],[10,"Deserializer",813],[1,"u64"],[1,"bool"],[10,"PartialEq",802],[5,"Formatter",814],[8,"Result",814],[10,"Debug",814],[5,"BlockHash",815],[1,"tuple"],[5,"Block",816],[1,"usize"],[10,"AnchorFromBlockPosition",0,804],[5,"FromSliceError",817],[1,"str"],[17,"Error"],[10,"ChainOracle",0,818],[10,"Hash",819],[10,"Hasher",819],[10,"SliceIndex",820],[5,"Script",821],[5,"Transaction",822],[5,"OutPoint",822],[5,"TxOut",822],[5,"SignedAmount",823],[10,"RangeBounds",824],[5,"BTreeSet",825],[17,"Item"],[10,"DoubleEndedIterator",826],[10,"PartialOrd",802],[5,"Amount",823],[10,"Serializer",827],[5,"String",828],[10,"ExactSizeIterator",829],[5,"Txid",815],[5,"TypeId",830],[5,"ChangeSet",272],[5,"IndexedTxGraph",272],[10,"Indexer",272],[17,"ChangeSet"],[5,"TxGraph",637],[10,"IntoIterator",831],[10,"Default",832],[10,"Deserialize",813],[5,"ChangeSet",637],[5,"ChangeSet",329,833],[10,"Serialize",827],[5,"Balance",329],[5,"KeychainTxOutIndex",329,833],[5,"LocalChain",431],[8,"ChangeSet",431],[5,"MissingGenesisError",431],[5,"Header",816],[5,"CannotConnectError",431],[6,"ApplyHeaderError",431],[5,"CheckPoint",431],[5,"AlterCheckPointError",431],[5,"CheckPointIter",431],[10,"Iterator",834],[5,"SyncRequest",573],[10,"Send",835],[17,"IntoIter"],[5,"FullScanRequest",573],[10,"FnMut",836],[10,"Sync",835],[6,"Infallible",837],[17,"Output"],[6,"CalculateFeeError",637],[5,"TxNode",637],[5,"CanonicalTx",637],[5,"Arc",838],[10,"Into",837],[5,"TxAncestors",637],[5,"TxDescendants",637],[5,"HashSet",839],[15,"Confirmed",269],[15,"Unconfirmed",269],[5,"SyncResult",573],[5,"FullScanResult",573]],"r":[[0,804],[1,804],[2,804],[3,807],[4,805],[6,818],[7,805],[8,805],[9,805],[10,805],[13,803],[14,803],[16,805],[17,272],[18,807],[19,798],[20,637],[330,833],[331,833]],"b":[[35,"impl-AsRef%3C%5Bu8%5D%3E-for-DescriptorId"],[36,"impl-AsRef%3C%5Bu8;+%3C%24hash+as+%24crate::Hash%3E::LEN%5D%3E-for-DescriptorId"],[119,"impl-Debug-for-DescriptorId"],[120,"impl-Display-for-DescriptorId"],[121,"impl-LowerHex-for-DescriptorId"],[122,"impl-UpperHex-for-DescriptorId"],[127,"impl-From%3C(%26u32,+%26BlockHash)%3E-for-BlockId"],[128,"impl-From%3C(u32,+BlockHash)%3E-for-BlockId"],[299,"impl-From%3CChangeSet%3CA%3E%3E-for-ChangeSet%3CA,+IA%3E"],[301,"impl-From%3CChangeSet%3CK%3E%3E-for-ChangeSet%3CA,+ChangeSet%3CK%3E%3E"],[335,"impl-KeychainTxOutIndex%3CK%3E"],[336,"impl-Indexer-for-KeychainTxOutIndex%3CK%3E"],[359,"impl-Debug-for-Balance"],[360,"impl-Display-for-Balance"],[482,"impl-Display-for-MissingGenesisError"],[483,"impl-Debug-for-MissingGenesisError"],[484,"impl-Display-for-AlterCheckPointError"],[485,"impl-Debug-for-AlterCheckPointError"],[486,"impl-Display-for-CannotConnectError"],[487,"impl-Debug-for-CannotConnectError"],[488,"impl-Display-for-ApplyHeaderError"],[489,"impl-Debug-for-ApplyHeaderError"],[703,"impl-Debug-for-CalculateFeeError"],[704,"impl-Display-for-CalculateFeeError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAALgBSgASAAAAFQAAABkAAAAbAAIAIQABACQAFQA7ABEATgAGAFoAAQBdAAMAYwAEAGkAEgB+AAAAgAABAIcAAACKAAQAkAACAJQABQCcAAAAngABAKEAAACsAAAAtQAAALoAAAC+AAEAwwAGAM0ABQDWAAkA4QASAPkACAAFAQgAFQEAABsBAAAfAQsALAEAAC4BAAA9AQAAQAEJAE0BAABRAQwAXwEKAHABAgB5AQAAkgEBAJUBAwCcAQUApQECAK0BAgC/ARkA2gEFAOEBCQD7AQAACQICAA8CAAAWAhAAKAINADcCBgBCAgcAbQIHAHYCBwCMAgAAjwIAAJICDQCiAhEAtQIEAL0CBQDcAgEA3wIAAOYCAQDpAgcA9AIGAP0CBgANAwYAFQMGAA=="}],\ ["bdk_coin_select",{"t":"FFGGFFPIPFGPPPFGFPPSPPPPPFNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNHNNNONONNNNOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNONNOOOONNNNONOOOOONNNNONNNNNNOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNOOON","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","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":[[0,"bdk_coin_select"],[235,"bdk_coin_select::bnb"],[236,"core::cmp"],[237,"bdk_coin_select::coin_selector"],[238,"core::iter::traits::iterator"],[239,"core::option"],[240,"core::convert"],[241,"core::result"],[242,"core::fmt"],[243,"core::time"],[244,"bitcoin::blockdata::transaction"],[245,"core::hash"],[246,"alloc::vec"],[247,"core::marker"],[248,"alloc::string"],[249,"core::any"]],"i":[0,0,0,0,0,0,41,0,22,0,0,18,18,22,0,0,0,41,41,0,18,18,11,11,11,0,2,6,7,2,16,2,7,41,2,34,22,15,16,6,17,18,7,11,12,41,2,34,22,15,16,6,17,18,7,11,12,6,6,15,16,6,17,18,7,11,12,15,16,6,17,18,7,11,12,11,0,6,6,6,12,16,16,6,15,18,11,7,7,12,12,6,15,16,6,17,17,18,18,7,11,11,12,2,41,2,34,22,22,22,15,16,6,17,18,7,11,12,16,11,15,41,2,34,22,15,16,6,17,18,7,11,12,2,34,6,15,6,16,16,16,16,16,2,15,6,34,6,11,2,2,12,2,2,6,6,6,6,7,6,6,6,6,6,6,2,16,16,16,15,16,6,17,18,7,11,12,17,18,11,41,2,34,22,15,16,6,17,18,7,11,12,41,2,34,22,15,16,6,17,18,7,11,12,41,2,34,22,15,16,6,17,18,7,11,12,6,6,15,41,2,34,22,15,16,6,17,18,7,11,12,12,15,12,41],"f":"``````````````````````````{{{f{b{d{c}}}}c}hj}{{{f{l}}}h}{{{f{n}}{f{{A`{c}}}}}{{`{{Ad{}{{Ab{{f{c}}}}}}}}}{}}{{{f{b{d{c}}}}}hj}``{{{f{n}}}{{Aj{{f{Af}}{f{Ah}}}}}}{{{f{c}}}{{f{e}}}{}{}}00000000000{{{f{bc}}}{{f{be}}}{}{}}00000000000{{{f{l}}Al}{{f{An}}}}`{{{f{An}}}An}{{{f{B`}}}B`}{{{f{l}}}l}{{{f{Bb}}}Bb}{{{f{Bd}}}Bd}{{{f{n}}}n}{{{f{Af}}}Af}{{{f{Ah}}}Ah}{{{f{c}}{f{be}}}Bf{}{}}0000000{{{f{Af}}{f{Af}}}Bh}{{cl}{{Bj{l}}}{{Bn{Bl}}}}{{{f{l}}}C`}{{{f{l}}}Cb}{{{f{bl}}Al}h}`{{{f{B`}}}C`}`3{{{f{An}}Cd}C`}{{{f{Bd}}{f{Bd}}}h}{{{f{Af}}{f{Af}}}h}```{{{f{Ah}}}Cd}{{{f{l}}}{{Cf{nBb}}}}{{{f{An}}{f{bCh}}}Cj}{{{f{B`}}{f{bCh}}}Cj}{{{f{l}}{f{bCh}}}Cj}{{{f{Bb}}{f{bCh}}}Cj}0{{{f{Bd}}{f{bCh}}}Cj}0{{{f{n}}{f{bCh}}}Cj}{{{f{Af}}{f{bCh}}}Cj}0{{{f{Ah}}{f{bCh}}}Cj}{{{f{b{d{c}}}}h}Bfj}{cc{}}00{AlBl}{ClBl}222222222{{{f{{A`{Cn}}}}{f{Cn}}Cb}B`}{{{f{Af}}{f{bc}}}BfD`}`{ce{}{}}00000000000{{{d{c}}{f{{Db{c}}}}}{{Dd{c}}}j}1{{{f{l}}}h}`{{{f{l}}Al}h}{{{f{B`}}}Cd}````{{l{Df{{Aj{Al{f{An}}}}}}c}{{d{c}}}j}{{DhCbh}An}{{{f{{Df{An}}}}{f{B`}}}l}{{{f{b{Dd{c}}}}}{{Bj{e}}}{jDjDl}{}}`{{{f{Af}}{f{Af}}}{{Bj{Bh}}}}`````{{{f{bl}}Al}h}{{{f{bl}}}Bf}{{{f{bl}}}{{Cf{nBb}}}}{{{f{l}}}{{`{{Ad{}{{Ab{{Aj{Al{f{An}}}}}}}}}}}}`{{{f{l}}}Dh}{{{f{l}}}Al}{{{f{l}}}C`}{{{f{l}}}{{`{{Ad{}{{Ab{Al}}}}}}}}1{{{f{l}}}Cb}````{{{f{c}}}e{}{}}0000000{{{f{c}}}Dn{}}00{c{{Cf{e}}}{}{}}00000000000000000000000{{{f{c}}}E`{}}0000000000095`{ce{}{}}00000000000```{{{f{Eb}}}h}","D":"Hh","p":[[0,"mut"],[5,"Bnb",0,235],[1,"reference"],[1,"bool"],[10,"Ord",236],[5,"CoinSelector",0,237],[5,"Selection",0,237],[1,"slice"],[17,"Item"],[10,"Iterator",238],[6,"ExcessStrategyKind",0,237],[5,"ExcessStrategy",0,237],[1,"tuple"],[1,"usize"],[5,"WeightedValue",0,237],[5,"CoinSelectorOpt",0,237],[5,"SelectionError",0,237],[6,"SelectionConstraint",0,237],[1,"unit"],[6,"Ordering",236],[6,"Option",239],[6,"BnbLimit",0,235],[10,"Into",240],[1,"i64"],[1,"u32"],[1,"f32"],[6,"Result",241],[5,"Formatter",242],[8,"Result",242],[5,"Duration",243],[5,"TxOut",244],[10,"Hasher",245],[8,"DecideStrategy",0,235],[5,"BnbIter",0,235],[5,"Vec",246],[1,"u64"],[10,"Copy",247],[10,"Display",242],[5,"String",248],[5,"TypeId",249],[6,"BranchStrategy",0,235]],"r":[[0,235],[1,235],[2,235],[3,235],[4,237],[5,237],[7,235],[9,237],[10,237],[14,237],[15,237],[16,237],[25,237],[76,235]],"b":[[95,"impl-Debug-for-SelectionError"],[96,"impl-Display-for-SelectionError"],[97,"impl-Debug-for-SelectionConstraint"],[98,"impl-Display-for-SelectionConstraint"],[100,"impl-Display-for-ExcessStrategyKind"],[101,"impl-Debug-for-ExcessStrategyKind"],[107,"impl-From%3Cusize%3E-for-BnbLimit"],[108,"impl-From%3CDuration%3E-for-BnbLimit"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAKcAFwAAAAAAAgAAAAYAAAAJAAIADgADABcAAgAcAAEAIAAAACIAKgBQAAIAVgAEAFwACwBsAAEAdwABAIcAAQCKAAEAkgANAKEAAACjAAAApgAAAKoAMADcAAwA6gABAA=="}],\ -["bdk_electrum",{"t":"KFFENNNNENNMNNMNNNNNNNNNNNN","n":["ElectrumExt","ElectrumFullScanResult","ElectrumSyncResult","bdk_chain","borrow","borrow","borrow_mut","borrow_mut","electrum_client","from","from","full_scan","into","into","sync","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","with_confirmation_height_anchor","with_confirmation_height_anchor","with_confirmation_time_height_anchor","with_confirmation_time_height_anchor"],"q":[[0,"bdk_electrum"],[27,"bdk_electrum::electrum_ext"],[28,"bdk_chain::spk_client"],[29,"electrum_client::types"],[30,"core::result"],[31,"core::cmp"],[32,"core::clone"],[33,"core::any"],[34,"bdk_chain::chain_data"],[35,"electrum_client::api"]],"i":[0,0,0,0,7,13,7,13,0,7,13,3,7,13,3,7,13,7,13,7,13,7,13,7,13,7,13],"f":"````{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0`{cc{}}0{{{b{f}}{h{c}}jjl}{{Ab{{n{c}}A`}}}{AdAf}}{ce{}{}}0{{{b{f}}Ahjl}{{Ab{AjA`}}}}{c{{Ab{e}}}{}{}}000{{{b{c}}}Al{}}033{{{n{c}}}{{B`{cAn}}}{}}{Aj{{Bb{An}}}}{{{n{c}}{b{e}}}{{Ab{{B`{cBd}}A`}}}{}Bf}{{Aj{b{c}}}{{Ab{{Bb{Bd}}A`}}}Bf}","D":"Al","p":[[1,"reference"],[0,"mut"],[10,"ElectrumExt",0,27],[5,"FullScanRequest",28],[1,"usize"],[1,"bool"],[5,"ElectrumFullScanResult",0,27],[6,"Error",29],[6,"Result",30],[10,"Ord",31],[10,"Clone",32],[5,"SyncRequest",28],[5,"ElectrumSyncResult",0,27],[5,"TypeId",33],[5,"ConfirmationHeightAnchor",34],[5,"FullScanResult",28],[5,"SyncResult",28],[5,"ConfirmationTimeHeightAnchor",34],[10,"ElectrumApi",35]],"r":[[0,27],[1,27],[2,27]],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAA0AAgAEAAUAEAAHAA=="}],\ +["bdk_electrum",{"t":"FFFENNNNNNENNNNNNONNNNNNNNNNNNNNNNNNNNNNN","n":["BdkElectrumClient","ElectrumFullScanResult","ElectrumSyncResult","bdk_chain","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","electrum_client","fetch_tx","fmt","from","from","from","full_scan","inner","into","into","into","new","populate_tx_cache","sync","transaction_broadcast","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","with_confirmation_height_anchor","with_confirmation_height_anchor","with_confirmation_time_height_anchor","with_confirmation_time_height_anchor"],"q":[[0,"bdk_electrum"],[41,"bdk_electrum::bdk_electrum_client"],[42,"bitcoin::hash_types::newtypes"],[43,"bitcoin::blockdata::transaction"],[44,"alloc::sync"],[45,"electrum_client::types"],[46,"core::result"],[47,"electrum_client::api"],[48,"core::fmt"],[49,"bdk_chain::spk_client"],[50,"core::cmp"],[51,"core::clone"],[52,"bdk_chain::tx_graph"],[53,"core::convert"],[54,"core::any"],[55,"bdk_chain::chain_data"]],"i":[0,0,0,0,16,23,3,16,23,3,0,3,3,16,23,3,3,3,16,23,3,3,3,3,3,16,23,3,16,23,3,16,23,3,16,23,3,16,23,16,23],"f":"````{{{b{c}}}{{b{e}}}{}{}}00{{{b{dc}}}{{b{de}}}{}{}}00`{{{b{{f{c}}}}h}{{A`{{l{j}}n}}}Ab}{{{b{{f{c}}}}{b{dAd}}}AfAh}{cc{}}00{{{b{{f{c}}}}{Aj{e}}AlAlAn}{{A`{{B`{e}}n}}}Ab{BbBd}}`{ce{}{}}00{c{{f{c}}}Ab}{{{b{{f{c}}}}g}BfAb{}{{Bj{{Bh{e}}}}}}{{{b{{f{c}}}}BlAlAn}{{A`{Bnn}}}Ab}{{{b{{f{c}}}}{b{j}}}{{A`{hn}}}Ab}{c{{A`{e}}}{}{}}00000{{{b{c}}}C`{}}00666{{{B`{c}}}{{Cd{cCb}}}{}}{Bn{{Cf{Cb}}}}{{{B`{c}}{b{{f{e}}}}}{{A`{{Cd{cCh}}n}}}{}Ab}{{Bn{b{{f{c}}}}}{{A`{{Cf{Ch}}n}}}Ab}","D":"Bj","p":[[1,"reference"],[0,"mut"],[5,"BdkElectrumClient",0,41],[5,"Txid",42],[5,"Transaction",43],[5,"Arc",44],[6,"Error",45],[6,"Result",46],[10,"ElectrumApi",47],[5,"Formatter",48],[8,"Result",48],[10,"Debug",48],[5,"FullScanRequest",49],[1,"usize"],[1,"bool"],[5,"ElectrumFullScanResult",0,41],[10,"Ord",50],[10,"Clone",51],[1,"unit"],[5,"TxGraph",52],[10,"AsRef",53],[5,"SyncRequest",49],[5,"ElectrumSyncResult",0,41],[5,"TypeId",54],[5,"ConfirmationHeightAnchor",55],[5,"FullScanResult",49],[5,"SyncResult",49],[5,"ConfirmationTimeHeightAnchor",55]],"r":[[0,41],[1,41],[2,41]],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAABQAAwAEAAcADQAAABoACwA="}],\ ["bdk_esplora",{"t":"IKKEMMMM","n":["Error","EsploraAsyncExt","EsploraExt","esplora_client","full_scan","full_scan","sync","sync"],"q":[[0,"bdk_esplora"],[8,"bdk_esplora::blocking_ext"],[9,"bdk_chain::spk_client"],[10,"core::result"],[11,"core::cmp"],[12,"core::clone"],[13,"bdk_esplora::async_ext"],[14,"core::future::future"],[15,"alloc::boxed"],[16,"core::pin"],[17,"core::marker"]],"i":[0,0,0,0,1,10,1,10],"f":"````{{{d{b}}{f{c}}hh}{{n{{j{c}}l}}}{A`Ab}}{{{d{Ad}}{f{c}}hh}{{Aj{{Ah{Af}}}}}{A`AbAl}}{{{d{b}}Anh}{{n{B`l}}}}{{{d{Ad}}Anh}{{Aj{{Ah{Af}}}}}}","D":"A`","p":[[10,"EsploraExt",0,8],[1,"reference"],[5,"FullScanRequest",9],[1,"usize"],[5,"FullScanResult",9],[8,"Error",0,8],[6,"Result",10],[10,"Ord",11],[10,"Clone",12],[10,"EsploraAsyncExt",0,13],[10,"Future",14],[5,"Box",15],[5,"Pin",16],[10,"Send",17],[5,"SyncRequest",9],[5,"SyncResult",9]],"r":[[0,8],[1,13],[2,8]],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAEAAAAAAAAAEAAAAAQA"}],\ ["bdk_file_store",{"t":"FPFGPPPGFNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNOO","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","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":[[0,"bdk_file_store"],[75,"bdk_file_store::FileError"],[77,"bdk_file_store::store"],[78,"core::option"],[79,"core::result"],[80,"bdk_chain::tx_data_traits"],[81,"serde::ser"],[82,"serde::de"],[83,"core::marker"],[84,"std::io::error"],[85,"std::path"],[86,"core::convert"],[87,"bdk_file_store::entry_iter"],[88,"core::fmt"],[89,"anyhow"],[90,"std::fs"],[91,"alloc::string"],[92,"core::any"]],"i":[0,20,0,0,16,20,16,0,0,2,2,19,20,2,5,16,19,20,2,5,16,5,2,19,20,20,2,5,5,16,16,19,20,20,2,5,16,16,19,20,2,5,16,19,2,5,2,19,19,2,2,20,5,16,19,20,2,5,16,19,20,2,5,16,19,20,2,5,16,19,20,2,5,16,2,29,29],"f":"`````````{{{f{b{d{c}}}}}{{l{{h{c}}{j{c}}}}}{nA`AbAdAf}}{{{f{b{d{c}}}}{f{c}}}{{l{AhAj}}}{nA`AbAdAf}}{{{f{c}}}{{f{e}}}{}{}}0000{{{f{bc}}}{{f{be}}}{}{}}0000`{{{f{{An{Al}}}}c}{{l{{d{e}}B`}}}{{Bd{Bb}}}{nA`AbAdAf}}{{{f{b{Bf{c}}}}}Ah{}}{{{f{Bh}}{f{bBj}}}Bl}0{{{f{{d{c}}}}{f{bBj}}}Bl{AfAdBn}}{{{f{{j{c}}}}{f{bBj}}}Bl{}}{{{f{{j{c}}}}{f{bBj}}}BlBn}{{{f{B`}}{f{bBj}}}Bl}0{cc{}}0{AjBh}11{AjB`}2{ce{}{}}00000{{{f{b{d{c}}}}}{{Bf{c}}}{nA`AbAdAf}}`{{{f{b{d{c}}}}}{{C`{{h{c}}}}}{nA`AbAdAf}}{{Cb{f{bCd}}}{{Bf{c}}}{}}{{{f{b{Bf{c}}}}}{{h{e}}}Ab{}}>>{{{f{c}}}Cf{}}00{c{{l{e}}}{}{}}000000000{{{f{c}}}Ch{}}000077777{{{f{b{d{c}}}}{f{c}}}{{C`{Ah}}}{nA`AbAdAf}}``","D":"Ch","p":[[0,"mut"],[5,"Store",0,77],[1,"reference"],[6,"Option",78],[5,"AggregateChangesetsError",0,77],[6,"Result",79],[10,"Append",80],[10,"Serialize",81],[10,"DeserializeOwned",82],[10,"Send",83],[10,"Sync",83],[1,"unit"],[5,"Error",84],[1,"u8"],[1,"slice"],[6,"FileError",0],[5,"Path",85],[10,"AsRef",86],[5,"EntryIter",0,87],[6,"IterError",0,87],[5,"Formatter",88],[8,"Result",88],[10,"Debug",88],[8,"Result",89],[1,"u64"],[5,"File",90],[5,"String",91],[5,"TypeId",92],[15,"InvalidMagicBytes",75]],"r":[[0,77],[2,87],[7,87],[8,77]],"b":[[24,"impl-Display-for-IterError"],[25,"impl-Debug-for-IterError"],[27,"impl-Display-for-AggregateChangesetsError%3CC%3E"],[28,"impl-Debug-for-AggregateChangesetsError%3CC%3E"],[29,"impl-Debug-for-FileError"],[30,"impl-Display-for-FileError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAADEABwAMAAkAGAAHACIAAAAlAAAALAAAAC8AAgA0ABkA"}],\ ["bdk_hwi",{"t":"FNNNNNNNNNNNN","n":["HWISigner","borrow","borrow_mut","fmt","from","from_device","id","into","sign_transaction","try_from","try_into","type_id","vzip"],"q":[[0,"bdk_hwi"],[13,"bdk_hwi::signer"],[14,"core::fmt"],[15,"hwi::types"],[16,"hwi::error"],[17,"core::result"],[18,"secp256k1::context::alloc_only"],[19,"secp256k1"],[20,"bdk_wallet::wallet::signer"],[21,"bitcoin::psbt"],[22,"core::any"]],"i":[0,3,3,3,3,3,3,3,3,3,3,3,3],"f":"`{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{f}}{b{dh}}}j}{cc{}}{{{b{l}}n}{{Ab{fA`}}}}{{{b{f}}{b{{Af{Ad}}}}}Ah}{ce{}{}}{{{b{f}}{b{dAj}}{b{Al}}{b{{Af{Ad}}}}}{{Ab{AnB`}}}}{c{{Ab{e}}}{}{}}0{{{b{c}}}Bb{}}3","D":"j","p":[[1,"reference"],[0,"mut"],[5,"HWISigner",0,13],[5,"Formatter",14],[8,"Result",14],[5,"HWIDevice",15],[5,"HWIChain",15],[6,"Error",16],[6,"Result",17],[6,"All",18],[5,"Secp256k1",19],[6,"SignerId",20],[5,"Psbt",21],[5,"SignOptions",20],[1,"unit"],[6,"SignerError",20],[5,"TypeId",22]],"r":[[0,13]],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAAgAAwACAAIABwAAAAkABAA="}],\ diff --git a/docs-rs/bdk/nightly/latest/search.desc/bdk_chain/bdk_chain-desc-0-.js b/docs-rs/bdk/nightly/latest/search.desc/bdk_chain/bdk_chain-desc-0-.js index bb52b1fac7..cf0ce0c1be 100644 --- a/docs-rs/bdk/nightly/latest/search.desc/bdk_chain/bdk_chain-desc-0-.js +++ b/docs-rs/bdk/nightly/latest/search.desc/bdk_chain/bdk_chain-desc-0-.js @@ -1 +1 @@ -searchState.loadedDescShard("bdk_chain", 0, "This crate is a collection of core structures for Bitcoin …\nTrait that “anchors” blockchain data to a specific …\nAn Anchor that can be constructed from a given block, …\nTrait that makes an object appendable.\nMaximum BIP32 derivation index.\nA reference to a block in the canonical chain.\nHow many confirmations are needed f or a coinbase output …\nRepresents a service that tracks the blockchain.\nRepresents the observed position of some chain data.\nAn Anchor implementation that also records the exact …\nBlock height and timestamp at which a transaction is …\nAn Anchor implementation that also records the exact …\nThe chain data is seen as confirmed, and in anchored by A.\nThe transaction is confirmed\nA trait to extend the functionality of a miniscript …\nRepresents the ID of a descriptor, defined as the sha256 …\nError type.\nA TxOut with as much data as we can retrieve about it\nAn iterator for derived script pubkeys.\nAn index storing TxOuts that have a script pubkey that …\nThe chain data is not confirmed and last seen in the …\nThe transaction is unconfirmed\nThe script pubkeys that are being tracked by the index.\nReturns the BlockId that the associated blockchain data is …\nThe anchor block.\nThe anchor block.\nAppend another object of the same type onto self.\nReturns a reference to the inner hash (sha256, sh256d …\nThe position of the transaction in outpoint in the overall …\nMaps a ChainPosition<&A> into a ChainPosition<A> by …\nThe exact confirmation height of the transaction.\nThe confirmation height of the transaction being anchored.\nGet the upper bound of the chain data’s confirmation …\nGet the upper bound of the chain data’s confirmation …\nDetermines the upper bound of the confirmation height.\nThe confirmation time of the transaction being anchored.\nGet a reference to the internal descriptor.\nReturns the descriptor id, calculated as the sha256 of the …\nReturns the minimum value (in satoshis) at which an output …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct the anchor from a given block, block height and …\nCreates this wrapper type from the inner hash type.\nGet the best chain’s chain tip.\nThe hash of the block.\nThe height of the block.\nReturns the index associated with the script pubkey.\nContains the IndexedTxGraph and associated types. Refer to …\nAdds a script pubkey to scan for. Returns false and does …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nDetermines whether block of BlockId exists as an ancestor …\nReturns whether ChainPosition is confirmed or not.\nReturns whether ConfirmationTime is the confirmed variant.\nWhether the utxo is/was/will be spendable with chain tip.\nReturns whether the structure is considered empty.\nWhether the txout is considered mature.\nWhether this output is on a coinbase transaction.\nWhether any of the inputs of this transaction spend a …\nReturns whether the script pubkey at index has been used …\nModule for keychain related structures.\nThe LocalChain is a local implementation of ChainOracle.\nMarks the script pubkey at index as used even though it …\nComputes the net value transfer effect of tx on the script …\nCreate a new script pubkey iterator from descriptor.\nCreate a new script pubkey iterator from descriptor and a …\nThe location of the TxOut.\nGet a reference to the set of indexed outpoints.\nIterates over all the outputs with script pubkeys in an …\nScans a transaction’s outputs for matching script …\nScan a single TxOut for a matching script pubkey and …\nComputes the total value transfer effect tx has on the …\nThe txid and chain position of the transaction (if any) …\nReturns the script that has been inserted at the index.\nHelper types for spk-based blockchain clients.\nReturns the inner hash (sha256, sh256d etc.).\nModule for structures that store and traverse transactions.\nReturns the txout and script pubkey index of the TxOut at …\nThe TxOut.\nIterate over all known txouts that spend to tracked script …\nFinds all txouts on a transaction that has previously been …\nConstruct an unconfirmed variant using the given last_seen …\nUndoes the effect of mark_used. Returns whether the index …\nIterates over all unused script pubkeys in an index range.\nConfirmation height.\nThe last-seen timestamp in unix seconds.\nConfirmation time in unix seconds.\nRepresents changes to an IndexedTxGraph.\nThe resultant “changeset” when new transaction data is …\nThe IndexedTxGraph combines a TxGraph and an Indexer …\nUtilities for indexing transaction data.\nBatch insert all transactions of the given block of height.\nBatch insert all transactions of the given block of height…\nApply changeset to itself.\nApplies the ChangeSet to the IndexedTxGraph.\nApply an update directly.\nBatch insert transactions, filtering out those that are …\nBatch insert unconfirmed transactions, filtering out those …\nBatch insert unconfirmed transactions.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGet a reference of the internal transaction graph.\nTxGraph changeset.\nTransaction index.\nScans a transaction for relevant outpoints, which are …\nScan and index the given outpoint and txout.\nIndexer changeset.\nDetermines the ChangeSet between self and an empty Indexer.\nDetermines the ChangeSet between self and an empty …\nInsert an anchor for a given transaction.\nInsert a unix timestamp of when a transaction is seen in …\nInsert and index a transaction into the graph.\nInsert a floating txout of given outpoint.\nCalls U::from(self).\nCalls U::from(self).\nDetermines whether the transaction should be included in …\nConstruct a new IndexedTxGraph with a given index.\nBalance, differentiated into various categories.\nRepresents updates to the derivation index of a …\nKeychainTxOutIndex controls how script pubkeys are …\nGet unbounded spk iterators for all keychains.\nAppend another ChangeSet into self.\nApplies the derivation changeset to the KeychainTxOutIndex…\nConfirmed and immediately spendable balance\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGets the descriptor associated with the keychain. Returns …\nAll coinbase outputs not yet matured\nReturns the keychain and keychain index associated with …\nReturn a reference to the internal SpkTxOutIndex.\nInsert a descriptor with a keychain associated to it.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nReturns whether the changeset are empty.\nReturns whether the spk under the keychain’s index has …\nIterate over all OutPoints that have TxOuts with script …\nIterate over OutPoints that have script pubkeys derived …\nReturn the map of the keychain to descriptors.\nContains the keychains that have been added and their …\nContains for each descriptor_id the last revealed index of …\nGet the last derivation index revealed for keychain. …\nGet the last derivation index that is revealed for each …\nReturns the highest derivation index of the keychain where …\nReturns the highest derivation index of each keychain that …\nGet the lookahead setting.\nStore lookahead scripts until target_index (inclusive).\nMarks the script pubkey at index as used even though the …\nComputes the net value that this transaction gives to the …\nConstruct a KeychainTxOutIndex with the given lookahead.\nGet the next derivation index for keychain. The next index …\nGets the next unused script pubkey in the keychain. I.e., …\nGet the set of indexed outpoints, corresponding to tracked …\nAttempts to reveal the next script pubkey for keychain.\nReveals script pubkeys of the keychain’s descriptor up …\nConvenience method to call Self::reveal_to_target on …\nIterate over revealed spks of the given keychain.\nIterate over revealed spks of keychains in range\nComputes the total value transfer effect tx has on the …\nReturn the script that exists under the given keychain’s …\nGet the whole balance visible to the wallet.\nUnconfirmed UTXOs generated by a wallet tx\nGet sum of trusted_pending and confirmed coins.\nReturn the TxOut of outpoint if it has been indexed, and …\nIterate over known txouts that spend to tracked script …\nFinds all txouts on a transaction that has previously been …\nGet an unbounded spk iterator over a given keychain. …\nUndoes the effect of mark_used. Returns whether the index …\nUnconfirmed UTXOs received from an external wallet\nIterate over revealed, but unused, spks of the given …\nIterate over revealed, but unused, spks of all keychains.\nRepresents a failure when trying to insert/remove a …\nThe error type for LocalChain::apply_header_connected_to.\nOccurs when the update cannot connect with the original …\nOccurs when an update does not have a common checkpoint …\nThe ChangeSet represents changes to LocalChain.\nA LocalChain checkpoint is used to find the agreement …\nIterates over checkpoints backwards.\nOccurs when connected_to block conflicts with either the …\nThis is a local implementation of ChainOracle.\nAn error which occurs when a LocalChain is constructed …\nApply the given changeset.\nUpdate the chain with a given Header connecting it with …\nUpdate the chain with a given Header at height which you …\nApplies the given update to the chain.\nGet the BlockId of the checkpoint.\nRemoves blocks from (and inclusive of) the given block_id.\nExtends the checkpoint linked list by a iterator of block …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct a checkpoint from a list of BlockIds in …\nConstructs a LocalChain from a BTreeMap of height to …\nConstruct a LocalChain from an initial changeset.\nConstruct LocalChain from genesis hash.\nConstruct a checkpoint from the given header and block …\nConstruct a LocalChain from a given checkpoint tip.\nGet the genesis hash.\nGet checkpoint at height.\nGet checkpoint at given height (if it exists).\nGet the block hash of the checkpoint.\nGet the height of the checkpoint.\nThe checkpoint’s height.\nDerives an initial ChangeSet, meaning that it can be …\nInserts block_id at its height within the chain.\nInsert a BlockId.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nIterate from this checkpoint in descending height.\nIterate over checkpoints in descending height order.\nConstruct a new base block at the front of a linked list.\nThe original checkpoint’s block hash which cannot be …\nGet the previous checkpoint in the chain\nPuts another checkpoint onto the linked list representing …\nIterate checkpoints over a height range.\nIterate checkpoints over a height range.\nGet the highest checkpoint.\nThe suggested checkpoint to include to connect the two …\nThe attempted update to the original_block hash.\nData required to perform a spk-based blockchain client …\nData returned from a spk-based blockchain client full scan.\nData required to perform a spk-based blockchain client …\nData returned from a spk-based blockchain client sync.\nA cache of Arc-wrapped full transactions, identified by …\nAdd all transactions from TxGraph into the TxCache.\nAdd all transactions from TxGraph into the TxCache.\nAdd to the TxCache held by the request.\nAdd to the TxCache held by the request.\nChain on additional OutPoints that will be synced against.\nChain on additional Scripts that will be synced against.\nChain on additional Scripts that will be synced against.\nA checkpoint for the current chain LocalChain::tip. The …\nA checkpoint for the current LocalChain::tip. The full …\nChain on additional Txids that will be synced against.\nThe update to apply to the receiving LocalChain.\nThe update to apply to the receiving TxGraph.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct a new SyncRequest from a given cp tip.\nConstruct a new FullScanRequest from a given chain_tip.\nConstruct a new FullScanRequest from a given chain_tip and …\nThe update to apply to the receiving TxGraph.\nThe update to apply to the receiving LocalChain.\nAdd a closure that will be called for OutPoints previously …\nAdd a closure that will be called for Scripts previously …\nAdd a closure that will be called for every Script …\nAdd a closure that will be called for every Script …\nAdd a closure that will be called for Txids previously …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nLast active indices for the corresponding keychains (K).\nTransactions with these outpoints or spent from these …\nPopulate the request with revealed script pubkeys from …\nSet the OutPoints that will be synced against.\nSet the Scripts that will be synced against.\nSet the Scripts for a given keychain.\nSet the Txids that will be synced against.\nTransactions that spend from or to these indexed script …\nIterators of script pubkeys indexed by the keychain index.\nCache of full transactions, so the chain-source can avoid …\nCache of full transactions, so the chain-source can avoid …\nTransactions with these txids.\nErrors returned by TxGraph::calculate_fee.\nA transaction that is included in the chain, or is still …\nThe ChangeSet represents changes to a TxGraph.\nMissing TxOut for one or more of the inputs of the tx\nWhen the transaction is invalid according to the graph it …\nAn iterator that traverses ancestors of a given root …\nAn iterator that traverses transaction descendants.\nA graph of transactions and spends.\nA transaction node in the TxGraph.\nGet all transaction anchors known by TxGraph.\nIterate over all tx outputs known by TxGraph.\nIterates over the heights of that the new transaction …\nThe blocks that the transaction is “anchored” in.\nAdded anchors.\nApplies ChangeSet to TxGraph.\nExtends this graph with another so that self becomes the …\nGet the total balance of outpoints that are in chain of …\nBatch insert unconfirmed transactions.\nCalculates the fee of a given transaction. Returns …\nHow the transaction is observed as (confirmed or …\nGiven a transaction, return an iterator of txids that …\nGet a filtered list of outputs from the given outpoints …\nGet a filtered list of unspent outputs (UTXOs) from the …\nIterate over floating txouts known by TxGraph.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nIterate over all full transactions in the graph.\nGet the position of the transaction in chain with tip …\nGet the txid of the spending transaction and where the …\nGet a transaction by txid. This only returns Some for full …\nGet a transaction node by txid. This only returns Some for …\nObtains a single tx output (if any) at the specified …\nDetermines the ChangeSet between self and an empty TxGraph.\nInserts the given anchor into TxGraph.\nInserts the given seen_at for txid into TxGraph.\nInserts the given transaction into TxGraph.\nInserts the given TxOut at OutPoint.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether the graph has any transactions or outputs in it.\nAdded last-seen unix timestamps of transactions.\nThe last-seen unix timestamp of the transaction as …\nList graph transactions that are in chain with chain_tip.\nTransform the TxGraph to have Anchors of another type.\nTransform the ChangeSet to have Anchors of another type.\nConstruct a new TxGraph from a list of transactions.\nThe transactions spending from this output.\nGet the total balance of outpoints that are in chain of …\nGet a filtered list of outputs from the given outpoints …\nGet a filtered list of unspent outputs (UTXOs) from the …\nGet the position of the transaction in chain with tip …\nGet the txid of the spending transaction and where the …\nList graph transactions that are in chain with chain_tip.\nA partial or full representation of the transaction.\nThe transaction node (as part of the graph).\nReturns known outputs of a given txid.\nIterates over the transactions spending from txid.\nTxid of the transaction.\nIterates over all outpoints contained within ChangeSet.\nAdded txouts.\nAdded transactions.\nUpdate the last seen time for all unconfirmed transactions.\nCreates an iterator that filters and maps ancestor …\nCreates an iterator that both filters and maps conflicting …\nCreates an iterator that filters and maps descendants from …") \ No newline at end of file +searchState.loadedDescShard("bdk_chain", 0, "This crate is a collection of core structures for Bitcoin …\nTrait that “anchors” blockchain data to a specific …\nAn Anchor that can be constructed from a given block, …\nTrait that makes an object appendable.\nMaximum BIP32 derivation index.\nA reference to a block in the canonical chain.\nHow many confirmations are needed f or a coinbase output …\nRepresents a service that tracks the blockchain.\nRepresents the observed position of some chain data.\nAn Anchor implementation that also records the exact …\nBlock height and timestamp at which a transaction is …\nAn Anchor implementation that also records the exact …\nThe chain data is seen as confirmed, and in anchored by A.\nThe transaction is confirmed\nA trait to extend the functionality of a miniscript …\nRepresents the ID of a descriptor, defined as the sha256 …\nError type.\nA TxOut with as much data as we can retrieve about it\nAn iterator for derived script pubkeys.\nAn index storing TxOuts that have a script pubkey that …\nThe chain data is not confirmed and last seen in the …\nThe transaction is unconfirmed\nThe script pubkeys that are being tracked by the index.\nReturns the BlockId that the associated blockchain data is …\nThe anchor block.\nThe anchor block.\nAppend another object of the same type onto self.\nReturns a reference to the inner hash (sha256, sh256d …\nThe position of the transaction in outpoint in the overall …\nMaps a ChainPosition<&A> into a ChainPosition<A> by …\nThe exact confirmation height of the transaction.\nThe confirmation height of the transaction being anchored.\nGet the upper bound of the chain data’s confirmation …\nGet the upper bound of the chain data’s confirmation …\nDetermines the upper bound of the confirmation height.\nThe confirmation time of the transaction being anchored.\nGet a reference to the internal descriptor.\nReturns the descriptor id, calculated as the sha256 of the …\nReturns the minimum value (in satoshis) at which an output …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct the anchor from a given block, block height and …\nCreates this wrapper type from the inner hash type.\nGet the best chain’s chain tip.\nThe hash of the block.\nThe height of the block.\nReturns the index associated with the script pubkey.\nContains the IndexedTxGraph and associated types. Refer to …\nAdds a script pubkey to scan for. Returns false and does …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nDetermines whether block of BlockId exists as an ancestor …\nReturns whether ChainPosition is confirmed or not.\nReturns whether ConfirmationTime is the confirmed variant.\nWhether the utxo is/was/will be spendable with chain tip.\nReturns whether the structure is considered empty.\nWhether the txout is considered mature.\nWhether this output is on a coinbase transaction.\nWhether any of the inputs of this transaction spend a …\nReturns whether the script pubkey at index has been used …\nModule for keychain related structures.\nThe LocalChain is a local implementation of ChainOracle.\nMarks the script pubkey at index as used even though it …\nComputes the net value transfer effect of tx on the script …\nCreate a new script pubkey iterator from descriptor.\nCreate a new script pubkey iterator from descriptor and a …\nThe location of the TxOut.\nGet a reference to the set of indexed outpoints.\nIterates over all the outputs with script pubkeys in an …\nScans a transaction’s outputs for matching script …\nScan a single TxOut for a matching script pubkey and …\nComputes the total value transfer effect tx has on the …\nThe txid and chain position of the transaction (if any) …\nReturns the script that has been inserted at the index.\nHelper types for spk-based blockchain clients.\nReturns the inner hash (sha256, sh256d etc.).\nModule for structures that store and traverse transactions.\nReturns the txout and script pubkey index of the TxOut at …\nThe TxOut.\nIterate over all known txouts that spend to tracked script …\nFinds all txouts on a transaction that has previously been …\nConstruct an unconfirmed variant using the given last_seen …\nUndoes the effect of mark_used. Returns whether the index …\nIterates over all unused script pubkeys in an index range.\nConfirmation height.\nThe last-seen timestamp in unix seconds.\nConfirmation time in unix seconds.\nRepresents changes to an IndexedTxGraph.\nThe resultant “changeset” when new transaction data is …\nThe IndexedTxGraph combines a TxGraph and an Indexer …\nUtilities for indexing transaction data.\nBatch insert all transactions of the given block of height.\nBatch insert all transactions of the given block of height…\nApply changeset to itself.\nApplies the ChangeSet to the IndexedTxGraph.\nApply an update directly.\nBatch insert transactions, filtering out those that are …\nBatch insert unconfirmed transactions, filtering out those …\nBatch insert unconfirmed transactions.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGet a reference of the internal transaction graph.\nTxGraph changeset.\nTransaction index.\nScans a transaction for relevant outpoints, which are …\nScan and index the given outpoint and txout.\nIndexer changeset.\nDetermines the ChangeSet between self and an empty Indexer.\nDetermines the ChangeSet between self and an empty …\nInsert an anchor for a given transaction.\nInsert a unix timestamp of when a transaction is seen in …\nInsert and index a transaction into the graph.\nInsert a floating txout of given outpoint.\nCalls U::from(self).\nCalls U::from(self).\nDetermines whether the transaction should be included in …\nConstruct a new IndexedTxGraph with a given index.\nBalance, differentiated into various categories.\nRepresents updates to the derivation index of a …\nKeychainTxOutIndex controls how script pubkeys are …\nGet unbounded spk iterators for all keychains.\nAppend another ChangeSet into self.\nApplies the derivation changeset to the KeychainTxOutIndex…\nConfirmed and immediately spendable balance\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGets the descriptor associated with the keychain. Returns …\nAll coinbase outputs not yet matured\nReturns the keychain and keychain index associated with …\nReturn a reference to the internal SpkTxOutIndex.\nInsert a descriptor with a keychain associated to it.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nReturns whether the changeset are empty.\nReturns whether the spk under the keychain’s index has …\nIterate over all OutPoints that have TxOuts with script …\nIterate over OutPoints that have script pubkeys derived …\nReturn the map of the keychain to descriptors.\nContains the keychains that have been added and their …\nContains for each descriptor_id the last revealed index of …\nGet the last derivation index revealed for keychain. …\nGet the last derivation index that is revealed for each …\nReturns the highest derivation index of the keychain where …\nReturns the highest derivation index of each keychain that …\nGet the lookahead setting.\nStore lookahead scripts until target_index (inclusive).\nMarks the script pubkey at index as used even though the …\nComputes the net value that this transaction gives to the …\nConstruct a KeychainTxOutIndex with the given lookahead.\nGet the next derivation index for keychain. The next index …\nGets the next unused script pubkey in the keychain. I.e., …\nGet the set of indexed outpoints, corresponding to tracked …\nAttempts to reveal the next script pubkey for keychain.\nReveals script pubkeys of the keychain’s descriptor up …\nConvenience method to call Self::reveal_to_target on …\nIterate over revealed spks of the given keychain.\nIterate over revealed spks of keychains in range\nComputes the total value transfer effect tx has on the …\nReturn the script that exists under the given keychain’s …\nGet the whole balance visible to the wallet.\nUnconfirmed UTXOs generated by a wallet tx\nGet sum of trusted_pending and confirmed coins.\nReturn the TxOut of outpoint if it has been indexed, and …\nIterate over known txouts that spend to tracked script …\nFinds all txouts on a transaction that has previously been …\nGet an unbounded spk iterator over a given keychain. …\nUndoes the effect of mark_used. Returns whether the index …\nUnconfirmed UTXOs received from an external wallet\nIterate over revealed, but unused, spks of the given …\nIterate over revealed, but unused, spks of all keychains.\nRepresents a failure when trying to insert/remove a …\nThe error type for LocalChain::apply_header_connected_to.\nOccurs when the update cannot connect with the original …\nOccurs when an update does not have a common checkpoint …\nThe ChangeSet represents changes to LocalChain.\nA LocalChain checkpoint is used to find the agreement …\nIterates over checkpoints backwards.\nOccurs when connected_to block conflicts with either the …\nThis is a local implementation of ChainOracle.\nAn error which occurs when a LocalChain is constructed …\nApply the given changeset.\nUpdate the chain with a given Header connecting it with …\nUpdate the chain with a given Header at height which you …\nApplies the given update to the chain.\nGet the BlockId of the checkpoint.\nRemoves blocks from (and inclusive of) the given block_id.\nExtends the checkpoint linked list by a iterator of block …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct a checkpoint from a list of BlockIds in …\nConstructs a LocalChain from a BTreeMap of height to …\nConstruct a LocalChain from an initial changeset.\nConstruct LocalChain from genesis hash.\nConstruct a checkpoint from the given header and block …\nConstruct a LocalChain from a given checkpoint tip.\nGet the genesis hash.\nGet checkpoint at height.\nGet checkpoint at given height (if it exists).\nGet the block hash of the checkpoint.\nGet the height of the checkpoint.\nThe checkpoint’s height.\nDerives an initial ChangeSet, meaning that it can be …\nInserts block_id at its height within the chain.\nInsert a BlockId.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nIterate from this checkpoint in descending height.\nIterate over checkpoints in descending height order.\nConstruct a new base block at the front of a linked list.\nThe original checkpoint’s block hash which cannot be …\nGet the previous checkpoint in the chain\nPuts another checkpoint onto the linked list representing …\nIterate checkpoints over a height range.\nIterate checkpoints over a height range.\nGet the highest checkpoint.\nThe suggested checkpoint to include to connect the two …\nThe attempted update to the original_block hash.\nData required to perform a spk-based blockchain client …\nData returned from a spk-based blockchain client full scan.\nData required to perform a spk-based blockchain client …\nData returned from a spk-based blockchain client sync.\nChain on additional OutPoints that will be synced against.\nChain on additional Scripts that will be synced against.\nChain on additional Scripts that will be synced against.\nA checkpoint for the current chain LocalChain::tip. The …\nA checkpoint for the current LocalChain::tip. The full …\nChain on additional Txids that will be synced against.\nThe update to apply to the receiving LocalChain.\nThe update to apply to the receiving TxGraph.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct a new SyncRequest from a given cp tip.\nConstruct a new FullScanRequest from a given chain_tip.\nConstruct a new FullScanRequest from a given chain_tip and …\nThe update to apply to the receiving TxGraph.\nThe update to apply to the receiving LocalChain.\nAdd a closure that will be called for OutPoints previously …\nAdd a closure that will be called for Scripts previously …\nAdd a closure that will be called for every Script …\nAdd a closure that will be called for every Script …\nAdd a closure that will be called for Txids previously …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nLast active indices for the corresponding keychains (K).\nTransactions with these outpoints or spent from these …\nPopulate the request with revealed script pubkeys from …\nSet the OutPoints that will be synced against.\nSet the Scripts that will be synced against.\nSet the Scripts for a given keychain.\nSet the Txids that will be synced against.\nTransactions that spend from or to these indexed script …\nIterators of script pubkeys indexed by the keychain index.\nTransactions with these txids.\nErrors returned by TxGraph::calculate_fee.\nA transaction that is included in the chain, or is still …\nThe ChangeSet represents changes to a TxGraph.\nMissing TxOut for one or more of the inputs of the tx\nWhen the transaction is invalid according to the graph it …\nAn iterator that traverses ancestors of a given root …\nAn iterator that traverses transaction descendants.\nA graph of transactions and spends.\nA transaction node in the TxGraph.\nGet all transaction anchors known by TxGraph.\nIterate over all tx outputs known by TxGraph.\nIterates over the heights of that the new transaction …\nThe blocks that the transaction is “anchored” in.\nAdded anchors.\nApplies ChangeSet to TxGraph.\nExtends this graph with another so that self becomes the …\nGet the total balance of outpoints that are in chain of …\nBatch insert unconfirmed transactions.\nCalculates the fee of a given transaction. Returns …\nHow the transaction is observed as (confirmed or …\nGiven a transaction, return an iterator of txids that …\nGet a filtered list of outputs from the given outpoints …\nGet a filtered list of unspent outputs (UTXOs) from the …\nIterate over floating txouts known by TxGraph.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nIterate over all full transactions in the graph.\nGet the position of the transaction in chain with tip …\nGet the txid of the spending transaction and where the …\nGet a transaction by txid. This only returns Some for full …\nGet a transaction node by txid. This only returns Some for …\nObtains a single tx output (if any) at the specified …\nDetermines the ChangeSet between self and an empty TxGraph.\nInserts the given anchor into TxGraph.\nInserts the given seen_at for txid into TxGraph.\nInserts the given transaction into TxGraph.\nInserts the given TxOut at OutPoint.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether the graph has any transactions or outputs in it.\nAdded last-seen unix timestamps of transactions.\nThe last-seen unix timestamp of the transaction as …\nList graph transactions that are in chain with chain_tip.\nTransform the TxGraph to have Anchors of another type.\nTransform the ChangeSet to have Anchors of another type.\nConstruct a new TxGraph from a list of transactions.\nThe transactions spending from this output.\nGet the total balance of outpoints that are in chain of …\nGet a filtered list of outputs from the given outpoints …\nGet a filtered list of unspent outputs (UTXOs) from the …\nGet the position of the transaction in chain with tip …\nGet the txid of the spending transaction and where the …\nList graph transactions that are in chain with chain_tip.\nA partial or full representation of the transaction.\nThe transaction node (as part of the graph).\nReturns known outputs of a given txid.\nIterates over the transactions spending from txid.\nTxid of the transaction.\nIterates over all outpoints contained within ChangeSet.\nAdded txouts.\nAdded transactions.\nUpdate the last seen time for all unconfirmed transactions.\nCreates an iterator that filters and maps ancestor …\nCreates an iterator that both filters and maps conflicting …\nCreates an iterator that filters and maps descendants from …") \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/search.desc/bdk_electrum/bdk_electrum-desc-0-.js b/docs-rs/bdk/nightly/latest/search.desc/bdk_electrum/bdk_electrum-desc-0-.js index 1e38bb74a7..014b565309 100644 --- a/docs-rs/bdk/nightly/latest/search.desc/bdk_electrum/bdk_electrum-desc-0-.js +++ b/docs-rs/bdk/nightly/latest/search.desc/bdk_electrum/bdk_electrum-desc-0-.js @@ -1 +1 @@ -searchState.loadedDescShard("bdk_electrum", 0, "This crate is used for updating structures of bdk_chain …\nTrait to extend electrum_client::Client functionality.\nThe result of ElectrumExt::full_scan.\nThe result of ElectrumExt::sync.\nReturns the argument unchanged.\nReturns the argument unchanged.\nFull scan the keychain scripts specified with the …\nCalls U::from(self).\nCalls U::from(self).\nSync a set of scripts with the blockchain (via an Electrum …\nReturn FullScanResult with ConfirmationHeightAnchor.\nReturn SyncResult with ConfirmationHeightAnchor.\nReturn FullScanResult with ConfirmationTimeHeightAnchor.\nReturn SyncResult with ConfirmationTimeHeightAnchor.") \ No newline at end of file +searchState.loadedDescShard("bdk_electrum", 0, "This crate is used for updating structures of bdk_chain …\nWrapper around an electrum_client::ElectrumApi which …\nThe result of BdkElectrumClient::full_scan.\nThe result of BdkElectrumClient::sync.\nFetch transaction of given txid.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nFull scan the keychain scripts specified with the …\nThe internal electrum_client::ElectrumApi\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCreates a new bdk client from a …\nInserts transactions into the transaction cache so that …\nSync a set of scripts with the blockchain (via an Electrum …\nBroadcasts a transaction to the network.\nReturn FullScanResult with ConfirmationHeightAnchor.\nReturn SyncResult with ConfirmationHeightAnchor.\nReturn FullScanResult with ConfirmationTimeHeightAnchor.\nReturn SyncResult with ConfirmationTimeHeightAnchor.") \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/src-files.js b/docs-rs/bdk/nightly/latest/src-files.js index 56d02409dd..b17fe655c5 100644 --- a/docs-rs/bdk/nightly/latest/src-files.js +++ b/docs-rs/bdk/nightly/latest/src-files.js @@ -2,7 +2,7 @@ var srcIndex = new Map(JSON.parse('[\ ["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_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_electrum",["",[],["bdk_electrum_client.rs","lib.rs"]]],\ ["bdk_esplora",["",[],["async_ext.rs","blocking_ext.rs","lib.rs"]]],\ ["bdk_file_store",["",[],["entry_iter.rs","lib.rs","store.rs"]]],\ ["bdk_hwi",["",[],["lib.rs","signer.rs"]]],\ diff --git a/docs-rs/bdk/nightly/latest/src/bdk_chain/indexed_tx_graph.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_chain/indexed_tx_graph.rs.html index 05297f2d48..8630069cb2 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk_chain/indexed_tx_graph.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk_chain/indexed_tx_graph.rs.html @@ -352,6 +352,12 @@ 352 353 354 +355 +356 +357 +358 +359 +360
      //! Contains the [`IndexedTxGraph`] and associated types. Refer to the
       //! [`IndexedTxGraph`] documentation for more.
       use alloc::vec::Vec;
      @@ -706,4 +712,10 @@
           /// Determines whether the transaction should be included in the index.
           fn is_tx_relevant(&self, tx: &Transaction) -> bool;
       }
      +
      +impl<A, I> AsRef<TxGraph<A>> for IndexedTxGraph<A, I> {
      +    fn as_ref(&self) -> &TxGraph<A> {
      +        &self.graph
      +    }
      +}
       
    \ No newline at end of file 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 index b5674f7ead..754934a2d9 100644 --- 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 @@ -385,81 +385,15 @@ 385 386 387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446
    //! Helper types for spk-based blockchain clients.
     
     use crate::{
    -    collections::{BTreeMap, HashMap},
    -    local_chain::CheckPoint,
    -    ConfirmationTimeHeightAnchor, TxGraph,
    +    collections::BTreeMap, local_chain::CheckPoint, ConfirmationTimeHeightAnchor, TxGraph,
     };
    -use alloc::{boxed::Box, sync::Arc, vec::Vec};
    -use bitcoin::{OutPoint, Script, ScriptBuf, Transaction, Txid};
    +use alloc::{boxed::Box, vec::Vec};
    +use bitcoin::{OutPoint, Script, ScriptBuf, Txid};
     use core::{fmt::Debug, marker::PhantomData, ops::RangeBounds};
     
    -/// A cache of [`Arc`]-wrapped full transactions, identified by their [`Txid`]s.
    -///
    -/// This is used by the chain-source to avoid re-fetching full transactions.
    -pub type TxCache = HashMap<Txid, Arc<Transaction>>;
    -
     /// 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
    @@ -470,8 +404,6 @@
         ///
         /// [`LocalChain::tip`]: crate::local_chain::LocalChain::tip
         pub chain_tip: CheckPoint,
    -    /// Cache of full transactions, so the chain-source can avoid re-fetching.
    -    pub tx_cache: TxCache,
         /// Transactions that spend from or to these indexed script pubkeys.
         pub spks: Box<dyn ExactSizeIterator<Item = ScriptBuf> + Send>,
         /// Transactions with these txids.
    @@ -485,36 +417,12 @@
         pub fn from_chain_tip(cp: CheckPoint) -> Self {
             Self {
                 chain_tip: cp,
    -            tx_cache: TxCache::new(),
                 spks: Box::new(core::iter::empty()),
                 txids: Box::new(core::iter::empty()),
                 outpoints: Box::new(core::iter::empty()),
             }
         }
     
    -    /// Add to the [`TxCache`] held by the request.
    -    ///
    -    /// This consumes the [`SyncRequest`] and returns the updated one.
    -    #[must_use]
    -    pub fn cache_txs<T>(mut self, full_txs: impl IntoIterator<Item = (Txid, T)>) -> Self
    -    where
    -        T: Into<Arc<Transaction>>,
    -    {
    -        self.tx_cache = full_txs
    -            .into_iter()
    -            .map(|(txid, tx)| (txid, tx.into()))
    -            .collect();
    -        self
    -    }
    -
    -    /// Add all transactions from [`TxGraph`] into the [`TxCache`].
    -    ///
    -    /// This consumes the [`SyncRequest`] and returns the updated one.
    -    #[must_use]
    -    pub fn cache_graph_txs<A>(self, graph: &TxGraph<A>) -> Self {
    -        self.cache_txs(graph.full_txs().map(|tx_node| (tx_node.txid, tx_node.tx)))
    -    }
    -
         /// Set the [`Script`]s that will be synced against.
         ///
         /// This consumes the [`SyncRequest`] and returns the updated one.
    @@ -673,8 +581,6 @@
         ///
         /// [`LocalChain::tip`]: crate::local_chain::LocalChain::tip
         pub chain_tip: CheckPoint,
    -    /// Cache of full transactions, so the chain-source can avoid re-fetching.
    -    pub tx_cache: TxCache,
         /// Iterators of script pubkeys indexed by the keychain index.
         pub spks_by_keychain: BTreeMap<K, Box<dyn Iterator<Item = (u32, ScriptBuf)> + Send>>,
     }
    @@ -685,34 +591,10 @@
         pub fn from_chain_tip(chain_tip: CheckPoint) -> Self {
             Self {
                 chain_tip,
    -            tx_cache: TxCache::new(),
                 spks_by_keychain: BTreeMap::new(),
             }
         }
     
    -    /// Add to the [`TxCache`] held by the request.
    -    ///
    -    /// This consumes the [`SyncRequest`] and returns the updated one.
    -    #[must_use]
    -    pub fn cache_txs<T>(mut self, full_txs: impl IntoIterator<Item = (Txid, T)>) -> Self
    -    where
    -        T: Into<Arc<Transaction>>,
    -    {
    -        self.tx_cache = full_txs
    -            .into_iter()
    -            .map(|(txid, tx)| (txid, tx.into()))
    -            .collect();
    -        self
    -    }
    -
    -    /// Add all transactions from [`TxGraph`] into the [`TxCache`].
    -    ///
    -    /// This consumes the [`SyncRequest`] and returns the updated one.
    -    #[must_use]
    -    pub fn cache_graph_txs<A>(self, graph: &TxGraph<A>) -> Self {
    -        self.cache_txs(graph.full_txs().map(|tx_node| (tx_node.txid, tx_node.tx)))
    -    }
    -
         /// Construct a new [`FullScanRequest`] from a given `chain_tip` and `index`.
         ///
         /// Unbounded script pubkey iterators for each keychain (`K`) are extracted using
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_electrum/electrum_ext.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_electrum/bdk_electrum_client.rs.html
    similarity index 67%
    rename from docs-rs/bdk/nightly/latest/src/bdk_electrum/electrum_ext.rs.html
    rename to docs-rs/bdk/nightly/latest/src/bdk_electrum/bdk_electrum_client.rs.html
    index a919f05ad4..5193fe2b37 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_electrum/electrum_ext.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_electrum/bdk_electrum_client.rs.html
    @@ -1,4 +1,4 @@
    -electrum_ext.rs - source
    1
    +bdk_electrum_client.rs - source
    1
     2
     3
     4
    @@ -584,23 +584,83 @@
     584
     585
     586
    +587
    +588
    +589
     
    use bdk_chain::{
         bitcoin::{OutPoint, ScriptBuf, Transaction, Txid},
         collections::{BTreeMap, HashMap, HashSet},
         local_chain::CheckPoint,
    -    spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResult, TxCache},
    +    spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResult},
         tx_graph::TxGraph,
         BlockId, ConfirmationHeightAnchor, ConfirmationTimeHeightAnchor,
     };
     use core::str::FromStr;
     use electrum_client::{ElectrumApi, Error, HeaderNotification};
    -use std::sync::Arc;
    +use std::sync::{Arc, Mutex};
     
     /// We include a chain suffix of a certain length for the purpose of robustness.
     const CHAIN_SUFFIX_LENGTH: u32 = 8;
     
    -/// Trait to extend [`electrum_client::Client`] functionality.
    -pub trait ElectrumExt {
    +/// Wrapper around an [`electrum_client::ElectrumApi`] which includes an internal in-memory
    +/// transaction cache to avoid re-fetching already downloaded transactions.
    +#[derive(Debug)]
    +pub struct BdkElectrumClient<E> {
    +    /// The internal [`electrum_client::ElectrumApi`]
    +    pub inner: E,
    +    /// The transaction cache
    +    tx_cache: Mutex<HashMap<Txid, Arc<Transaction>>>,
    +}
    +
    +impl<E: ElectrumApi> BdkElectrumClient<E> {
    +    /// Creates a new bdk client from a [`electrum_client::ElectrumApi`]
    +    pub fn new(client: E) -> Self {
    +        Self {
    +            inner: client,
    +            tx_cache: Default::default(),
    +        }
    +    }
    +
    +    /// Inserts transactions into the transaction cache so that the client will not fetch these
    +    /// transactions.
    +    pub fn populate_tx_cache<A>(&self, tx_graph: impl AsRef<TxGraph<A>>) {
    +        let txs = tx_graph
    +            .as_ref()
    +            .full_txs()
    +            .map(|tx_node| (tx_node.txid, tx_node.tx));
    +
    +        let mut tx_cache = self.tx_cache.lock().unwrap();
    +        for (txid, tx) in txs {
    +            tx_cache.insert(txid, tx);
    +        }
    +    }
    +
    +    /// Fetch transaction of given `txid`.
    +    ///
    +    /// If it hits the cache it will return the cached version and avoid making the request.
    +    pub fn fetch_tx(&self, txid: Txid) -> Result<Arc<Transaction>, Error> {
    +        let tx_cache = self.tx_cache.lock().unwrap();
    +
    +        if let Some(tx) = tx_cache.get(&txid) {
    +            return Ok(Arc::clone(tx));
    +        }
    +
    +        drop(tx_cache);
    +
    +        let tx = Arc::new(self.inner.transaction_get(&txid)?);
    +
    +        self.tx_cache.lock().unwrap().insert(txid, Arc::clone(&tx));
    +
    +        Ok(tx)
    +    }
    +
    +    /// Broadcasts a transaction to the network.
    +    ///
    +    /// This is a re-export of [`ElectrumApi::transaction_broadcast`].
    +    pub fn transaction_broadcast(&self, tx: &Transaction) -> Result<Txid, Error> {
    +        self.inner.transaction_broadcast(tx)
    +    }
    +
         /// Full scan the keychain scripts specified with the blockchain (via an Electrum client) and
         /// returns updates for [`bdk_chain`] data structures.
         ///
    @@ -611,44 +671,12 @@
         /// - `batch_size`: specifies the max number of script pubkeys to request for in a single batch
         ///              request
         /// - `fetch_prev_txouts`: specifies whether or not we want previous `TxOut`s for fee
    -    ///              calculation
    -    fn full_scan<K: Ord + Clone>(
    +    pub fn full_scan<K: Ord + Clone>(
             &self,
             request: FullScanRequest<K>,
             stop_gap: usize,
             batch_size: usize,
             fetch_prev_txouts: bool,
    -    ) -> Result<ElectrumFullScanResult<K>, Error>;
    -
    -    /// Sync a set of scripts with the blockchain (via an Electrum client) for the data specified
    -    /// and returns updates for [`bdk_chain`] data structures.
    -    ///
    -    /// - `request`: struct with data required to perform a spk-based blockchain client sync,
    -    ///              see [`SyncRequest`]
    -    /// - `batch_size`: specifies the max number of script pubkeys to request for in a single batch
    -    ///              request
    -    /// - `fetch_prev_txouts`: specifies whether or not we want previous `TxOut`s for fee
    -    ///              calculation
    -    ///
    -    /// 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.
    -    ///
    -    /// [`full_scan`]: ElectrumExt::full_scan
    -    fn sync(
    -        &self,
    -        request: SyncRequest,
    -        batch_size: usize,
    -        fetch_prev_txouts: bool,
    -    ) -> Result<ElectrumSyncResult, Error>;
    -}
    -
    -impl<E: ElectrumApi> ElectrumExt for E {
    -    fn full_scan<K: Ord + Clone>(
    -        &self,
    -        mut request: FullScanRequest<K>,
    -        stop_gap: usize,
    -        batch_size: usize,
    -        fetch_prev_txouts: bool,
         ) -> Result<ElectrumFullScanResult<K>, Error> {
             let mut request_spks = request.spks_by_keychain;
     
    @@ -661,7 +689,7 @@
             let mut scanned_spks = BTreeMap::<(K, u32), (ScriptBuf, bool)>::new();
     
             let update = loop {
    -            let (tip, _) = construct_update_tip(self, request.chain_tip.clone())?;
    +            let (tip, _) = construct_update_tip(&self.inner, request.chain_tip.clone())?;
                 let mut graph_update = TxGraph::<ConfirmationHeightAnchor>::default();
                 let cps = tip
                     .iter()
    @@ -671,24 +699,22 @@
     
                 if !request_spks.is_empty() {
                     if !scanned_spks.is_empty() {
    -                    scanned_spks.append(&mut populate_with_spks(
    -                        self,
    -                        &cps,
    -                        &mut request.tx_cache,
    -                        &mut graph_update,
    -                        &mut scanned_spks
    -                            .iter()
    -                            .map(|(i, (spk, _))| (i.clone(), spk.clone())),
    -                        stop_gap,
    -                        batch_size,
    -                    )?);
    +                    scanned_spks.append(
    +                        &mut self.populate_with_spks(
    +                            &cps,
    +                            &mut graph_update,
    +                            &mut scanned_spks
    +                                .iter()
    +                                .map(|(i, (spk, _))| (i.clone(), spk.clone())),
    +                            stop_gap,
    +                            batch_size,
    +                        )?,
    +                    );
                     }
                     for (keychain, keychain_spks) in &mut request_spks {
                         scanned_spks.extend(
    -                        populate_with_spks(
    -                            self,
    +                        self.populate_with_spks(
                                 &cps,
    -                            &mut request.tx_cache,
                                 &mut graph_update,
                                 keychain_spks,
                                 stop_gap,
    @@ -701,14 +727,14 @@
                 }
     
                 // check for reorgs during scan process
    -            let server_blockhash = self.block_header(tip.height() as usize)?.block_hash();
    +            let server_blockhash = self.inner.block_header(tip.height() as usize)?.block_hash();
                 if tip.hash() != server_blockhash {
                     continue; // reorg
                 }
     
                 // Fetch previous `TxOut`s for fee calculation if flag is enabled.
                 if fetch_prev_txouts {
    -                fetch_prev_txout(self, &mut request.tx_cache, &mut graph_update)?;
    +                self.fetch_prev_txout(&mut graph_update)?;
                 }
     
                 let chain_update = tip;
    @@ -734,46 +760,45 @@
             Ok(ElectrumFullScanResult(update))
         }
     
    -    fn sync(
    +    /// Sync a set of scripts with the blockchain (via an Electrum client) for the data specified
    +    /// and returns updates for [`bdk_chain`] data structures.
    +    ///
    +    /// - `request`: struct with data required to perform a spk-based blockchain client sync,
    +    ///              see [`SyncRequest`]
    +    /// - `batch_size`: specifies the max number of script pubkeys to request for in a single batch
    +    ///              request
    +    /// - `fetch_prev_txouts`: specifies whether or not we want previous `TxOut`s for fee
    +    ///              calculation
    +    ///
    +    /// 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.
    +    ///
    +    /// [`full_scan`]: Self::full_scan
    +    pub fn sync(
             &self,
             request: SyncRequest,
             batch_size: usize,
             fetch_prev_txouts: bool,
         ) -> Result<ElectrumSyncResult, Error> {
    -        let mut tx_cache = request.tx_cache.clone();
    -
             let full_scan_req = FullScanRequest::from_chain_tip(request.chain_tip.clone())
    -            .cache_txs(request.tx_cache)
                 .set_spks_for_keychain((), request.spks.enumerate().map(|(i, spk)| (i as u32, spk)));
             let mut full_scan_res = self
                 .full_scan(full_scan_req, usize::MAX, batch_size, false)?
                 .with_confirmation_height_anchor();
     
    -        let (tip, _) = construct_update_tip(self, request.chain_tip)?;
    +        let (tip, _) = construct_update_tip(&self.inner, request.chain_tip)?;
             let cps = tip
                 .iter()
                 .take(10)
                 .map(|cp| (cp.height(), cp))
                 .collect::<BTreeMap<u32, CheckPoint>>();
     
    -        populate_with_txids(
    -            self,
    -            &cps,
    -            &mut tx_cache,
    -            &mut full_scan_res.graph_update,
    -            request.txids,
    -        )?;
    -        populate_with_outpoints(
    -            self,
    -            &cps,
    -            &mut tx_cache,
    -            &mut full_scan_res.graph_update,
    -            request.outpoints,
    -        )?;
    +        self.populate_with_txids(&cps, &mut full_scan_res.graph_update, request.txids)?;
    +        self.populate_with_outpoints(&cps, &mut full_scan_res.graph_update, request.outpoints)?;
     
             // Fetch previous `TxOut`s for fee calculation if flag is enabled.
             if fetch_prev_txouts {
    -            fetch_prev_txout(self, &mut tx_cache, &mut full_scan_res.graph_update)?;
    +            self.fetch_prev_txout(&mut full_scan_res.graph_update)?;
             }
     
             Ok(ElectrumSyncResult(SyncResult {
    @@ -781,9 +806,180 @@
                 graph_update: full_scan_res.graph_update,
             }))
         }
    +
    +    /// Populate the `graph_update` with transactions/anchors associated with the given `spks`.
    +    ///
    +    /// Transactions that contains an output with requested spk, or spends form an output with
    +    /// requested spk will be added to `graph_update`. Anchors of the aforementioned transactions are
    +    /// also included.
    +    ///
    +    /// Checkpoints (in `cps`) are used to create anchors. The `tx_cache` is self-explanatory.
    +    fn populate_with_spks<I: Ord + Clone>(
    +        &self,
    +        cps: &BTreeMap<u32, CheckPoint>,
    +        graph_update: &mut TxGraph<ConfirmationHeightAnchor>,
    +        spks: &mut impl Iterator<Item = (I, ScriptBuf)>,
    +        stop_gap: usize,
    +        batch_size: usize,
    +    ) -> Result<BTreeMap<I, (ScriptBuf, bool)>, Error> {
    +        let mut unused_spk_count = 0_usize;
    +        let mut scanned_spks = BTreeMap::new();
    +
    +        loop {
    +            let spks = (0..batch_size)
    +                .map_while(|_| spks.next())
    +                .collect::<Vec<_>>();
    +            if spks.is_empty() {
    +                return Ok(scanned_spks);
    +            }
    +
    +            let spk_histories = self
    +                .inner
    +                .batch_script_get_history(spks.iter().map(|(_, s)| s.as_script()))?;
    +
    +            for ((spk_index, spk), spk_history) in spks.into_iter().zip(spk_histories) {
    +                if spk_history.is_empty() {
    +                    scanned_spks.insert(spk_index, (spk, false));
    +                    unused_spk_count += 1;
    +                    if unused_spk_count > stop_gap {
    +                        return Ok(scanned_spks);
    +                    }
    +                    continue;
    +                } else {
    +                    scanned_spks.insert(spk_index, (spk, true));
    +                    unused_spk_count = 0;
    +                }
    +
    +                for tx_res in spk_history {
    +                    let _ = graph_update.insert_tx(self.fetch_tx(tx_res.tx_hash)?);
    +                    if let Some(anchor) = determine_tx_anchor(cps, tx_res.height, tx_res.tx_hash) {
    +                        let _ = graph_update.insert_anchor(tx_res.tx_hash, anchor);
    +                    }
    +                }
    +            }
    +        }
    +    }
    +
    +    // Helper function which fetches the `TxOut`s of our relevant transactions' previous transactions,
    +    // which we do not have by default. This data is needed to calculate the transaction fee.
    +    fn fetch_prev_txout(
    +        &self,
    +        graph_update: &mut TxGraph<ConfirmationHeightAnchor>,
    +    ) -> Result<(), Error> {
    +        let full_txs: Vec<Arc<Transaction>> =
    +            graph_update.full_txs().map(|tx_node| tx_node.tx).collect();
    +        for tx in full_txs {
    +            for vin in &tx.input {
    +                let outpoint = vin.previous_output;
    +                let vout = outpoint.vout;
    +                let prev_tx = self.fetch_tx(outpoint.txid)?;
    +                let txout = prev_tx.output[vout as usize].clone();
    +                let _ = graph_update.insert_txout(outpoint, txout);
    +            }
    +        }
    +        Ok(())
    +    }
    +
    +    /// Populate the `graph_update` with associated transactions/anchors of `outpoints`.
    +    ///
    +    /// Transactions in which the outpoint resides, and transactions that spend from the outpoint are
    +    /// included. Anchors of the aforementioned transactions are included.
    +    ///
    +    /// Checkpoints (in `cps`) are used to create anchors. The `tx_cache` is self-explanatory.
    +    fn populate_with_outpoints(
    +        &self,
    +        cps: &BTreeMap<u32, CheckPoint>,
    +        graph_update: &mut TxGraph<ConfirmationHeightAnchor>,
    +        outpoints: impl IntoIterator<Item = OutPoint>,
    +    ) -> Result<(), Error> {
    +        for outpoint in outpoints {
    +            let op_txid = outpoint.txid;
    +            let op_tx = self.fetch_tx(op_txid)?;
    +            let op_txout = match op_tx.output.get(outpoint.vout as usize) {
    +                Some(txout) => txout,
    +                None => continue,
    +            };
    +            debug_assert_eq!(op_tx.txid(), op_txid);
    +
    +            // attempt to find the following transactions (alongside their chain positions), and
    +            // add to our sparsechain `update`:
    +            let mut has_residing = false; // tx in which the outpoint resides
    +            let mut has_spending = false; // tx that spends the outpoint
    +            for res in self.inner.script_get_history(&op_txout.script_pubkey)? {
    +                if has_residing && has_spending {
    +                    break;
    +                }
    +
    +                if !has_residing && res.tx_hash == op_txid {
    +                    has_residing = true;
    +                    let _ = graph_update.insert_tx(Arc::clone(&op_tx));
    +                    if let Some(anchor) = determine_tx_anchor(cps, res.height, res.tx_hash) {
    +                        let _ = graph_update.insert_anchor(res.tx_hash, anchor);
    +                    }
    +                }
    +
    +                if !has_spending && res.tx_hash != op_txid {
    +                    let res_tx = self.fetch_tx(res.tx_hash)?;
    +                    // we exclude txs/anchors that do not spend our specified outpoint(s)
    +                    has_spending = res_tx
    +                        .input
    +                        .iter()
    +                        .any(|txin| txin.previous_output == outpoint);
    +                    if !has_spending {
    +                        continue;
    +                    }
    +                    let _ = graph_update.insert_tx(Arc::clone(&res_tx));
    +                    if let Some(anchor) = determine_tx_anchor(cps, res.height, res.tx_hash) {
    +                        let _ = graph_update.insert_anchor(res.tx_hash, anchor);
    +                    }
    +                }
    +            }
    +        }
    +        Ok(())
    +    }
    +
    +    /// Populate the `graph_update` with transactions/anchors of the provided `txids`.
    +    fn populate_with_txids(
    +        &self,
    +        cps: &BTreeMap<u32, CheckPoint>,
    +        graph_update: &mut TxGraph<ConfirmationHeightAnchor>,
    +        txids: impl IntoIterator<Item = Txid>,
    +    ) -> Result<(), Error> {
    +        for txid in txids {
    +            let tx = match self.fetch_tx(txid) {
    +                Ok(tx) => tx,
    +                Err(electrum_client::Error::Protocol(_)) => continue,
    +                Err(other_err) => return Err(other_err),
    +            };
    +
    +            let spk = tx
    +                .output
    +                .first()
    +                .map(|txo| &txo.script_pubkey)
    +                .expect("tx must have an output");
    +
    +            // because of restrictions of the Electrum API, we have to use the `script_get_history`
    +            // call to get confirmation status of our transaction
    +            let anchor = match self
    +                .inner
    +                .script_get_history(spk)?
    +                .into_iter()
    +                .find(|r| r.tx_hash == txid)
    +            {
    +                Some(r) => determine_tx_anchor(cps, r.height, txid),
    +                None => continue,
    +            };
    +
    +            let _ = graph_update.insert_tx(tx);
    +            if let Some(anchor) = anchor {
    +                let _ = graph_update.insert_anchor(txid, anchor);
    +            }
    +        }
    +        Ok(())
    +    }
     }
     
    -/// The result of [`ElectrumExt::full_scan`].
    +/// The result of [`BdkElectrumClient::full_scan`].
     ///
     /// This can be transformed into a [`FullScanResult`] with either [`ConfirmationHeightAnchor`] or
     /// [`ConfirmationTimeHeightAnchor`] anchor types.
    @@ -800,18 +996,18 @@
         /// This requires additional calls to the Electrum server.
         pub fn with_confirmation_time_height_anchor(
             self,
    -        client: &impl ElectrumApi,
    +        client: &BdkElectrumClient<impl ElectrumApi>,
         ) -> Result<FullScanResult<K, ConfirmationTimeHeightAnchor>, Error> {
             let res = self.0;
             Ok(FullScanResult {
    -            graph_update: try_into_confirmation_time_result(res.graph_update, client)?,
    +            graph_update: try_into_confirmation_time_result(res.graph_update, &client.inner)?,
                 chain_update: res.chain_update,
                 last_active_indices: res.last_active_indices,
             })
         }
     }
     
    -/// The result of [`ElectrumExt::sync`].
    +/// The result of [`BdkElectrumClient::sync`].
     ///
     /// This can be transformed into a [`SyncResult`] with either [`ConfirmationHeightAnchor`] or
     /// [`ConfirmationTimeHeightAnchor`] anchor types.
    @@ -828,11 +1024,11 @@
         /// This requires additional calls to the Electrum server.
         pub fn with_confirmation_time_height_anchor(
             self,
    -        client: &impl ElectrumApi,
    +        client: &BdkElectrumClient<impl ElectrumApi>,
         ) -> Result<SyncResult<ConfirmationTimeHeightAnchor>, Error> {
             let res = self.0;
             Ok(SyncResult {
    -            graph_update: try_into_confirmation_time_result(res.graph_update, client)?,
    +            graph_update: try_into_confirmation_time_result(res.graph_update, &client.inner)?,
                 chain_update: res.chain_update,
             })
         }
    @@ -980,194 +1176,4 @@
             }
         }
     }
    -
    -/// Populate the `graph_update` with associated transactions/anchors of `outpoints`.
    -///
    -/// Transactions in which the outpoint resides, and transactions that spend from the outpoint are
    -/// included. Anchors of the aforementioned transactions are included.
    -///
    -/// Checkpoints (in `cps`) are used to create anchors. The `tx_cache` is self-explanatory.
    -fn populate_with_outpoints(
    -    client: &impl ElectrumApi,
    -    cps: &BTreeMap<u32, CheckPoint>,
    -    tx_cache: &mut TxCache,
    -    graph_update: &mut TxGraph<ConfirmationHeightAnchor>,
    -    outpoints: impl IntoIterator<Item = OutPoint>,
    -) -> Result<(), Error> {
    -    for outpoint in outpoints {
    -        let op_txid = outpoint.txid;
    -        let op_tx = fetch_tx(client, tx_cache, op_txid)?;
    -        let op_txout = match op_tx.output.get(outpoint.vout as usize) {
    -            Some(txout) => txout,
    -            None => continue,
    -        };
    -        debug_assert_eq!(op_tx.txid(), op_txid);
    -
    -        // attempt to find the following transactions (alongside their chain positions), and
    -        // add to our sparsechain `update`:
    -        let mut has_residing = false; // tx in which the outpoint resides
    -        let mut has_spending = false; // tx that spends the outpoint
    -        for res in client.script_get_history(&op_txout.script_pubkey)? {
    -            if has_residing && has_spending {
    -                break;
    -            }
    -
    -            if !has_residing && res.tx_hash == op_txid {
    -                has_residing = true;
    -                let _ = graph_update.insert_tx(Arc::clone(&op_tx));
    -                if let Some(anchor) = determine_tx_anchor(cps, res.height, res.tx_hash) {
    -                    let _ = graph_update.insert_anchor(res.tx_hash, anchor);
    -                }
    -            }
    -
    -            if !has_spending && res.tx_hash != op_txid {
    -                let res_tx = fetch_tx(client, tx_cache, res.tx_hash)?;
    -                // we exclude txs/anchors that do not spend our specified outpoint(s)
    -                has_spending = res_tx
    -                    .input
    -                    .iter()
    -                    .any(|txin| txin.previous_output == outpoint);
    -                if !has_spending {
    -                    continue;
    -                }
    -                let _ = graph_update.insert_tx(Arc::clone(&res_tx));
    -                if let Some(anchor) = determine_tx_anchor(cps, res.height, res.tx_hash) {
    -                    let _ = graph_update.insert_anchor(res.tx_hash, anchor);
    -                }
    -            }
    -        }
    -    }
    -    Ok(())
    -}
    -
    -/// Populate the `graph_update` with transactions/anchors of the provided `txids`.
    -fn populate_with_txids(
    -    client: &impl ElectrumApi,
    -    cps: &BTreeMap<u32, CheckPoint>,
    -    tx_cache: &mut TxCache,
    -    graph_update: &mut TxGraph<ConfirmationHeightAnchor>,
    -    txids: impl IntoIterator<Item = Txid>,
    -) -> Result<(), Error> {
    -    for txid in txids {
    -        let tx = match fetch_tx(client, tx_cache, txid) {
    -            Ok(tx) => tx,
    -            Err(electrum_client::Error::Protocol(_)) => continue,
    -            Err(other_err) => return Err(other_err),
    -        };
    -
    -        let spk = tx
    -            .output
    -            .first()
    -            .map(|txo| &txo.script_pubkey)
    -            .expect("tx must have an output");
    -
    -        // because of restrictions of the Electrum API, we have to use the `script_get_history`
    -        // call to get confirmation status of our transaction
    -        let anchor = match client
    -            .script_get_history(spk)?
    -            .into_iter()
    -            .find(|r| r.tx_hash == txid)
    -        {
    -            Some(r) => determine_tx_anchor(cps, r.height, txid),
    -            None => continue,
    -        };
    -
    -        let _ = graph_update.insert_tx(tx);
    -        if let Some(anchor) = anchor {
    -            let _ = graph_update.insert_anchor(txid, anchor);
    -        }
    -    }
    -    Ok(())
    -}
    -
    -/// Fetch transaction of given `txid`.
    -///
    -/// We maintain a `tx_cache` so that we won't need to fetch from Electrum with every call.
    -fn fetch_tx<C: ElectrumApi>(
    -    client: &C,
    -    tx_cache: &mut TxCache,
    -    txid: Txid,
    -) -> Result<Arc<Transaction>, Error> {
    -    use bdk_chain::collections::hash_map::Entry;
    -    Ok(match tx_cache.entry(txid) {
    -        Entry::Occupied(entry) => entry.get().clone(),
    -        Entry::Vacant(entry) => entry
    -            .insert(Arc::new(client.transaction_get(&txid)?))
    -            .clone(),
    -    })
    -}
    -
    -// Helper function which fetches the `TxOut`s of our relevant transactions' previous transactions,
    -// which we do not have by default. This data is needed to calculate the transaction fee.
    -fn fetch_prev_txout<C: ElectrumApi>(
    -    client: &C,
    -    tx_cache: &mut TxCache,
    -    graph_update: &mut TxGraph<ConfirmationHeightAnchor>,
    -) -> Result<(), Error> {
    -    let full_txs: Vec<Arc<Transaction>> =
    -        graph_update.full_txs().map(|tx_node| tx_node.tx).collect();
    -    for tx in full_txs {
    -        for vin in &tx.input {
    -            let outpoint = vin.previous_output;
    -            let vout = outpoint.vout;
    -            let prev_tx = fetch_tx(client, tx_cache, outpoint.txid)?;
    -            let txout = prev_tx.output[vout as usize].clone();
    -            let _ = graph_update.insert_txout(outpoint, txout);
    -        }
    -    }
    -    Ok(())
    -}
    -
    -/// Populate the `graph_update` with transactions/anchors associated with the given `spks`.
    -///
    -/// Transactions that contains an output with requested spk, or spends form an output with
    -/// requested spk will be added to `graph_update`. Anchors of the aforementioned transactions are
    -/// also included.
    -///
    -/// Checkpoints (in `cps`) are used to create anchors. The `tx_cache` is self-explanatory.
    -fn populate_with_spks<I: Ord + Clone>(
    -    client: &impl ElectrumApi,
    -    cps: &BTreeMap<u32, CheckPoint>,
    -    tx_cache: &mut TxCache,
    -    graph_update: &mut TxGraph<ConfirmationHeightAnchor>,
    -    spks: &mut impl Iterator<Item = (I, ScriptBuf)>,
    -    stop_gap: usize,
    -    batch_size: usize,
    -) -> Result<BTreeMap<I, (ScriptBuf, bool)>, Error> {
    -    let mut unused_spk_count = 0_usize;
    -    let mut scanned_spks = BTreeMap::new();
    -
    -    loop {
    -        let spks = (0..batch_size)
    -            .map_while(|_| spks.next())
    -            .collect::<Vec<_>>();
    -        if spks.is_empty() {
    -            return Ok(scanned_spks);
    -        }
    -
    -        let spk_histories =
    -            client.batch_script_get_history(spks.iter().map(|(_, s)| s.as_script()))?;
    -
    -        for ((spk_index, spk), spk_history) in spks.into_iter().zip(spk_histories) {
    -            if spk_history.is_empty() {
    -                scanned_spks.insert(spk_index, (spk, false));
    -                unused_spk_count += 1;
    -                if unused_spk_count > stop_gap {
    -                    return Ok(scanned_spks);
    -                }
    -                continue;
    -            } else {
    -                scanned_spks.insert(spk_index, (spk, true));
    -                unused_spk_count = 0;
    -            }
    -
    -            for tx_res in spk_history {
    -                let _ = graph_update.insert_tx(fetch_tx(client, tx_cache, tx_res.tx_hash)?);
    -                if let Some(anchor) = determine_tx_anchor(cps, tx_res.height, tx_res.tx_hash) {
    -                    let _ = graph_update.insert_anchor(tx_res.tx_hash, anchor);
    -                }
    -            }
    -        }
    -    }
    -}
     
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/src/bdk_electrum/lib.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_electrum/lib.rs.html index 831153d750..e35ccf65fc 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk_electrum/lib.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk_electrum/lib.rs.html @@ -19,12 +19,13 @@ 19 20 21 +22
    //! This crate is used for updating structures of [`bdk_chain`] with data from an Electrum server.
     //!
    -//! The two primary methods are [`ElectrumExt::sync`] and [`ElectrumExt::full_scan`]. In most cases
    -//! [`ElectrumExt::sync`] is used to sync the transaction histories of scripts that the application
    +//! The two primary methods are [`BdkElectrumClient::sync`] and [`BdkElectrumClient::full_scan`]. In most cases
    +//! [`BdkElectrumClient::sync`] is used to sync the transaction histories of scripts that the application
     //! cares about, for example the scripts for all the receive addresses of a Wallet's keychain that it
    -//! has shown a user. [`ElectrumExt::full_scan`] is meant to be used when importing or restoring a
    +//! has shown a user. [`BdkElectrumClient::full_scan`] is meant to be used when importing or restoring a
     //! keychain where the range of possibly used scripts is not known. In this case it is necessary to
     //! scan all keychain scripts until a number (the "stop gap") of unused scripts is discovered. For a
     //! sync or full scan the user receives relevant blockchain data and output updates for
    @@ -36,8 +37,9 @@
     
     #![warn(missing_docs)]
     
    -mod electrum_ext;
    +mod bdk_electrum_client;
    +pub use bdk_electrum_client::*;
    +
     pub use bdk_chain;
     pub use electrum_client;
    -pub use electrum_ext::*;
     
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/mod.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/mod.rs.html index 8f8bb4ba15..d5c3617ddb 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/mod.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/mod.rs.html @@ -2636,8 +2636,6 @@ 2636 2637 2638 -2639 -2640

    // Bitcoin Dev Kit
     // Written in 2020 by Alekos Filini <alekos.filini@gmail.com>
     //
    @@ -5137,7 +5135,6 @@
         /// 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())
    -            .cache_graph_txs(self.tx_graph())
                 .populate_with_revealed_spks(&self.indexed_graph.index, ..)
         }
     
    @@ -5151,7 +5148,6 @@
         /// 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)
    -            .cache_graph_txs(self.tx_graph())
         }
     }
     
    diff --git a/docs-rs/bdk/nightly/latest/src/example_electrum/main.rs.html b/docs-rs/bdk/nightly/latest/src/example_electrum/main.rs.html
    index ba93c208c3..2c9fbba4f0 100644
    --- a/docs-rs/bdk/nightly/latest/src/example_electrum/main.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/example_electrum/main.rs.html
    @@ -350,6 +350,7 @@
     350
     351
     352
    +353
     
    use std::{
         io::{self, Write},
         sync::Mutex,
    @@ -366,7 +367,7 @@
     };
     use bdk_electrum::{
         electrum_client::{self, Client, ElectrumApi},
    -    ElectrumExt,
    +    BdkElectrumClient,
     };
     use example_cli::{
         anyhow::{self, Context},
    @@ -498,7 +499,10 @@
             }
         };
     
    -    let client = electrum_cmd.electrum_args().client(args.network)?;
    +    let client = BdkElectrumClient::new(electrum_cmd.electrum_args().client(args.network)?);
    +
    +    // Tell the electrum client about the txs we've already got locally so it doesn't re-download them
    +    client.populate_tx_cache(&*graph.lock().unwrap());
     
         let (chain_update, mut graph_update, keychain_update) = match electrum_cmd.clone() {
             ElectrumCommands::Scan {
    @@ -511,7 +515,6 @@
                     let chain = &*chain.lock().unwrap();
     
                     FullScanRequest::from_chain_tip(chain.tip())
    -                    .cache_graph_txs(graph.graph())
                         .set_spks_for_keychain(
                             Keychain::External,
                             graph
    @@ -572,8 +575,7 @@
                 }
     
                 let chain_tip = chain.tip();
    -            let mut request =
    -                SyncRequest::from_chain_tip(chain_tip.clone()).cache_graph_txs(graph.graph());
    +            let mut request = SyncRequest::from_chain_tip(chain_tip.clone());
     
                 if all_spks {
                     let all_spks = graph
    diff --git a/docs-rs/bdk/nightly/latest/src/wallet_electrum_example/main.rs.html b/docs-rs/bdk/nightly/latest/src/wallet_electrum_example/main.rs.html
    index db3de56469..6e0dd9f12d 100644
    --- a/docs-rs/bdk/nightly/latest/src/wallet_electrum_example/main.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/wallet_electrum_example/main.rs.html
    @@ -94,6 +94,10 @@
     94
     95
     96
    +97
    +98
    +99
    +100
     
    const DB_MAGIC: &str = "bdk_wallet_electrum_example";
     const SEND_AMOUNT: Amount = Amount::from_sat(5000);
     const STOP_GAP: usize = 50;
    @@ -102,10 +106,8 @@
     use std::io::Write;
     use std::str::FromStr;
     
    -use bdk_electrum::{
    -    electrum_client::{self, ElectrumApi},
    -    ElectrumExt,
    -};
    +use bdk_electrum::electrum_client;
    +use bdk_electrum::BdkElectrumClient;
     use bdk_file_store::Store;
     use bdk_wallet::bitcoin::{Address, Amount};
     use bdk_wallet::chain::collections::HashSet;
    @@ -133,7 +135,13 @@
         println!("Wallet balance before syncing: {} sats", balance.total());
     
         print!("Syncing...");
    -    let client = electrum_client::Client::new("ssl://electrum.blockstream.info:60002")?;
    +    let client = BdkElectrumClient::new(electrum_client::Client::new(
    +        "ssl://electrum.blockstream.info:60002",
    +    )?);
    +
    +    // Populate the electrum client's transaction cache so it doesn't redownload transaction we
    +    // already have.
    +    client.populate_tx_cache(&wallet);
     
         let request = wallet
             .start_full_scan()
    diff --git a/docs-rs/bdk/nightly/latest/trait.impl/bdk_electrum/electrum_ext/trait.ElectrumExt.js b/docs-rs/bdk/nightly/latest/trait.impl/bdk_electrum/electrum_ext/trait.ElectrumExt.js
    deleted file mode 100644
    index 11e040008a..0000000000
    --- a/docs-rs/bdk/nightly/latest/trait.impl/bdk_electrum/electrum_ext/trait.ElectrumExt.js
    +++ /dev/null
    @@ -1,3 +0,0 @@
    -(function() {var implementors = {
    -"bdk_electrum":[]
    -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
    \ No newline at end of file
    diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.AsRef.js b/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.AsRef.js
    index a8b6b47c60..dbd166d78e 100644
    --- a/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.AsRef.js
    +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.AsRef.js
    @@ -1,4 +1,4 @@
     (function() {var implementors = {
    -"bdk_chain":[["impl AsRef<[u8; 32]> for DescriptorId"],["impl AsRef<[u8]> for DescriptorId"],["impl<A> AsRef<TxGraph<A>> for TxGraph<A>"]],
    +"bdk_chain":[["impl AsRef<[u8; 32]> for DescriptorId"],["impl AsRef<[u8]> for DescriptorId"],["impl<A> AsRef<TxGraph<A>> for TxGraph<A>"],["impl<A, I> AsRef<TxGraph<A>> for IndexedTxGraph<A, I>"]],
     "bdk_wallet":[["impl AsRef<TxGraph<ConfirmationTimeHeightAnchor>> for Wallet"],["impl AsRef<[u8]> for KeychainKind"]]
     };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
    \ No newline at end of file
    diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/fmt/trait.Debug.js b/docs-rs/bdk/nightly/latest/trait.impl/core/fmt/trait.Debug.js
    index 98c6210c72..4b3d2287c1 100644
    --- a/docs-rs/bdk/nightly/latest/trait.impl/core/fmt/trait.Debug.js
    +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/fmt/trait.Debug.js
    @@ -2,6 +2,7 @@
     "bdk_bitcoind_rpc":[["impl<B: Debug> Debug for BlockEvent<B>"]],
     "bdk_chain":[["impl Debug for ConfirmationTime"],["impl Debug for ApplyHeaderError"],["impl Debug for CalculateFeeError"],["impl Debug for Balance"],["impl Debug for AlterCheckPointError"],["impl Debug for CannotConnectError"],["impl Debug for CheckPoint"],["impl Debug for LocalChain"],["impl Debug for MissingGenesisError"],["impl Debug for BlockId"],["impl Debug for ConfirmationHeightAnchor"],["impl Debug for ConfirmationTimeHeightAnchor"],["impl Debug for DescriptorId"],["impl<'a, T: Debug, A: Debug> Debug for CanonicalTx<'a, T, A>"],["impl<'a, T: Debug, A: Debug> Debug for TxNode<'a, T, A>"],["impl<A: Debug> Debug for ChainPosition<A>"],["impl<A: Debug> Debug for FullTxOut<A>"],["impl<A: Debug> Debug for ChangeSet<A>"],["impl<A: Debug> Debug for TxGraph<A>"],["impl<A: Debug, I: Debug> Debug for IndexedTxGraph<A, I>"],["impl<A: Debug, IA: Debug> Debug for ChangeSet<A, IA>"],["impl<I: Debug> Debug for SpkTxOutIndex<I>"],["impl<K: Debug> Debug for ChangeSet<K>"],["impl<K: Debug> Debug for KeychainTxOutIndex<K>"]],
     "bdk_coin_select":[["impl Debug for ExcessStrategyKind"],["impl Debug for SelectionConstraint"],["impl Debug for CoinSelectorOpt"],["impl Debug for ExcessStrategy"],["impl Debug for Selection"],["impl Debug for SelectionError"],["impl Debug for WeightedValue"],["impl<'a> Debug for CoinSelector<'a>"]],
    +"bdk_electrum":[["impl<E: Debug> Debug for BdkElectrumClient<E>"]],
     "bdk_file_store":[["impl Debug for FileError"],["impl Debug for IterError"],["impl<C> Debug for Store<C>
    where\n C: Sync + Send + Debug,
    "],["impl<C: Debug> Debug for AggregateChangesetsError<C>"]], "bdk_hwi":[["impl Debug for HWISigner"]], "bdk_persist":[["impl<C: Debug> Debug for Persist<C>"],["impl<K: Debug, A: Debug> Debug for CombinedChangeSet<K, A>"]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Freeze.js b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Freeze.js index 175a99c462..1e469f9a03 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Freeze.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Freeze.js @@ -2,7 +2,7 @@ "bdk_bitcoind_rpc":[["impl<'c, C> Freeze for Emitter<'c, C>",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> Freeze for BlockEvent<B>
    where\n B: Freeze,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], "bdk_chain":[["impl Freeze for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Freeze for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl Freeze for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl Freeze for Balance",1,["bdk_chain::keychain::Balance"]],["impl Freeze for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Freeze for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["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 SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["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 Freeze for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> Freeze for CanonicalTx<'a, T, A>
    where\n T: Freeze,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> Freeze for TxNode<'a, T, A>
    where\n T: Freeze,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> Freeze for TxAncestors<'g, A, F>
    where\n F: Freeze,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Freeze for TxDescendants<'g, A, F>
    where\n F: Freeze,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> Freeze for ChainPosition<A>
    where\n A: Freeze,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> Freeze for SyncResult<A>",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> Freeze for FullTxOut<A>
    where\n A: Freeze,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> Freeze for ChangeSet<A>",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> Freeze for TxGraph<A>",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> Freeze for IndexedTxGraph<A, I>
    where\n I: Freeze,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Freeze for ChangeSet<A, IA>
    where\n IA: Freeze,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> Freeze for SpkIterator<D>
    where\n D: Freeze,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> Freeze for SpkTxOutIndex<I>",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> Freeze for ChangeSet<K>",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> Freeze for KeychainTxOutIndex<K>",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Freeze for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K, A> Freeze for FullScanResult<K, A>",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl Freeze for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]],["impl Freeze for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl Freeze for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl Freeze for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl Freeze for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl Freeze for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl Freeze for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl Freeze for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl Freeze for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl<'a> Freeze for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl<'c, 'f, S> Freeze for BnbIter<'c, 'f, S>
    where\n S: Freeze,
    ",1,["bdk_coin_select::bnb::BnbIter"]],["impl<'c, S> Freeze for Bnb<'c, S>
    where\n S: Freeze,
    ",1,["bdk_coin_select::bnb::Bnb"]]], -"bdk_electrum":[["impl Freeze for ElectrumSyncResult",1,["bdk_electrum::electrum_ext::ElectrumSyncResult"]],["impl<K> Freeze for ElectrumFullScanResult<K>",1,["bdk_electrum::electrum_ext::ElectrumFullScanResult"]]], +"bdk_electrum":[["impl Freeze for ElectrumSyncResult",1,["bdk_electrum::bdk_electrum_client::ElectrumSyncResult"]],["impl<E> !Freeze for BdkElectrumClient<E>",1,["bdk_electrum::bdk_electrum_client::BdkElectrumClient"]],["impl<K> Freeze for ElectrumFullScanResult<K>",1,["bdk_electrum::bdk_electrum_client::ElectrumFullScanResult"]]], "bdk_file_store":[["impl Freeze for FileError",1,["bdk_file_store::FileError"]],["impl Freeze for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<'t, T> Freeze for EntryIter<'t, T>",1,["bdk_file_store::entry_iter::EntryIter"]],["impl<C> Freeze for AggregateChangesetsError<C>
    where\n C: Freeze,
    ",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl<C> Freeze for Store<C>",1,["bdk_file_store::store::Store"]]], "bdk_hwi":[["impl Freeze for HWISigner",1,["bdk_hwi::signer::HWISigner"]]], "bdk_persist":[["impl<C> Freeze for Persist<C>
    where\n C: Freeze,
    ",1,["bdk_persist::persist::Persist"]],["impl<K, A> Freeze for CombinedChangeSet<K, A>",1,["bdk_persist::changeset::CombinedChangeSet"]]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Send.js b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Send.js index 972493b3f6..8ce2dc9c7c 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Send.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Send.js @@ -2,7 +2,7 @@ "bdk_bitcoind_rpc":[["impl<'c, C> Send for Emitter<'c, C>
    where\n C: Sync,
    ",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> Send for BlockEvent<B>
    where\n B: Send,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], "bdk_chain":[["impl Send for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Send for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl Send for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl Send for Balance",1,["bdk_chain::keychain::Balance"]],["impl Send for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Send for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["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 SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["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 Send for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> Send for CanonicalTx<'a, T, A>
    where\n T: Send,\n A: Sync,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> Send for TxNode<'a, T, A>
    where\n T: Send,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> Send for TxAncestors<'g, A, F>
    where\n F: Send,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Send for TxDescendants<'g, A, F>
    where\n F: Send,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> Send for ChainPosition<A>
    where\n A: Send,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> Send for SyncResult<A>
    where\n A: Send,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> Send for FullTxOut<A>
    where\n A: Send,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> Send for ChangeSet<A>
    where\n A: Send,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> Send for TxGraph<A>
    where\n A: Send,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> Send for IndexedTxGraph<A, I>
    where\n I: Send,\n A: Send,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Send for ChangeSet<A, IA>
    where\n IA: Send,\n A: Send,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> Send for SpkIterator<D>
    where\n D: Send,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> Send for SpkTxOutIndex<I>
    where\n I: Send,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> Send for ChangeSet<K>
    where\n K: Send,
    ",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> Send for KeychainTxOutIndex<K>
    where\n K: Send,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Send for FullScanRequest<K>
    where\n K: Send,
    ",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K, A> Send for FullScanResult<K, A>
    where\n K: Send,\n A: Send,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl Send for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]],["impl Send for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl Send for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl Send for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl Send for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl Send for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl Send for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl Send for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl Send for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl<'a> Send for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl<'c, 'f, S> !Send for BnbIter<'c, 'f, S>",1,["bdk_coin_select::bnb::BnbIter"]],["impl<'c, S> Send for Bnb<'c, S>
    where\n S: Send,
    ",1,["bdk_coin_select::bnb::Bnb"]]], -"bdk_electrum":[["impl Send for ElectrumSyncResult",1,["bdk_electrum::electrum_ext::ElectrumSyncResult"]],["impl<K> Send for ElectrumFullScanResult<K>
    where\n K: Send,
    ",1,["bdk_electrum::electrum_ext::ElectrumFullScanResult"]]], +"bdk_electrum":[["impl Send for ElectrumSyncResult",1,["bdk_electrum::bdk_electrum_client::ElectrumSyncResult"]],["impl<E> Send for BdkElectrumClient<E>
    where\n E: Send,
    ",1,["bdk_electrum::bdk_electrum_client::BdkElectrumClient"]],["impl<K> Send for ElectrumFullScanResult<K>
    where\n K: Send,
    ",1,["bdk_electrum::bdk_electrum_client::ElectrumFullScanResult"]]], "bdk_file_store":[["impl Send for FileError",1,["bdk_file_store::FileError"]],["impl Send for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<'t, T> Send for EntryIter<'t, T>
    where\n T: Send,
    ",1,["bdk_file_store::entry_iter::EntryIter"]],["impl<C> Send for AggregateChangesetsError<C>
    where\n C: Send,
    ",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl<C> Send for Store<C>",1,["bdk_file_store::store::Store"]]], "bdk_hwi":[["impl Send for HWISigner",1,["bdk_hwi::signer::HWISigner"]]], "bdk_persist":[["impl<C> Send for Persist<C>
    where\n C: Send,
    ",1,["bdk_persist::persist::Persist"]],["impl<K, A> Send for CombinedChangeSet<K, A>
    where\n K: Send,\n A: Send,
    ",1,["bdk_persist::changeset::CombinedChangeSet"]]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Sync.js b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Sync.js index 9f49575ffc..c9f6219943 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Sync.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Sync.js @@ -2,7 +2,7 @@ "bdk_bitcoind_rpc":[["impl<'c, C> Sync for Emitter<'c, C>
    where\n C: Sync,
    ",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> Sync for BlockEvent<B>
    where\n B: Sync,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], "bdk_chain":[["impl !Sync for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl Sync for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Sync for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl Sync for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl Sync for Balance",1,["bdk_chain::keychain::Balance"]],["impl Sync for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Sync for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["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 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 Sync for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> Sync for CanonicalTx<'a, T, A>
    where\n T: Sync,\n A: Sync,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> Sync for TxNode<'a, T, A>
    where\n T: Sync,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> Sync for TxAncestors<'g, A, F>
    where\n F: Sync,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Sync for TxDescendants<'g, A, F>
    where\n F: Sync,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> Sync for ChainPosition<A>
    where\n A: Sync,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> Sync for SyncResult<A>
    where\n A: Sync,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> Sync for FullTxOut<A>
    where\n A: Sync,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> Sync for ChangeSet<A>
    where\n A: Sync,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> Sync for TxGraph<A>
    where\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> Sync for IndexedTxGraph<A, I>
    where\n I: Sync,\n A: Sync,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Sync for ChangeSet<A, IA>
    where\n IA: Sync,\n A: Sync,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> Sync for SpkIterator<D>
    where\n D: Sync,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> Sync for SpkTxOutIndex<I>
    where\n I: Sync,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> !Sync for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> Sync for ChangeSet<K>
    where\n K: Sync,
    ",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> Sync for KeychainTxOutIndex<K>
    where\n K: Sync,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K, A> Sync for FullScanResult<K, A>
    where\n K: Sync,\n A: Sync,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl Sync for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]],["impl Sync for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl Sync for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl Sync for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl Sync for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl Sync for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl Sync for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl Sync for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl Sync for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl<'a> Sync for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl<'c, 'f, S> !Sync for BnbIter<'c, 'f, S>",1,["bdk_coin_select::bnb::BnbIter"]],["impl<'c, S> Sync for Bnb<'c, S>
    where\n S: Sync,
    ",1,["bdk_coin_select::bnb::Bnb"]]], -"bdk_electrum":[["impl Sync for ElectrumSyncResult",1,["bdk_electrum::electrum_ext::ElectrumSyncResult"]],["impl<K> Sync for ElectrumFullScanResult<K>
    where\n K: Sync,
    ",1,["bdk_electrum::electrum_ext::ElectrumFullScanResult"]]], +"bdk_electrum":[["impl Sync for ElectrumSyncResult",1,["bdk_electrum::bdk_electrum_client::ElectrumSyncResult"]],["impl<E> Sync for BdkElectrumClient<E>
    where\n E: Sync,
    ",1,["bdk_electrum::bdk_electrum_client::BdkElectrumClient"]],["impl<K> Sync for ElectrumFullScanResult<K>
    where\n K: Sync,
    ",1,["bdk_electrum::bdk_electrum_client::ElectrumFullScanResult"]]], "bdk_file_store":[["impl Sync for FileError",1,["bdk_file_store::FileError"]],["impl Sync for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<'t, T> Sync for EntryIter<'t, T>
    where\n T: Sync,
    ",1,["bdk_file_store::entry_iter::EntryIter"]],["impl<C> Sync for AggregateChangesetsError<C>
    where\n C: Sync,
    ",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl<C> Sync for Store<C>",1,["bdk_file_store::store::Store"]]], "bdk_hwi":[["impl Sync for HWISigner",1,["bdk_hwi::signer::HWISigner"]]], "bdk_persist":[["impl<C> Sync for Persist<C>
    where\n C: Sync,
    ",1,["bdk_persist::persist::Persist"]],["impl<K, A> Sync for CombinedChangeSet<K, A>
    where\n K: Sync,\n A: Sync,
    ",1,["bdk_persist::changeset::CombinedChangeSet"]]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Unpin.js b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Unpin.js index 27c8957560..a8fd731794 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Unpin.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Unpin.js @@ -2,7 +2,7 @@ "bdk_bitcoind_rpc":[["impl<'c, C> Unpin for Emitter<'c, C>",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> Unpin for BlockEvent<B>
    where\n B: Unpin,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], "bdk_chain":[["impl Unpin for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Unpin for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl Unpin for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl Unpin for Balance",1,["bdk_chain::keychain::Balance"]],["impl Unpin for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Unpin for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["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 SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["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 Unpin for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> Unpin for CanonicalTx<'a, T, A>
    where\n T: Unpin,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> Unpin for TxNode<'a, T, A>
    where\n T: Unpin,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> Unpin for TxAncestors<'g, A, F>
    where\n F: Unpin,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Unpin for TxDescendants<'g, A, F>
    where\n F: Unpin,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> Unpin for ChainPosition<A>
    where\n A: Unpin,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> Unpin for SyncResult<A>",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> Unpin for FullTxOut<A>
    where\n A: Unpin,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> Unpin for ChangeSet<A>",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> Unpin for TxGraph<A>",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> Unpin for IndexedTxGraph<A, I>
    where\n I: Unpin,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Unpin for ChangeSet<A, IA>
    where\n IA: Unpin,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> Unpin for SpkIterator<D>
    where\n D: Unpin,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> Unpin for SpkTxOutIndex<I>
    where\n I: Unpin,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> Unpin for ChangeSet<K>",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> Unpin for KeychainTxOutIndex<K>",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Unpin for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K, A> Unpin for FullScanResult<K, A>",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl Unpin for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]],["impl Unpin for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl Unpin for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl Unpin for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl Unpin for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl Unpin for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl Unpin for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl Unpin for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl Unpin for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl<'a> Unpin for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl<'c, 'f, S> Unpin for BnbIter<'c, 'f, S>
    where\n S: Unpin,
    ",1,["bdk_coin_select::bnb::BnbIter"]],["impl<'c, S> Unpin for Bnb<'c, S>
    where\n S: Unpin,
    ",1,["bdk_coin_select::bnb::Bnb"]]], -"bdk_electrum":[["impl Unpin for ElectrumSyncResult",1,["bdk_electrum::electrum_ext::ElectrumSyncResult"]],["impl<K> Unpin for ElectrumFullScanResult<K>",1,["bdk_electrum::electrum_ext::ElectrumFullScanResult"]]], +"bdk_electrum":[["impl Unpin for ElectrumSyncResult",1,["bdk_electrum::bdk_electrum_client::ElectrumSyncResult"]],["impl<E> Unpin for BdkElectrumClient<E>
    where\n E: Unpin,
    ",1,["bdk_electrum::bdk_electrum_client::BdkElectrumClient"]],["impl<K> Unpin for ElectrumFullScanResult<K>",1,["bdk_electrum::bdk_electrum_client::ElectrumFullScanResult"]]], "bdk_file_store":[["impl Unpin for FileError",1,["bdk_file_store::FileError"]],["impl Unpin for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<'t, T> Unpin for EntryIter<'t, T>
    where\n T: Unpin,
    ",1,["bdk_file_store::entry_iter::EntryIter"]],["impl<C> Unpin for AggregateChangesetsError<C>
    where\n C: Unpin,
    ",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl<C> Unpin for Store<C>
    where\n C: Unpin,
    ",1,["bdk_file_store::store::Store"]]], "bdk_hwi":[["impl Unpin for HWISigner",1,["bdk_hwi::signer::HWISigner"]]], "bdk_persist":[["impl<C> Unpin for Persist<C>
    where\n C: Unpin,
    ",1,["bdk_persist::persist::Persist"]],["impl<K, A> Unpin for CombinedChangeSet<K, A>",1,["bdk_persist::changeset::CombinedChangeSet"]]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js b/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js index bd39b4849b..4587f9ffa8 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -2,7 +2,7 @@ "bdk_bitcoind_rpc":[["impl<'c, C> RefUnwindSafe for Emitter<'c, C>
    where\n C: RefUnwindSafe,
    ",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> RefUnwindSafe for BlockEvent<B>
    where\n B: RefUnwindSafe,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], "bdk_chain":[["impl !RefUnwindSafe for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl RefUnwindSafe for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl RefUnwindSafe for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl RefUnwindSafe for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl RefUnwindSafe for Balance",1,["bdk_chain::keychain::Balance"]],["impl RefUnwindSafe for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl RefUnwindSafe for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["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 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 RefUnwindSafe for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> RefUnwindSafe for CanonicalTx<'a, T, A>
    where\n T: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> RefUnwindSafe for TxNode<'a, T, A>
    where\n T: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> RefUnwindSafe for TxAncestors<'g, A, F>
    where\n F: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> RefUnwindSafe for TxDescendants<'g, A, F>
    where\n F: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> RefUnwindSafe for ChainPosition<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> RefUnwindSafe for SyncResult<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> RefUnwindSafe for FullTxOut<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> RefUnwindSafe for ChangeSet<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> RefUnwindSafe for TxGraph<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> RefUnwindSafe for IndexedTxGraph<A, I>
    where\n I: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> RefUnwindSafe for ChangeSet<A, IA>
    where\n IA: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> RefUnwindSafe for SpkIterator<D>
    where\n D: RefUnwindSafe,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> RefUnwindSafe for SpkTxOutIndex<I>
    where\n I: RefUnwindSafe,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> !RefUnwindSafe for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> RefUnwindSafe for ChangeSet<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> RefUnwindSafe for KeychainTxOutIndex<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K, A> RefUnwindSafe for FullScanResult<K, A>
    where\n K: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl RefUnwindSafe for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]],["impl RefUnwindSafe for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl RefUnwindSafe for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl RefUnwindSafe for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl RefUnwindSafe for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl RefUnwindSafe for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl RefUnwindSafe for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl RefUnwindSafe for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl RefUnwindSafe for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl<'a> RefUnwindSafe for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl<'c, 'f, S> !RefUnwindSafe for BnbIter<'c, 'f, S>",1,["bdk_coin_select::bnb::BnbIter"]],["impl<'c, S> RefUnwindSafe for Bnb<'c, S>
    where\n S: RefUnwindSafe,
    ",1,["bdk_coin_select::bnb::Bnb"]]], -"bdk_electrum":[["impl RefUnwindSafe for ElectrumSyncResult",1,["bdk_electrum::electrum_ext::ElectrumSyncResult"]],["impl<K> RefUnwindSafe for ElectrumFullScanResult<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_electrum::electrum_ext::ElectrumFullScanResult"]]], +"bdk_electrum":[["impl RefUnwindSafe for ElectrumSyncResult",1,["bdk_electrum::bdk_electrum_client::ElectrumSyncResult"]],["impl<E> RefUnwindSafe for BdkElectrumClient<E>
    where\n E: RefUnwindSafe,
    ",1,["bdk_electrum::bdk_electrum_client::BdkElectrumClient"]],["impl<K> RefUnwindSafe for ElectrumFullScanResult<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_electrum::bdk_electrum_client::ElectrumFullScanResult"]]], "bdk_file_store":[["impl !RefUnwindSafe for FileError",1,["bdk_file_store::FileError"]],["impl !RefUnwindSafe for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<'t, T> RefUnwindSafe for EntryIter<'t, T>
    where\n T: RefUnwindSafe,
    ",1,["bdk_file_store::entry_iter::EntryIter"]],["impl<C> !RefUnwindSafe for AggregateChangesetsError<C>",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl<C> RefUnwindSafe for Store<C>
    where\n C: RefUnwindSafe,
    ",1,["bdk_file_store::store::Store"]]], "bdk_hwi":[["impl !RefUnwindSafe for HWISigner",1,["bdk_hwi::signer::HWISigner"]]], "bdk_persist":[["impl<C> !RefUnwindSafe for Persist<C>",1,["bdk_persist::persist::Persist"]],["impl<K, A> RefUnwindSafe for CombinedChangeSet<K, A>
    where\n K: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_persist::changeset::CombinedChangeSet"]]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js b/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js index 2b50b3b86e..44202e5958 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js @@ -2,7 +2,7 @@ "bdk_bitcoind_rpc":[["impl<'c, C> UnwindSafe for Emitter<'c, C>
    where\n C: RefUnwindSafe,
    ",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> UnwindSafe for BlockEvent<B>
    where\n B: UnwindSafe,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], "bdk_chain":[["impl !UnwindSafe for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl UnwindSafe for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl UnwindSafe for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl UnwindSafe for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl UnwindSafe for Balance",1,["bdk_chain::keychain::Balance"]],["impl UnwindSafe for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl UnwindSafe for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["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 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 UnwindSafe for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> UnwindSafe for CanonicalTx<'a, T, A>
    where\n T: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> UnwindSafe for TxNode<'a, T, A>
    where\n T: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> UnwindSafe for TxAncestors<'g, A, F>
    where\n F: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> UnwindSafe for TxDescendants<'g, A, F>
    where\n F: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> UnwindSafe for ChainPosition<A>
    where\n A: UnwindSafe,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> UnwindSafe for SyncResult<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> UnwindSafe for FullTxOut<A>
    where\n A: UnwindSafe,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> UnwindSafe for ChangeSet<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> UnwindSafe for TxGraph<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> UnwindSafe for IndexedTxGraph<A, I>
    where\n I: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> UnwindSafe for ChangeSet<A, IA>
    where\n IA: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> UnwindSafe for SpkIterator<D>
    where\n D: UnwindSafe,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> UnwindSafe for SpkTxOutIndex<I>",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> !UnwindSafe for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> UnwindSafe for ChangeSet<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> UnwindSafe for KeychainTxOutIndex<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K, A> UnwindSafe for FullScanResult<K, A>
    where\n K: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl UnwindSafe for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]],["impl UnwindSafe for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl UnwindSafe for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl UnwindSafe for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl UnwindSafe for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl UnwindSafe for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl UnwindSafe for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl UnwindSafe for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl UnwindSafe for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl<'a> UnwindSafe for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl<'c, 'f, S> !UnwindSafe for BnbIter<'c, 'f, S>",1,["bdk_coin_select::bnb::BnbIter"]],["impl<'c, S> UnwindSafe for Bnb<'c, S>
    where\n S: UnwindSafe,
    ",1,["bdk_coin_select::bnb::Bnb"]]], -"bdk_electrum":[["impl UnwindSafe for ElectrumSyncResult",1,["bdk_electrum::electrum_ext::ElectrumSyncResult"]],["impl<K> UnwindSafe for ElectrumFullScanResult<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_electrum::electrum_ext::ElectrumFullScanResult"]]], +"bdk_electrum":[["impl UnwindSafe for ElectrumSyncResult",1,["bdk_electrum::bdk_electrum_client::ElectrumSyncResult"]],["impl<E> UnwindSafe for BdkElectrumClient<E>
    where\n E: UnwindSafe,
    ",1,["bdk_electrum::bdk_electrum_client::BdkElectrumClient"]],["impl<K> UnwindSafe for ElectrumFullScanResult<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_electrum::bdk_electrum_client::ElectrumFullScanResult"]]], "bdk_file_store":[["impl !UnwindSafe for FileError",1,["bdk_file_store::FileError"]],["impl !UnwindSafe for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<'t, T> !UnwindSafe for EntryIter<'t, T>",1,["bdk_file_store::entry_iter::EntryIter"]],["impl<C> !UnwindSafe for AggregateChangesetsError<C>",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl<C> UnwindSafe for Store<C>
    where\n C: UnwindSafe,
    ",1,["bdk_file_store::store::Store"]]], "bdk_hwi":[["impl UnwindSafe for HWISigner",1,["bdk_hwi::signer::HWISigner"]]], "bdk_persist":[["impl<C> !UnwindSafe for Persist<C>",1,["bdk_persist::persist::Persist"]],["impl<K, A> UnwindSafe for CombinedChangeSet<K, A>
    where\n K: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_persist::changeset::CombinedChangeSet"]]], diff --git a/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.js b/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.js index 73a7857ad9..1f89605c1b 100644 --- a/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.js +++ b/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"example_cli":[["
    source§

    impl<A, I> Debug for IndexedTxGraph<A, I>
    where\n A: Debug,\n I: Debug,

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    ","Debug","example_cli::KeychainTxGraph"],["
    source§

    impl<A, I> Default for IndexedTxGraph<A, I>
    where\n I: Default,

    source§

    fn default() -> IndexedTxGraph<A, I>

    Returns the “default value” for a type. Read more
    ","Default","example_cli::KeychainTxGraph"],["
    source§

    impl<A, I> IndexedTxGraph<A, I>

    Methods are available if the anchor (A) implements AnchorFromBlockPosition.

    \n
    source

    pub fn apply_block_relevant(\n &mut self,\n block: &Block,\n height: u32\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Batch insert all transactions of the given block of height, filtering out those that are\nirrelevant.

    \n

    Each inserted transaction’s anchor will be constructed from\nAnchorFromBlockPosition::from_block_position.

    \n

    Relevancy is determined by the internal Indexer::is_tx_relevant implementation of I.\nIrrelevant transactions in txs will be ignored.

    \n
    source

    pub fn apply_block(\n &mut self,\n block: Block,\n height: u32\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Batch insert all transactions of the given block of height.

    \n

    Each inserted transaction’s anchor will be constructed from\nAnchorFromBlockPosition::from_block_position.

    \n

    To only insert relevant transactions, use apply_block_relevant instead.

    \n
    ",0,"example_cli::KeychainTxGraph"],["
    source§

    impl<A, I> IndexedTxGraph<A, I>

    source

    pub fn new(index: I) -> IndexedTxGraph<A, I>

    Construct a new IndexedTxGraph with a given index.

    \n
    source

    pub fn graph(&self) -> &TxGraph<A>

    Get a reference of the internal transaction graph.

    \n
    ",0,"example_cli::KeychainTxGraph"],["
    source§

    impl<A, I> IndexedTxGraph<A, I>
    where\n A: Anchor,\n I: Indexer,

    source

    pub fn apply_changeset(\n &mut self,\n changeset: ChangeSet<A, <I as Indexer>::ChangeSet>\n)

    Applies the ChangeSet to the IndexedTxGraph.

    \n
    source

    pub fn initial_changeset(&self) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Determines the ChangeSet between self and an empty IndexedTxGraph.

    \n
    ",0,"example_cli::KeychainTxGraph"],["
    source§

    impl<A, I> IndexedTxGraph<A, I>
    where\n A: Anchor,\n I: Indexer,\n <I as Indexer>::ChangeSet: Default + Append,

    source

    pub fn apply_update(\n &mut self,\n update: TxGraph<A>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Apply an update directly.

    \n

    update is a TxGraph<A> and the resultant changes is returned as ChangeSet.

    \n
    source

    pub fn insert_txout(\n &mut self,\n outpoint: OutPoint,\n txout: TxOut\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Insert a floating txout of given outpoint.

    \n
    source

    pub fn insert_tx(\n &mut self,\n tx: Transaction\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Insert and index a transaction into the graph.

    \n
    source

    pub fn insert_anchor(\n &mut self,\n txid: Txid,\n anchor: A\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Insert an anchor for a given transaction.

    \n
    source

    pub fn insert_seen_at(\n &mut self,\n txid: Txid,\n seen_at: u64\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Insert a unix timestamp of when a transaction is seen in the mempool.

    \n

    This is used for transaction conflict resolution in TxGraph where the transaction with\nthe later last-seen is prioritized.

    \n
    source

    pub fn batch_insert_relevant<'t>(\n &mut self,\n txs: impl IntoIterator<Item = (&'t Transaction, impl IntoIterator<Item = A>)>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Batch insert transactions, filtering out those that are irrelevant.

    \n

    Relevancy is determined by the Indexer::is_tx_relevant implementation of I. Irrelevant\ntransactions in txs will be ignored. txs do not need to be in topological order.

    \n
    source

    pub fn batch_insert_relevant_unconfirmed<'t>(\n &mut self,\n unconfirmed_txs: impl IntoIterator<Item = (&'t Transaction, u64)>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Batch insert unconfirmed transactions, filtering out those that are irrelevant.

    \n

    Relevancy is determined by the internal Indexer::is_tx_relevant implementation of I.\nIrrelevant transactions in txs will be ignored.

    \n

    Items of txs are tuples containing the transaction and a last seen timestamp. The\nlast seen communicates when the transaction is last seen in the mempool which is used for\nconflict-resolution in TxGraph (refer to TxGraph::insert_seen_at for details).

    \n
    source

    pub fn batch_insert_unconfirmed(\n &mut self,\n txs: impl IntoIterator<Item = (Transaction, u64)>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Batch insert unconfirmed transactions.

    \n

    Items of txs are tuples containing the transaction and a last seen timestamp. The\nlast seen communicates when the transaction is last seen in the mempool which is used for\nconflict-resolution in TxGraph (refer to TxGraph::insert_seen_at for details).

    \n

    To filter out irrelevant transactions, use batch_insert_relevant_unconfirmed instead.

    \n
    ",0,"example_cli::KeychainTxGraph"]] +"example_cli":[["
    source§

    impl<A, I> AsRef<TxGraph<A>> for IndexedTxGraph<A, I>

    source§

    fn as_ref(&self) -> &TxGraph<A>

    Converts this type into a shared reference of the (usually inferred) input type.
    ","AsRef>","example_cli::KeychainTxGraph"],["
    source§

    impl<A, I> Debug for IndexedTxGraph<A, I>
    where\n A: Debug,\n I: Debug,

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    ","Debug","example_cli::KeychainTxGraph"],["
    source§

    impl<A, I> Default for IndexedTxGraph<A, I>
    where\n I: Default,

    source§

    fn default() -> IndexedTxGraph<A, I>

    Returns the “default value” for a type. Read more
    ","Default","example_cli::KeychainTxGraph"],["
    source§

    impl<A, I> IndexedTxGraph<A, I>

    Methods are available if the anchor (A) implements AnchorFromBlockPosition.

    \n
    source

    pub fn apply_block_relevant(\n &mut self,\n block: &Block,\n height: u32\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Batch insert all transactions of the given block of height, filtering out those that are\nirrelevant.

    \n

    Each inserted transaction’s anchor will be constructed from\nAnchorFromBlockPosition::from_block_position.

    \n

    Relevancy is determined by the internal Indexer::is_tx_relevant implementation of I.\nIrrelevant transactions in txs will be ignored.

    \n
    source

    pub fn apply_block(\n &mut self,\n block: Block,\n height: u32\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Batch insert all transactions of the given block of height.

    \n

    Each inserted transaction’s anchor will be constructed from\nAnchorFromBlockPosition::from_block_position.

    \n

    To only insert relevant transactions, use apply_block_relevant instead.

    \n
    ",0,"example_cli::KeychainTxGraph"],["
    source§

    impl<A, I> IndexedTxGraph<A, I>

    source

    pub fn new(index: I) -> IndexedTxGraph<A, I>

    Construct a new IndexedTxGraph with a given index.

    \n
    source

    pub fn graph(&self) -> &TxGraph<A>

    Get a reference of the internal transaction graph.

    \n
    ",0,"example_cli::KeychainTxGraph"],["
    source§

    impl<A, I> IndexedTxGraph<A, I>
    where\n A: Anchor,\n I: Indexer,

    source

    pub fn apply_changeset(\n &mut self,\n changeset: ChangeSet<A, <I as Indexer>::ChangeSet>\n)

    Applies the ChangeSet to the IndexedTxGraph.

    \n
    source

    pub fn initial_changeset(&self) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Determines the ChangeSet between self and an empty IndexedTxGraph.

    \n
    ",0,"example_cli::KeychainTxGraph"],["
    source§

    impl<A, I> IndexedTxGraph<A, I>
    where\n A: Anchor,\n I: Indexer,\n <I as Indexer>::ChangeSet: Default + Append,

    source

    pub fn apply_update(\n &mut self,\n update: TxGraph<A>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Apply an update directly.

    \n

    update is a TxGraph<A> and the resultant changes is returned as ChangeSet.

    \n
    source

    pub fn insert_txout(\n &mut self,\n outpoint: OutPoint,\n txout: TxOut\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Insert a floating txout of given outpoint.

    \n
    source

    pub fn insert_tx(\n &mut self,\n tx: Transaction\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Insert and index a transaction into the graph.

    \n
    source

    pub fn insert_anchor(\n &mut self,\n txid: Txid,\n anchor: A\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Insert an anchor for a given transaction.

    \n
    source

    pub fn insert_seen_at(\n &mut self,\n txid: Txid,\n seen_at: u64\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Insert a unix timestamp of when a transaction is seen in the mempool.

    \n

    This is used for transaction conflict resolution in TxGraph where the transaction with\nthe later last-seen is prioritized.

    \n
    source

    pub fn batch_insert_relevant<'t>(\n &mut self,\n txs: impl IntoIterator<Item = (&'t Transaction, impl IntoIterator<Item = A>)>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Batch insert transactions, filtering out those that are irrelevant.

    \n

    Relevancy is determined by the Indexer::is_tx_relevant implementation of I. Irrelevant\ntransactions in txs will be ignored. txs do not need to be in topological order.

    \n
    source

    pub fn batch_insert_relevant_unconfirmed<'t>(\n &mut self,\n unconfirmed_txs: impl IntoIterator<Item = (&'t Transaction, u64)>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Batch insert unconfirmed transactions, filtering out those that are irrelevant.

    \n

    Relevancy is determined by the internal Indexer::is_tx_relevant implementation of I.\nIrrelevant transactions in txs will be ignored.

    \n

    Items of txs are tuples containing the transaction and a last seen timestamp. The\nlast seen communicates when the transaction is last seen in the mempool which is used for\nconflict-resolution in TxGraph (refer to TxGraph::insert_seen_at for details).

    \n
    source

    pub fn batch_insert_unconfirmed(\n &mut self,\n txs: impl IntoIterator<Item = (Transaction, u64)>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

    Batch insert unconfirmed transactions.

    \n

    Items of txs are tuples containing the transaction and a last seen timestamp. The\nlast seen communicates when the transaction is last seen in the mempool which is used for\nconflict-resolution in TxGraph (refer to TxGraph::insert_seen_at for details).

    \n

    To filter out irrelevant transactions, use batch_insert_relevant_unconfirmed instead.

    \n
    ",0,"example_cli::KeychainTxGraph"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/type.impl/std/collections/hash/map/struct.HashMap.js b/docs-rs/bdk/nightly/latest/type.impl/std/collections/hash/map/struct.HashMap.js deleted file mode 100644 index ef14b87769..0000000000 --- a/docs-rs/bdk/nightly/latest/type.impl/std/collections/hash/map/struct.HashMap.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var type_impls = { -"bdk_chain":[["
    1.0.0 · source§

    impl<K, V, S> Clone for HashMap<K, V, S>
    where\n K: Clone,\n V: Clone,\n S: Clone,

    source§

    fn clone(&self) -> HashMap<K, V, S>

    Returns a copy of the value. Read more
    source§

    fn clone_from(&mut self, source: &HashMap<K, V, S>)

    Performs copy-assignment from source. Read more
    ","Clone","bdk_chain::spk_client::TxCache"],["
    1.0.0 · source§

    impl<K, V, S> Debug for HashMap<K, V, S>
    where\n K: Debug,\n V: Debug,

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    ","Debug","bdk_chain::spk_client::TxCache"],["
    1.0.0 · source§

    impl<K, V, S> Default for HashMap<K, V, S>
    where\n S: Default,

    source§

    fn default() -> HashMap<K, V, S>

    Creates an empty HashMap<K, V, S>, with the Default value for the hasher.

    \n
    ","Default","bdk_chain::spk_client::TxCache"],["
    source§

    impl<'de, K, V, S> Deserialize<'de> for HashMap<K, V, S>
    where\n K: Deserialize<'de> + Eq + Hash,\n V: Deserialize<'de>,\n S: BuildHasher + Default,

    source§

    fn deserialize<D>(\n deserializer: D\n) -> Result<HashMap<K, V, S>, <D as Deserializer<'de>>::Error>
    where\n D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    ","Deserialize<'de>","bdk_chain::spk_client::TxCache"],["
    1.4.0 · source§

    impl<'a, K, V, S> Extend<(&'a K, &'a V)> for HashMap<K, V, S>
    where\n K: Eq + Hash + Copy,\n V: Copy,\n S: BuildHasher,

    source§

    fn extend<T>(&mut self, iter: T)
    where\n T: IntoIterator<Item = (&'a K, &'a V)>,

    Extends a collection with the contents of an iterator. Read more
    source§

    fn extend_one(&mut self, _: (&'a K, &'a V))

    🔬This is a nightly-only experimental API. (extend_one)
    Extends a collection with exactly one element.
    source§

    fn extend_reserve(&mut self, additional: usize)

    🔬This is a nightly-only experimental API. (extend_one)
    Reserves capacity in a collection for the given number of additional elements. Read more
    ","Extend<(&'a K, &'a V)>","bdk_chain::spk_client::TxCache"],["
    1.0.0 · source§

    impl<K, V, S> Extend<(K, V)> for HashMap<K, V, S>
    where\n K: Eq + Hash,\n S: BuildHasher,

    Inserts all new key-values from the iterator and replaces values with existing\nkeys with new values returned from the iterator.

    \n
    source§

    fn extend<T>(&mut self, iter: T)
    where\n T: IntoIterator<Item = (K, V)>,

    Extends a collection with the contents of an iterator. Read more
    source§

    fn extend_one(&mut self, _: (K, V))

    🔬This is a nightly-only experimental API. (extend_one)
    Extends a collection with exactly one element.
    source§

    fn extend_reserve(&mut self, additional: usize)

    🔬This is a nightly-only experimental API. (extend_one)
    Reserves capacity in a collection for the given number of additional elements. Read more
    ","Extend<(K, V)>","bdk_chain::spk_client::TxCache"],["
    1.56.0 · source§

    impl<K, V, const N: usize> From<[(K, V); N]> for HashMap<K, V>
    where\n K: Eq + Hash,

    source§

    fn from(arr: [(K, V); N]) -> HashMap<K, V>

    §Examples
    \n
    use std::collections::HashMap;\n\nlet map1 = HashMap::from([(1, 2), (3, 4)]);\nlet map2: HashMap<_, _> = [(1, 2), (3, 4)].into();\nassert_eq!(map1, map2);
    \n
    ","From<[(K, V); N]>","bdk_chain::spk_client::TxCache"],["
    1.0.0 · source§

    impl<K, V, S> FromIterator<(K, V)> for HashMap<K, V, S>
    where\n K: Eq + Hash,\n S: BuildHasher + Default,

    source§

    fn from_iter<T>(iter: T) -> HashMap<K, V, S>
    where\n T: IntoIterator<Item = (K, V)>,

    Creates a value from an iterator. Read more
    ","FromIterator<(K, V)>","bdk_chain::spk_client::TxCache"],["
    source§

    impl<K, V> HashMap<K, V>

    1.0.0 · source

    pub fn new() -> HashMap<K, V>

    Creates an empty HashMap.

    \n

    The hash map is initially created with a capacity of 0, so it will not allocate until it\nis first inserted into.

    \n
    §Examples
    \n
    use std::collections::HashMap;\nlet mut map: HashMap<&str, i32> = HashMap::new();
    \n
    1.0.0 · source

    pub fn with_capacity(capacity: usize) -> HashMap<K, V>

    Creates an empty HashMap with at least the specified capacity.

    \n

    The hash map will be able to hold at least capacity elements without\nreallocating. This method is allowed to allocate for more elements than\ncapacity. If capacity is 0, the hash map will not allocate.

    \n
    §Examples
    \n
    use std::collections::HashMap;\nlet mut map: HashMap<&str, i32> = HashMap::with_capacity(10);
    \n
    ",0,"bdk_chain::spk_client::TxCache"],["
    source§

    impl<K, V, S> HashMap<K, V, S>
    where\n S: BuildHasher,

    source

    pub fn raw_entry_mut(&mut self) -> RawEntryBuilderMut<'_, K, V, S>

    🔬This is a nightly-only experimental API. (hash_raw_entry)

    Creates a raw entry builder for the HashMap.

    \n

    Raw entries provide the lowest level of control for searching and\nmanipulating a map. They must be manually initialized with a hash and\nthen manually searched. After this, insertions into a vacant entry\nstill require an owned key to be provided.

    \n

    Raw entries are useful for such exotic situations as:

    \n
      \n
    • Hash memoization
    • \n
    • Deferring the creation of an owned key until it is known to be required
    • \n
    • Using a search key that doesn’t work with the Borrow trait
    • \n
    • Using custom comparison logic without newtype wrappers
    • \n
    \n

    Because raw entries provide much more low-level control, it’s much easier\nto put the HashMap into an inconsistent state which, while memory-safe,\nwill cause the map to produce seemingly random results. Higher-level and\nmore foolproof APIs like entry should be preferred when possible.

    \n

    In particular, the hash used to initialized the raw entry must still be\nconsistent with the hash of the key that is ultimately stored in the entry.\nThis is because implementations of HashMap may need to recompute hashes\nwhen resizing, at which point only the keys are available.

    \n

    Raw entries give mutable access to the keys. This must not be used\nto modify how the key would compare or hash, as the map will not re-evaluate\nwhere the key should go, meaning the keys may become “lost” if their\nlocation does not reflect their state. For instance, if you change a key\nso that the map now contains keys which compare equal, search may start\nacting erratically, with two keys randomly masking each other. Implementations\nare free to assume this doesn’t happen (within the limits of memory-safety).

    \n
    source

    pub fn raw_entry(&self) -> RawEntryBuilder<'_, K, V, S>

    🔬This is a nightly-only experimental API. (hash_raw_entry)

    Creates a raw immutable entry builder for the HashMap.

    \n

    Raw entries provide the lowest level of control for searching and\nmanipulating a map. They must be manually initialized with a hash and\nthen manually searched.

    \n

    This is useful for

    \n
      \n
    • Hash memoization
    • \n
    • Using a search key that doesn’t work with the Borrow trait
    • \n
    • Using custom comparison logic without newtype wrappers
    • \n
    \n

    Unless you are in such a situation, higher-level and more foolproof APIs like\nget should be preferred.

    \n

    Immutable raw entries have very limited use; you might instead want raw_entry_mut.

    \n
    ",0,"bdk_chain::spk_client::TxCache"],["
    source§

    impl<K, V, S> HashMap<K, V, S>

    1.7.0 (const: unstable) · source

    pub fn with_hasher(hash_builder: S) -> HashMap<K, V, S>

    Creates an empty HashMap which will use the given hash builder to hash\nkeys.

    \n

    The created map has the default initial capacity.

    \n

    Warning: hash_builder is normally randomly generated, and\nis designed to allow HashMaps to be resistant to attacks that\ncause many collisions and very poor performance. Setting it\nmanually using this function can expose a DoS attack vector.

    \n

    The hash_builder passed should implement the BuildHasher trait for\nthe HashMap to be useful, see its documentation for details.

    \n
    §Examples
    \n
    use std::collections::HashMap;\nuse std::hash::RandomState;\n\nlet s = RandomState::new();\nlet mut map = HashMap::with_hasher(s);\nmap.insert(1, 2);
    \n
    1.7.0 · source

    pub fn with_capacity_and_hasher(capacity: usize, hasher: S) -> HashMap<K, V, S>

    Creates an empty HashMap with at least the specified capacity, using\nhasher to hash the keys.

    \n

    The hash map will be able to hold at least capacity elements without\nreallocating. This method is allowed to allocate for more elements than\ncapacity. If capacity is 0, the hash map will not allocate.

    \n

    Warning: hasher is normally randomly generated, and\nis designed to allow HashMaps to be resistant to attacks that\ncause many collisions and very poor performance. Setting it\nmanually using this function can expose a DoS attack vector.

    \n

    The hasher passed should implement the BuildHasher trait for\nthe HashMap to be useful, see its documentation for details.

    \n
    §Examples
    \n
    use std::collections::HashMap;\nuse std::hash::RandomState;\n\nlet s = RandomState::new();\nlet mut map = HashMap::with_capacity_and_hasher(10, s);\nmap.insert(1, 2);
    \n
    1.0.0 · source

    pub fn capacity(&self) -> usize

    Returns the number of elements the map can hold without reallocating.

    \n

    This number is a lower bound; the HashMap<K, V> might be able to hold\nmore, but is guaranteed to be able to hold at least this many.

    \n
    §Examples
    \n
    use std::collections::HashMap;\nlet map: HashMap<i32, i32> = HashMap::with_capacity(100);\nassert!(map.capacity() >= 100);
    \n
    1.0.0 · source

    pub fn keys(&self) -> Keys<'_, K, V>

    An iterator visiting all keys in arbitrary order.\nThe iterator element type is &'a K.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet map = HashMap::from([\n    (\"a\", 1),\n    (\"b\", 2),\n    (\"c\", 3),\n]);\n\nfor key in map.keys() {\n    println!(\"{key}\");\n}
    \n
    §Performance
    \n

    In the current implementation, iterating over keys takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

    \n
    1.54.0 · source

    pub fn into_keys(self) -> IntoKeys<K, V>

    Creates a consuming iterator visiting all the keys in arbitrary order.\nThe map cannot be used after calling this.\nThe iterator element type is K.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet map = HashMap::from([\n    (\"a\", 1),\n    (\"b\", 2),\n    (\"c\", 3),\n]);\n\nlet mut vec: Vec<&str> = map.into_keys().collect();\n// The `IntoKeys` iterator produces keys in arbitrary order, so the\n// keys must be sorted to test them against a sorted array.\nvec.sort_unstable();\nassert_eq!(vec, [\"a\", \"b\", \"c\"]);
    \n
    §Performance
    \n

    In the current implementation, iterating over keys takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

    \n
    1.0.0 · source

    pub fn values(&self) -> Values<'_, K, V>

    An iterator visiting all values in arbitrary order.\nThe iterator element type is &'a V.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet map = HashMap::from([\n    (\"a\", 1),\n    (\"b\", 2),\n    (\"c\", 3),\n]);\n\nfor val in map.values() {\n    println!(\"{val}\");\n}
    \n
    §Performance
    \n

    In the current implementation, iterating over values takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

    \n
    1.10.0 · source

    pub fn values_mut(&mut self) -> ValuesMut<'_, K, V>

    An iterator visiting all values mutably in arbitrary order.\nThe iterator element type is &'a mut V.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut map = HashMap::from([\n    (\"a\", 1),\n    (\"b\", 2),\n    (\"c\", 3),\n]);\n\nfor val in map.values_mut() {\n    *val = *val + 10;\n}\n\nfor val in map.values() {\n    println!(\"{val}\");\n}
    \n
    §Performance
    \n

    In the current implementation, iterating over values takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

    \n
    1.54.0 · source

    pub fn into_values(self) -> IntoValues<K, V>

    Creates a consuming iterator visiting all the values in arbitrary order.\nThe map cannot be used after calling this.\nThe iterator element type is V.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet map = HashMap::from([\n    (\"a\", 1),\n    (\"b\", 2),\n    (\"c\", 3),\n]);\n\nlet mut vec: Vec<i32> = map.into_values().collect();\n// The `IntoValues` iterator produces values in arbitrary order, so\n// the values must be sorted to test them against a sorted array.\nvec.sort_unstable();\nassert_eq!(vec, [1, 2, 3]);
    \n
    §Performance
    \n

    In the current implementation, iterating over values takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

    \n
    1.0.0 · source

    pub fn iter(&self) -> Iter<'_, K, V>

    An iterator visiting all key-value pairs in arbitrary order.\nThe iterator element type is (&'a K, &'a V).

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet map = HashMap::from([\n    (\"a\", 1),\n    (\"b\", 2),\n    (\"c\", 3),\n]);\n\nfor (key, val) in map.iter() {\n    println!(\"key: {key} val: {val}\");\n}
    \n
    §Performance
    \n

    In the current implementation, iterating over map takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

    \n
    1.0.0 · source

    pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

    An iterator visiting all key-value pairs in arbitrary order,\nwith mutable references to the values.\nThe iterator element type is (&'a K, &'a mut V).

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut map = HashMap::from([\n    (\"a\", 1),\n    (\"b\", 2),\n    (\"c\", 3),\n]);\n\n// Update all values\nfor (_, val) in map.iter_mut() {\n    *val *= 2;\n}\n\nfor (key, val) in &map {\n    println!(\"key: {key} val: {val}\");\n}
    \n
    §Performance
    \n

    In the current implementation, iterating over map takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

    \n
    1.0.0 · source

    pub fn len(&self) -> usize

    Returns the number of elements in the map.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut a = HashMap::new();\nassert_eq!(a.len(), 0);\na.insert(1, \"a\");\nassert_eq!(a.len(), 1);
    \n
    1.0.0 · source

    pub fn is_empty(&self) -> bool

    Returns true if the map contains no elements.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut a = HashMap::new();\nassert!(a.is_empty());\na.insert(1, \"a\");\nassert!(!a.is_empty());
    \n
    1.6.0 · source

    pub fn drain(&mut self) -> Drain<'_, K, V>

    Clears the map, returning all key-value pairs as an iterator. Keeps the\nallocated memory for reuse.

    \n

    If the returned iterator is dropped before being fully consumed, it\ndrops the remaining key-value pairs. The returned iterator keeps a\nmutable borrow on the map to optimize its implementation.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut a = HashMap::new();\na.insert(1, \"a\");\na.insert(2, \"b\");\n\nfor (k, v) in a.drain().take(1) {\n    assert!(k == 1 || k == 2);\n    assert!(v == \"a\" || v == \"b\");\n}\n\nassert!(a.is_empty());
    \n
    source

    pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, K, V, F>
    where\n F: FnMut(&K, &mut V) -> bool,

    🔬This is a nightly-only experimental API. (hash_extract_if)

    Creates an iterator which uses a closure to determine if an element should be removed.

    \n

    If the closure returns true, the element is removed from the map and yielded.\nIf the closure returns false, or panics, the element remains in the map and will not be\nyielded.

    \n

    Note that extract_if lets you mutate every value in the filter closure, regardless of\nwhether you choose to keep or remove it.

    \n

    If the returned ExtractIf is not exhausted, e.g. because it is dropped without iterating\nor the iteration short-circuits, then the remaining elements will be retained.\nUse retain with a negated predicate if you do not need the returned iterator.

    \n
    §Examples
    \n

    Splitting a map into even and odd keys, reusing the original map:

    \n\n
    #![feature(hash_extract_if)]\nuse std::collections::HashMap;\n\nlet mut map: HashMap<i32, i32> = (0..8).map(|x| (x, x)).collect();\nlet extracted: HashMap<i32, i32> = map.extract_if(|k, _v| k % 2 == 0).collect();\n\nlet mut evens = extracted.keys().copied().collect::<Vec<_>>();\nlet mut odds = map.keys().copied().collect::<Vec<_>>();\nevens.sort();\nodds.sort();\n\nassert_eq!(evens, vec![0, 2, 4, 6]);\nassert_eq!(odds, vec![1, 3, 5, 7]);
    \n
    1.18.0 · source

    pub fn retain<F>(&mut self, f: F)
    where\n F: FnMut(&K, &mut V) -> bool,

    Retains only the elements specified by the predicate.

    \n

    In other words, remove all pairs (k, v) for which f(&k, &mut v) returns false.\nThe elements are visited in unsorted (and unspecified) order.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut map: HashMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect();\nmap.retain(|&k, _| k % 2 == 0);\nassert_eq!(map.len(), 4);
    \n
    §Performance
    \n

    In the current implementation, this operation takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

    \n
    1.0.0 · source

    pub fn clear(&mut self)

    Clears the map, removing all key-value pairs. Keeps the allocated memory\nfor reuse.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut a = HashMap::new();\na.insert(1, \"a\");\na.clear();\nassert!(a.is_empty());
    \n
    1.9.0 · source

    pub fn hasher(&self) -> &S

    Returns a reference to the map’s BuildHasher.

    \n
    §Examples
    \n
    use std::collections::HashMap;\nuse std::hash::RandomState;\n\nlet hasher = RandomState::new();\nlet map: HashMap<i32, i32> = HashMap::with_hasher(hasher);\nlet hasher: &RandomState = map.hasher();
    \n
    ",0,"bdk_chain::spk_client::TxCache"],["
    source§

    impl<K, V, S> HashMap<K, V, S>
    where\n K: Eq + Hash,\n S: BuildHasher,

    1.0.0 · source

    pub fn reserve(&mut self, additional: usize)

    Reserves capacity for at least additional more elements to be inserted\nin the HashMap. The collection may reserve more space to speculatively\navoid frequent reallocations. After calling reserve,\ncapacity will be greater than or equal to self.len() + additional.\nDoes nothing if capacity is already sufficient.

    \n
    §Panics
    \n

    Panics if the new allocation size overflows usize.

    \n
    §Examples
    \n
    use std::collections::HashMap;\nlet mut map: HashMap<&str, i32> = HashMap::new();\nmap.reserve(10);
    \n
    1.57.0 · source

    pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

    Tries to reserve capacity for at least additional more elements to be inserted\nin the HashMap. The collection may reserve more space to speculatively\navoid frequent reallocations. After calling try_reserve,\ncapacity will be greater than or equal to self.len() + additional if\nit returns Ok(()).\nDoes nothing if capacity is already sufficient.

    \n
    §Errors
    \n

    If the capacity overflows, or the allocator reports a failure, then an error\nis returned.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut map: HashMap<&str, isize> = HashMap::new();\nmap.try_reserve(10).expect(\"why is the test harness OOMing on a handful of bytes?\");
    \n
    1.0.0 · source

    pub fn shrink_to_fit(&mut self)

    Shrinks the capacity of the map as much as possible. It will drop\ndown as much as possible while maintaining the internal rules\nand possibly leaving some space in accordance with the resize policy.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut map: HashMap<i32, i32> = HashMap::with_capacity(100);\nmap.insert(1, 2);\nmap.insert(3, 4);\nassert!(map.capacity() >= 100);\nmap.shrink_to_fit();\nassert!(map.capacity() >= 2);
    \n
    1.56.0 · source

    pub fn shrink_to(&mut self, min_capacity: usize)

    Shrinks the capacity of the map with a lower limit. It will drop\ndown no lower than the supplied limit while maintaining the internal rules\nand possibly leaving some space in accordance with the resize policy.

    \n

    If the current capacity is less than the lower limit, this is a no-op.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut map: HashMap<i32, i32> = HashMap::with_capacity(100);\nmap.insert(1, 2);\nmap.insert(3, 4);\nassert!(map.capacity() >= 100);\nmap.shrink_to(10);\nassert!(map.capacity() >= 10);\nmap.shrink_to(0);\nassert!(map.capacity() >= 2);
    \n
    1.0.0 · source

    pub fn entry(&mut self, key: K) -> Entry<'_, K, V>

    Gets the given key’s corresponding entry in the map for in-place manipulation.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut letters = HashMap::new();\n\nfor ch in \"a short treatise on fungi\".chars() {\n    letters.entry(ch).and_modify(|counter| *counter += 1).or_insert(1);\n}\n\nassert_eq!(letters[&'s'], 2);\nassert_eq!(letters[&'t'], 3);\nassert_eq!(letters[&'u'], 1);\nassert_eq!(letters.get(&'y'), None);
    \n
    1.0.0 · source

    pub fn get<Q>(&self, k: &Q) -> Option<&V>
    where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

    Returns a reference to the value corresponding to the key.

    \n

    The key may be any borrowed form of the map’s key type, but\nHash and Eq on the borrowed form must match those for\nthe key type.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut map = HashMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.get(&1), Some(&\"a\"));\nassert_eq!(map.get(&2), None);
    \n
    1.40.0 · source

    pub fn get_key_value<Q>(&self, k: &Q) -> Option<(&K, &V)>
    where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

    Returns the key-value pair corresponding to the supplied key.

    \n

    The supplied key may be any borrowed form of the map’s key type, but\nHash and Eq on the borrowed form must match those for\nthe key type.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut map = HashMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.get_key_value(&1), Some((&1, &\"a\")));\nassert_eq!(map.get_key_value(&2), None);
    \n
    source

    pub fn get_many_mut<Q, const N: usize>(\n &mut self,\n ks: [&Q; N]\n) -> Option<[&mut V; N]>
    where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

    🔬This is a nightly-only experimental API. (map_many_mut)

    Attempts to get mutable references to N values in the map at once.

    \n

    Returns an array of length N with the results of each query. For soundness, at most one\nmutable reference will be returned to any value. None will be returned if any of the\nkeys are duplicates or missing.

    \n
    §Examples
    \n
    #![feature(map_many_mut)]\nuse std::collections::HashMap;\n\nlet mut libraries = HashMap::new();\nlibraries.insert(\"Bodleian Library\".to_string(), 1602);\nlibraries.insert(\"Athenæum\".to_string(), 1807);\nlibraries.insert(\"Herzogin-Anna-Amalia-Bibliothek\".to_string(), 1691);\nlibraries.insert(\"Library of Congress\".to_string(), 1800);\n\nlet got = libraries.get_many_mut([\n    \"Athenæum\",\n    \"Library of Congress\",\n]);\nassert_eq!(\n    got,\n    Some([\n        &mut 1807,\n        &mut 1800,\n    ]),\n);\n\n// Missing keys result in None\nlet got = libraries.get_many_mut([\n    \"Athenæum\",\n    \"New York Public Library\",\n]);\nassert_eq!(got, None);\n\n// Duplicate keys result in None\nlet got = libraries.get_many_mut([\n    \"Athenæum\",\n    \"Athenæum\",\n]);\nassert_eq!(got, None);
    \n
    source

    pub unsafe fn get_many_unchecked_mut<Q, const N: usize>(\n &mut self,\n ks: [&Q; N]\n) -> Option<[&mut V; N]>
    where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

    🔬This is a nightly-only experimental API. (map_many_mut)

    Attempts to get mutable references to N values in the map at once, without validating that\nthe values are unique.

    \n

    Returns an array of length N with the results of each query. None will be returned if\nany of the keys are missing.

    \n

    For a safe alternative see get_many_mut.

    \n
    §Safety
    \n

    Calling this method with overlapping keys is undefined behavior even if the resulting\nreferences are not used.

    \n
    §Examples
    \n
    #![feature(map_many_mut)]\nuse std::collections::HashMap;\n\nlet mut libraries = HashMap::new();\nlibraries.insert(\"Bodleian Library\".to_string(), 1602);\nlibraries.insert(\"Athenæum\".to_string(), 1807);\nlibraries.insert(\"Herzogin-Anna-Amalia-Bibliothek\".to_string(), 1691);\nlibraries.insert(\"Library of Congress\".to_string(), 1800);\n\nlet got = libraries.get_many_mut([\n    \"Athenæum\",\n    \"Library of Congress\",\n]);\nassert_eq!(\n    got,\n    Some([\n        &mut 1807,\n        &mut 1800,\n    ]),\n);\n\n// Missing keys result in None\nlet got = libraries.get_many_mut([\n    \"Athenæum\",\n    \"New York Public Library\",\n]);\nassert_eq!(got, None);
    \n
    1.0.0 · source

    pub fn contains_key<Q>(&self, k: &Q) -> bool
    where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

    Returns true if the map contains a value for the specified key.

    \n

    The key may be any borrowed form of the map’s key type, but\nHash and Eq on the borrowed form must match those for\nthe key type.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut map = HashMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.contains_key(&1), true);\nassert_eq!(map.contains_key(&2), false);
    \n
    1.0.0 · source

    pub fn get_mut<Q>(&mut self, k: &Q) -> Option<&mut V>
    where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

    Returns a mutable reference to the value corresponding to the key.

    \n

    The key may be any borrowed form of the map’s key type, but\nHash and Eq on the borrowed form must match those for\nthe key type.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut map = HashMap::new();\nmap.insert(1, \"a\");\nif let Some(x) = map.get_mut(&1) {\n    *x = \"b\";\n}\nassert_eq!(map[&1], \"b\");
    \n
    1.0.0 · source

    pub fn insert(&mut self, k: K, v: V) -> Option<V>

    Inserts a key-value pair into the map.

    \n

    If the map did not have this key present, None is returned.

    \n

    If the map did have this key present, the value is updated, and the old\nvalue is returned. The key is not updated, though; this matters for\ntypes that can be == without being identical. See the module-level\ndocumentation for more.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut map = HashMap::new();\nassert_eq!(map.insert(37, \"a\"), None);\nassert_eq!(map.is_empty(), false);\n\nmap.insert(37, \"b\");\nassert_eq!(map.insert(37, \"c\"), Some(\"b\"));\nassert_eq!(map[&37], \"c\");
    \n
    source

    pub fn try_insert(\n &mut self,\n key: K,\n value: V\n) -> Result<&mut V, OccupiedError<'_, K, V>>

    🔬This is a nightly-only experimental API. (map_try_insert)

    Tries to insert a key-value pair into the map, and returns\na mutable reference to the value in the entry.

    \n

    If the map already had this key present, nothing is updated, and\nan error containing the occupied entry and the value is returned.

    \n
    §Examples
    \n

    Basic usage:

    \n\n
    #![feature(map_try_insert)]\n\nuse std::collections::HashMap;\n\nlet mut map = HashMap::new();\nassert_eq!(map.try_insert(37, \"a\").unwrap(), &\"a\");\n\nlet err = map.try_insert(37, \"b\").unwrap_err();\nassert_eq!(err.entry.key(), &37);\nassert_eq!(err.entry.get(), &\"a\");\nassert_eq!(err.value, \"b\");
    \n
    1.0.0 · source

    pub fn remove<Q>(&mut self, k: &Q) -> Option<V>
    where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

    Removes a key from the map, returning the value at the key if the key\nwas previously in the map.

    \n

    The key may be any borrowed form of the map’s key type, but\nHash and Eq on the borrowed form must match those for\nthe key type.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut map = HashMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.remove(&1), Some(\"a\"));\nassert_eq!(map.remove(&1), None);
    \n
    1.27.0 · source

    pub fn remove_entry<Q>(&mut self, k: &Q) -> Option<(K, V)>
    where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

    Removes a key from the map, returning the stored key and value if the\nkey was previously in the map.

    \n

    The key may be any borrowed form of the map’s key type, but\nHash and Eq on the borrowed form must match those for\nthe key type.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet mut map = HashMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.remove_entry(&1), Some((1, \"a\")));\nassert_eq!(map.remove(&1), None);
    \n
    ",0,"bdk_chain::spk_client::TxCache"],["
    1.0.0 · source§

    impl<K, Q, V, S> Index<&Q> for HashMap<K, V, S>
    where\n K: Eq + Hash + Borrow<Q>,\n Q: Eq + Hash + ?Sized,\n S: BuildHasher,

    source§

    fn index(&self, key: &Q) -> &V

    Returns a reference to the value corresponding to the supplied key.

    \n
    §Panics
    \n

    Panics if the key is not present in the HashMap.

    \n
    §

    type Output = V

    The returned type after indexing.
    ","Index<&Q>","bdk_chain::spk_client::TxCache"],["
    source§

    impl<'de, K, V, S, E> IntoDeserializer<'de, E> for HashMap<K, V, S>
    where\n K: IntoDeserializer<'de, E> + Eq + Hash,\n V: IntoDeserializer<'de, E>,\n S: BuildHasher,\n E: Error,

    §

    type Deserializer = MapDeserializer<'de, <HashMap<K, V, S> as IntoIterator>::IntoIter, E>

    The type of the deserializer being converted into.
    source§

    fn into_deserializer(\n self\n) -> <HashMap<K, V, S> as IntoDeserializer<'de, E>>::Deserializer

    Convert this value into a deserializer.
    ","IntoDeserializer<'de, E>","bdk_chain::spk_client::TxCache"],["
    1.0.0 · source§

    impl<K, V, S> IntoIterator for HashMap<K, V, S>

    source§

    fn into_iter(self) -> IntoIter<K, V>

    Creates a consuming iterator, that is, one that moves each key-value\npair out of the map in arbitrary order. The map cannot be used after\ncalling this.

    \n
    §Examples
    \n
    use std::collections::HashMap;\n\nlet map = HashMap::from([\n    (\"a\", 1),\n    (\"b\", 2),\n    (\"c\", 3),\n]);\n\n// Not possible with .iter()\nlet vec: Vec<(&str, i32)> = map.into_iter().collect();
    \n
    §

    type Item = (K, V)

    The type of the elements being iterated over.
    §

    type IntoIter = IntoIter<K, V>

    Which kind of iterator are we turning this into?
    ","IntoIterator","bdk_chain::spk_client::TxCache"],["
    1.0.0 · source§

    impl<K, V, S> PartialEq for HashMap<K, V, S>
    where\n K: Eq + Hash,\n V: PartialEq,\n S: BuildHasher,

    source§

    fn eq(&self, other: &HashMap<K, V, S>) -> bool

    This method tests for self and other values to be equal, and is used\nby ==.
    1.0.0 · source§

    fn ne(&self, other: &Rhs) -> bool

    This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
    ","PartialEq","bdk_chain::spk_client::TxCache"],["
    source§

    impl<K, V, H> Serialize for HashMap<K, V, H>
    where\n K: Serialize,\n V: Serialize,

    source§

    fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
    where\n S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    ","Serialize","bdk_chain::spk_client::TxCache"],["
    1.0.0 · source§

    impl<K, V, S> Eq for HashMap<K, V, S>
    where\n K: Eq + Hash,\n V: Eq,\n S: BuildHasher,

    ","Eq","bdk_chain::spk_client::TxCache"],["
    1.36.0 · source§

    impl<K, V, S> UnwindSafe for HashMap<K, V, S>
    where\n K: UnwindSafe,\n V: UnwindSafe,\n S: UnwindSafe,

    ","UnwindSafe","bdk_chain::spk_client::TxCache"]] -};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/wallet_electrum_example/fn.main.html b/docs-rs/bdk/nightly/latest/wallet_electrum_example/fn.main.html index 227c07dbea..42ee1f922c 100644 --- a/docs-rs/bdk/nightly/latest/wallet_electrum_example/fn.main.html +++ b/docs-rs/bdk/nightly/latest/wallet_electrum_example/fn.main.html @@ -1 +1 @@ -main in wallet_electrum_example - Rust

    Function wallet_electrum_example::main

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

    Function wallet_electrum_example::main

    source ·
    pub(crate) fn main() -> Result<(), Error>
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/wallet_electrum_example/index.html b/docs-rs/bdk/nightly/latest/wallet_electrum_example/index.html index e5b471f663..bd7a48c8a0 100644 --- a/docs-rs/bdk/nightly/latest/wallet_electrum_example/index.html +++ b/docs-rs/bdk/nightly/latest/wallet_electrum_example/index.html @@ -1 +1 @@ -wallet_electrum_example - Rust

    Crate wallet_electrum_example

    source ·

    Constants§

    Functions§

    \ No newline at end of file +wallet_electrum_example - Rust

    Crate wallet_electrum_example

    source ·

    Constants§

    Functions§

    \ No newline at end of file diff --git a/examples/index.html b/examples/index.html index 8a82827bc5..20512155e0 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/about/index.html b/foundation/about/index.html index 0a665b7d8e..25ed8d3232 100644 --- a/foundation/about/index.html +++ b/foundation/about/index.html @@ -29,7 +29,7 @@ - + @@ -78,6 +78,6 @@
    - + diff --git a/foundation/grantees/index.html b/foundation/grantees/index.html index 7d62bc7ed7..ff1f0dd3b7 100644 --- a/foundation/grantees/index.html +++ b/foundation/grantees/index.html @@ -29,7 +29,7 @@ - + @@ -78,6 +78,6 @@
    - + diff --git a/foundation/index.html b/foundation/index.html index 46d5dc7c4a..299aec910e 100644 --- a/foundation/index.html +++ b/foundation/index.html @@ -29,7 +29,7 @@ - + @@ -74,6 +74,6 @@
    - + diff --git a/foundation/supporters/index.html b/foundation/supporters/index.html index ecefdd499a..f48935504b 100644 --- a/foundation/supporters/index.html +++ b/foundation/supporters/index.html @@ -29,7 +29,7 @@ - + @@ -112,6 +112,6 @@
    - + diff --git a/getting-started/index.html b/getting-started/index.html index 3d1a4b1fc1..cac9b6543b 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).

    BDK Foundation
    - + diff --git a/index.html b/index.html index d44a258a15..f539b64ca5 100644 --- a/index.html +++ b/index.html @@ -29,7 +29,7 @@ - + @@ -80,6 +80,6 @@
    BDK Foundation
    - + diff --git a/sitemap.xml b/sitemap.xml index dbeda0d28b..5179e9b751 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -https://bitcoindevkit.org/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/_2023-q4-update/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/_2024-q1-update/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/bitcoin-core-rpc-demo/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/bdk-cli-basics-multisig-2of3/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/bdk-cli-basics/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/bdk-core-pt1/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/bdk-rn-making-of/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/bdk-with-tor/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/bindings-scope/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/compact-filters-demo/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/descriptor-based-paper-wallet/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/descriptors-in-the-wild/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/exploring-bdk-flutter/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/exploring-bdk-rn/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-2/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-3/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/getting-started-with-rust-hwi/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/2020/12/hello-world/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/hidden-power-of-bitcoin/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/improving-coin-selection-in-bdk/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/2020/12/release-v0.2.0/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/miniscript-vulnerability/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/release-v0.3.0/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/2021/02/release-v0.4.0/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/2021/03/release-v0.5.0/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/2021/04/release-v0.6.0/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/2021/05/release-v0.7.0/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/2021/06/release-v0.8.0/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/2021/07/release-v0.9.0/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/road-to-bdk-1/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/spending-policy-demo/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/using-bdk-with-hardware-wallets/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/blog/why-bindings/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/adoption/custodial/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/adoption/all/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/adoption/desktop/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/adoption/exchange/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/adoption/hardware/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/adoption/infrastructure/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/adoption/mobile/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/bdk-cli/compiler/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/adoption/web/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/bdk-cli/concept/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/bdk-cli/installation/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/bdk-cli/interface/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/bdk-cli/introduction/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/bdk-cli/playground/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/bdk-cli/regtest/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/case-studies/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/descriptors/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/examples/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/foundation/about/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/foundation/grantees/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/foundation/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/foundation/supporters/2024-06-04T22:14:13.000Zdailyhttps://bitcoindevkit.org/getting-started/2024-06-04T22:14:13.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/Bitcoin%20Core/dailyhttps://bitcoindevkit.org/blog/tags/RPC/dailyhttps://bitcoindevkit.org/blog/tags/Wallet/dailyhttps://bitcoindevkit.org/blog/tags/bdk-cli/dailyhttps://bitcoindevkit.org/blog/tags/multi-sig/dailyhttps://bitcoindevkit.org/blog/tags/basics/dailyhttps://bitcoindevkit.org/blog/tags/novice/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/tor/dailyhttps://bitcoindevkit.org/blog/tags/wallet/dailyhttps://bitcoindevkit.org/blog/tags/blockchain/dailyhttps://bitcoindevkit.org/blog/tags/bindings/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/release/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/Rajarshi%20Maitra/dailyhttps://bitcoindevkit.org/blog/author/waterst0ne/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-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/_2023-q4-update/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/_2024-q1-update/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/bitcoin-core-rpc-demo/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/bdk-cli-basics/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/bdk-core-pt1/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/bdk-with-tor/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/bindings-scope/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/bdk-cli-basics-multisig-2of3/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/bdk-rn-making-of/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/compact-filters-demo/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/descriptor-based-paper-wallet/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/descriptors-in-the-wild/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/exploring-bdk-flutter/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/exploring-bdk-rn/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-2/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-3/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/getting-started-with-rust-hwi/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/2020/12/hello-world/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/hidden-power-of-bitcoin/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/improving-coin-selection-in-bdk/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/miniscript-vulnerability/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/release-v0.3.0/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/2020/12/release-v0.2.0/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/2021/03/release-v0.5.0/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/2021/06/release-v0.8.0/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/2021/04/release-v0.6.0/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/2021/05/release-v0.7.0/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/road-to-bdk-1/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/spending-policy-demo/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/2021/07/release-v0.9.0/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/2021/02/release-v0.4.0/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/using-bdk-with-hardware-wallets/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/adoption/all/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/adoption/custodial/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/blog/why-bindings/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/adoption/desktop/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/adoption/exchange/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/adoption/mobile/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/adoption/hardware/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/adoption/infrastructure/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/bdk-cli/compiler/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/adoption/web/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/bdk-cli/concept/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/bdk-cli/installation/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/bdk-cli/interface/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/bdk-cli/introduction/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/bdk-cli/playground/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/bdk-cli/regtest/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/case-studies/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/descriptors/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/foundation/grantees/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/examples/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/foundation/about/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/foundation/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/foundation/supporters/2024-06-05T02:21:26.000Zdailyhttps://bitcoindevkit.org/getting-started/2024-06-05T02:21:26.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/Bitcoin%20Core/dailyhttps://bitcoindevkit.org/blog/tags/RPC/dailyhttps://bitcoindevkit.org/blog/tags/Wallet/dailyhttps://bitcoindevkit.org/blog/tags/bdk-cli/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/multi-sig/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/Rajarshi%20Maitra/dailyhttps://bitcoindevkit.org/blog/author/waterst0ne/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/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