diff --git a/404.html b/404.html index 5cf16cbbd7..ebdbc706e0 100644 --- a/404.html +++ b/404.html @@ -15,7 +15,7 @@ - + @@ -62,6 +62,6 @@
BDK Foundation
- + diff --git a/adoption/all/index.html b/adoption/all/index.html index 6dc51ace20..c35edc800a 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 e9369eeb83..70bc3371aa 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 0d053112e5..39f8604f91 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 7885e1fa50..507fd31f77 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 5a650b6038..86e9e200fd 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 4f37cf4768..de490e4883 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 61d8531187..077fbf1ce9 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 3625adbbce..9beb74cfac 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/19.09984b8f.js b/assets/js/19.fa54ae34.js similarity index 99% rename from assets/js/19.09984b8f.js rename to assets/js/19.fa54ae34.js index 6c67837073..d4024654b6 100644 --- a/assets/js/19.09984b8f.js +++ b/assets/js/19.fa54ae34.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{355:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_complete_app.c74da859.png"},356:function(t,a,s){t.exports=s.p+"assets/img/default_flutter_app.31b31721.png"},357:function(t,a,s){t.exports=s.p+"assets/img/assets_section.b43d75e9.png"},358:function(t,a,s){t.exports=s.p+"assets/img/folder_structure.b2750bd6.png"},359:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_title.e4e3484a.png"},360:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_tutorial_screen_mnemonic.df703b77.png"},361:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_tutorial_screen_createwallet.3b052736.png"},362:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_get_balance.bfdf9ced.png"},363:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_get_address.5db2e3cc.png"},364:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_get_restore.db8e7e55.png"},365:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_send.1688372b.png"},412:function(t,a,s){"use strict";s.r(a);var n=s(7),e=Object(n.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[a("code",[t._v("bdk-flutter")]),t._v(" is the "),a("strong",[t._v("Bitcoin Dev kit")]),t._v("'s "),a("strong",[t._v("Flutter")]),t._v(" library which enables building bitcoin applications for Android and iOS mobile platforms. Using "),a("code",[t._v("bdk-flutter")]),t._v(" is similar to using any other Flutter module. Just do "),a("code",[t._v("flutter pub add bdk_flutter")]),t._v(" and you are ready to code! This is the first tutorial on how to use "),a("code",[t._v("bdk-flutter")]),t._v(", more coming soon, make sure to "),a("a",{attrs:{href:"https://twitter.com/BitcoinZavior",target:"_blank",rel:"noopener noreferrer"}},[t._v("follow"),a("OutboundLink")],1),t._v(" to be notified of new ones. There will also be a "),a("strong",[a("code",[t._v("bdk-flutter")])]),t._v(" focused Livestream on "),a("a",{attrs:{href:"https://www.twitch.tv/bitcoindevelopers",target:"_blank",rel:"noopener noreferrer"}},[t._v("Twitch"),a("OutboundLink")],1),t._v(" on the Bitcoin Developers "),a("a",{attrs:{href:"https://www.youtube.com/channel/UCUq_ZdezVWKPvkWRicAYxLA/videos",target:"_blank",rel:"noopener noreferrer"}},[t._v("YouTube Channel"),a("OutboundLink")],1),t._v(" so make sure to subscribe.")]),t._v(" "),a("p",[t._v("This tutorial will explore "),a("code",[t._v("bdk-flutter")]),t._v(" usage and the API it provides. This guide will walk through the development process and code for making a bitcoin application. The bitcoin application we create will be a non-custodial HD Wallet. The application will have the functionality to create a new wallet or restore from a known mnemonic seed phrase. This application will also be able to interact with the bitcoin network to sync UTXOs from new blocks and broadcast transactions.")]),t._v(" "),a("p",[t._v("The tutorial will focus on bitcoin concepts and "),a("code",[t._v("bdk-flutter")]),t._v(" API. So it will gloss over Flutter and Dart. If you are interested in learning more about Flutter and Dart please refer to the Flutter "),a("a",{attrs:{href:"https://flutter.dev/learn",target:"_blank",rel:"noopener noreferrer"}},[t._v("learning portal"),a("OutboundLink")],1),t._v(". The code for this tutorial is available on the "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter-quickstart",target:"_blank",rel:"noopener noreferrer"}},[t._v("LtbLightning GitHub"),a("OutboundLink")],1)]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"25%"},attrs:{src:s(355)}}),t._v(" "),a("h3",{attrs:{id:"prerequisites"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites"}},[t._v("#")]),t._v(" Prerequisites")]),t._v(" "),a("p",[t._v("To use "),a("code",[t._v("bdk-flutter")]),t._v(" in a Flutter App, a Flutter development environment is required. Please refer to resources out there on the internet if you need to set this up, here is one of many good resources to guide you on "),a("a",{attrs:{href:"https://docs.flutter.dev/get-started/install",target:"_blank",rel:"noopener noreferrer"}},[t._v("environment setup"),a("OutboundLink")],1)]),t._v(" "),a("h3",{attrs:{id:"bitcoin-basics"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-basics"}},[t._v("#")]),t._v(" Bitcoin Basics")]),t._v(" "),a("p",[t._v("The bitcoin concepts used in this blog post are detailed and explained very well in external bitcoin resources. Here are some links for reference:")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch04.asciidoc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mastering Bitcoin(HD Wallet chapter)"),a("OutboundLink")],1)]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Output Descriptors from bitcoin GitHub"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("Now let's jump into Bitcoin Dev Kit")]),t._v(" "),a("h2",{attrs:{id:"bitcoin-dev-kit-and-bdk-flutter"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-dev-kit-and-bdk-flutter"}},[t._v("#")]),t._v(" Bitcoin Dev Kit and bdk-flutter")]),t._v(" "),a("p",[a("code",[t._v("bdk-flutter")]),t._v(" is "),a("strong",[t._v("Bitcoin Dev kit")]),t._v("'s "),a("strong",[t._v("Flutter")]),t._v(" library for building Bitcoin apps in "),a("strong",[t._v("Flutter")]),t._v(".\nIt encapsulates all of the low-level APIs and methods for BDK and exposes them in a Flutter context. To use BDK in Flutter apps only the "),a("code",[t._v("bdk-flutter")]),t._v(" module is required. "),a("code",[t._v("bdk-flutter")]),t._v(" can be used like any other Flutter library and is available on "),a("a",{attrs:{href:"https://pub.dev/packages/bdk_flutter",target:"_blank",rel:"noopener noreferrer"}},[t._v("pub.dev"),a("OutboundLink")],1)]),t._v(" "),a("h2",{attrs:{id:"getting-started"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[t._v("#")]),t._v(" Getting Started")]),t._v(" "),a("p",[t._v("Although we won't delve deep into Flutter we will focus more on bitcoin and "),a("code",[t._v("bdk-flutter")]),t._v(", however, some rudimentary Flutter setup is required, especially a basic Flutter app to add our code.")]),t._v(" "),a("p",[t._v("start by creating a new Flutter project.")]),t._v(" "),a("p",[a("code",[t._v("flutter create bdk-flutter-quickstart")])]),t._v(" "),a("p",[t._v("Once done let's "),a("code",[t._v("cd")]),t._v(" into the new project directory and run the basic Flutter app that's created")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" bdk-flutter-quickstart\nflutter run\n")])])]),a("p",[t._v("This should start building the app and then launch the app in a simulator. So far we have created a basic Flutter project if this doesn't work then refer to the Flutter development setup guide to troubleshoot.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"25%"},attrs:{src:s(356),alt:"BDK Flutter Quick Start"}}),t._v(" "),a("h2",{attrs:{id:"setting-up-flutter-app-structure"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-flutter-app-structure"}},[t._v("#")]),t._v(" Setting up Flutter app structure")]),t._v(" "),a("p",[t._v("Let's set up a very basic app structure. Let's create an "),a("code",[t._v("assets")]),t._v(" folder in the project root and then add new folders "),a("code",[t._v("widgets")]),t._v(", "),a("code",[t._v("screens")]),t._v(", and "),a("code",[t._v("styles")]),t._v(" inside the existing "),a("code",[t._v("lib")]),t._v(" folder.")]),t._v(" "),a("p",[t._v("Paste the following code in your "),a("code",[t._v("pubspec.yaml")]),t._v(" file, assets section.")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[t._v("- assets/\n")])])]),a("p",[t._v("Please make sure your assets section looks like the screenshot below.\n"),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"60%"},attrs:{src:s(357),alt:"BDK Flutter Quick Start"}})]),t._v(" "),a("p",[t._v("Once done let's run a "),a("code",[t._v("get")]),t._v(" command from the pub tool commands, this will get all the required dependencies for our project.")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("flutter pub get\n")])])]),a("p",[t._v("To make this quick you can download the theme, styled widgets and images used in the tutorial from the repository. The "),a("code",[t._v("theme.dart")]),t._v(" file has the theme we will use and this can be taken from "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter-quickstart/blob/master/lib/styles/theme.dart",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(" and moved to the styles folder. The "),a("code",[t._v("widgets.dart")]),t._v(" file has the styled widgets we will use and these can be taken from "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter-quickstart/blob/master/lib/widgets/widgets.dart",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(" and moved to the widgets folder. The image assets can be taken from "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter-quickstart/tree/master/assets",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(" Alternatively, you can write your theme, widgets and use your images if you intend to style the app differently.")]),t._v(" "),a("p",[t._v("In addition to the the theme, widgets and assets. We also need to create a "),a("code",[t._v("screens")]),t._v(" folder and create a "),a("code",[t._v("home.dart")]),t._v(" file inside it, this will be where most of the code will be added.")]),t._v(" "),a("p",[t._v("Once done the file structure should look like this:")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"60%"},attrs:{src:s(358)}}),t._v(" "),a("p",[a("br"),t._v("Locate "),a("code",[t._v("main.dart")]),t._v(" in the project root, this will have the default code added by "),a("code",[t._v("flutter create")]),t._v(", let's delete all contents of "),a("code",[t._v("main.dart")]),t._v(" and replace it with the following code to use "),a("code",[t._v("home.dart")]),t._v(" as our main screen. This will probably crash the app but that's fine, it will be up and running once we add code to "),a("code",[t._v("home.dart")]),t._v(" in the next few steps")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// main.dart")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:bdk_flutter_quickstart/screens/home.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:bdk_flutter_quickstart/styles/theme.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:flutter/material.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("main")]),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 punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("runApp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyApp")]),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("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyApp")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StatelessWidget")]),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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyApp")]),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("Key")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" key"),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 punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),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(" key"),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 comment"}},[t._v("// This widget is the root of your application.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token metadata function"}},[t._v("@override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Widget")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BuildContext")]),t._v(" context"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MaterialApp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n debugShowCheckedModeBanner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n title"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'BDK-FLUTTER TUTORIAL'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n theme"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("theme")]),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 home"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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 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("h2",{attrs:{id:"installing-bdk-flutter"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#installing-bdk-flutter"}},[t._v("#")]),t._v(" Installing "),a("code",[t._v("bdk-flutter")])]),t._v(" "),a("p",[t._v("With the Flutter project in place, we can now add "),a("code",[t._v("bdk-flutter")]),t._v(" using "),a("code",[t._v("flutter pub add")]),t._v(".")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("flutter pub "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" bdk_flutter\n")])])]),a("p",[t._v("This will add a line like this to your package's "),a("code",[t._v("pubspec.yaml")]),t._v(" and this will also run an implicit flutter pub get to download "),a("code",[t._v("bdk-flutter")]),t._v(" from "),a("code",[t._v("pub.dev")]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("dependencies:\n bdk_flutter: ^0.28.2\n")])])]),a("h2",{attrs:{id:"configuring"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#configuring"}},[t._v("#")]),t._v(" Configuring")]),t._v(" "),a("p",[t._v("Make sure your app meets the following requirements for using "),a("code",[t._v("bdk-flutter")])]),t._v(" "),a("p",[a("strong",[t._v("Android")])]),t._v(" "),a("p",[t._v("MinSdkVersion : API 23 or higher.")]),t._v(" "),a("p",[a("strong",[t._v("IOS")])]),t._v(" "),a("p",[t._v("Deployment target: iOS 12.0 or greater.")]),t._v(" "),a("p",[t._v("Locate your Podfile in the ios folder of your project and paste the following code at the beginning")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("platform :ios, '12.0'\n")])])]),a("p",[t._v("After changing the deployment target in your project's "),a("code",[t._v("PodFile")]),t._v(", let's use the following "),a("code",[t._v("command")]),t._v(" to install pod dependencies for iOS.")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" ios "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" pod "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("\n")])])]),a("p",[t._v("Once done, bdk-flutter is installed and configured and ready to be used in our "),a("strong",[t._v("bdk-flutter-quickstart")]),t._v(" App.")]),t._v(" "),a("h2",{attrs:{id:"importing-bdk-flutter"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#importing-bdk-flutter"}},[t._v("#")]),t._v(" Importing "),a("code",[t._v("bdk-flutter")])]),t._v(" "),a("p",[t._v("Locate "),a("code",[t._v("home.dart")]),t._v(" which we added in the setup section and import "),a("code",[t._v("bdk-flutter")]),t._v(" at the top of the file. Create a stateful widget called "),a("code",[t._v("Home")])]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.dart")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:bdk_flutter/bdk_flutter.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StatefulWidget")]),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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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("Key")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" key"),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 punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),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(" key"),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 metadata function"}},[t._v("@override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("State")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createState")]),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 operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_HomeState")]),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("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" _HomeState "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("State")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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 "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),t._v(" mnemonic "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),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 metadata function"}},[t._v("@override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Widget")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BuildContext")]),t._v(" context"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Container")]),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("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Before we start using "),a("code",[t._v("bdk-flutter")]),t._v(" let's add some additional imports and also import styles, to create a basic layout to build our home screen")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.dart")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:bdk_flutter/bdk_flutter.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:bdk_flutter_quickstart/widgets/widgets.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:flutter/cupertino.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:flutter/material.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StatefulWidget")]),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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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("Key")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" key"),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 punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),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(" key"),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 metadata function"}},[t._v("@override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("State")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createState")]),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 operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_HomeState")]),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("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" _HomeState "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("State")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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\n "),a("span",{pre:!0,attrs:{class:"token metadata function"}},[t._v("@override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Widget")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BuildContext")]),t._v(" context"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Scaffold")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n resizeToAvoidBottomInset"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n backgroundColor"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Colors")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("white"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* AppBar */")]),t._v("\n appBar"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("buildAppBar")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n body"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SingleChildScrollView")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Container")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n padding"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EdgeInsets")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("symmetric")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("horizontal"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Column")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n children"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),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("/* Balance */")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Create Wallet */")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Send Transaction */")]),t._v("\n "),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 punctuation"}},[t._v(",")]),t._v("\n "),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 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("We now have an app title section and a structure to hold the rest of our app components.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"33%"},attrs:{src:s(359)}}),t._v(" "),a("h2",{attrs:{id:"calling-bdk-flutter-methods"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#calling-bdk-flutter-methods"}},[t._v("#")]),t._v(" Calling bdk-flutter methods")]),t._v(" "),a("p",[t._v("To call all methods properly from the "),a("code",[t._v("bdk-flutter")]),t._v(" package, first, we need to create state variables to store "),a("code",[t._v("Wallet")]),t._v(" and "),a("code",[t._v("Blockchain")]),t._v(" objects.")]),t._v(" "),a("p",[t._v("Here we use the late keyword to declare both "),a("code",[t._v("Wallet")]),t._v(" and "),a("code",[t._v("Blockchain")]),t._v(". These are non-nullable variables that are initialized after the declaration.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:bdk_flutter/bdk_flutter.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nlate "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nlate "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Blockchain")]),t._v(" blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("The first step in creating a non-custodial bitcoin app is creating a mnemonic seed phrase for the wallet.")]),t._v(" "),a("p",[a("code",[t._v("bdk-flutter")]),t._v(" provides a "),a("code",[t._v("Mnemonic")]),t._v(" class to create a "),a("code",[t._v("Mnemonic")]),t._v(". The "),a("code",[t._v("create")]),t._v(" method is a named constructor and can be used to create a mnemonic, it takes "),a("code",[t._v("WordCount")]),t._v(" as its required parameter.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("WordCount.Words12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("We can generate a mnemonic of longer length by passing in a wordCount argument of required length.")]),t._v(" "),a("p",[t._v("To create a mnemonic with a "),a("code",[t._v("WordCount")]),t._v(" of 18 words, we can use "),a("code",[t._v("(WordCount.Words18)")]),t._v("\nRefer to the API docs on "),a("a",{attrs:{href:"https://pub.dev/documentation/bdk_flutter/latest/bdk_flutter/bdk_flutter-library.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("pub.dev"),a("OutboundLink")],1),t._v(" for more details.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("WordCount.Words18")]),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 comment"}},[t._v("// here response is saved as a 'Mnemonic' object")]),t._v("\n")])])]),a("p",[t._v("In order to use this in our Flutter app, we want a button that will generate a mnemonic when clicked, and a text input box to show the generated mnemonic. Let's first create a "),a("code",[t._v("TextEditingController")]),t._v(" for the "),a("code",[t._v("mnemonic")]),t._v(" textfield to store the mnemonic, and an internal "),a("code",[t._v("generateMnemonicHandler")]),t._v(" method which can be called on button click. We will also need a button that will call the internal "),a("code",[t._v("generateMnemonicHandler")]),t._v(" method when clicked. Adding the following code achieves all of this.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StatefulWidget")]),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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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("Key")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" key"),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 punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),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(" key"),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 metadata function"}},[t._v("@override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("State")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createState")]),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 operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_HomeState")]),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("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" _HomeState "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("State")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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 late "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n late "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Blockchain")]),t._v(" blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),t._v(" mnemonic "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),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\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateMnemonicHandler")]),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 keyword"}},[t._v("async")]),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("var")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("WordCount.Words12")]),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 function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("text "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("asString")]),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 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 metadata function"}},[t._v("@override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Widget")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BuildContext")]),t._v(" context"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Scaffold")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n resizeToAvoidBottomInset"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n backgroundColor"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Colors")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("white"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Header */")]),t._v("\n appBar"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("buildAppBar")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n body"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SingleChildScrollView")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Container")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n padding"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EdgeInsets")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("symmetric")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("horizontal"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Column")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n children"),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 "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Balance */")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Result */")]),t._v("\n\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Create Wallet */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StyledContainer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Column")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n mainAxisAlignment"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MainAxisAlignment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n crossAxisAlignment"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CrossAxisAlignment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("center"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n children"),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 "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SubmitButton")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Generate Mnemonic"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n callback"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),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 keyword"}},[t._v("async")]),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("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateMnemonicHandler")]),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("}")]),t._v("\n "),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("TextFieldContainer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextFormField")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n controller"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n style"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Theme")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("of")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("textTheme"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bodyText1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n keyboardType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextInputType")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("multiline"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n maxLines"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n decoration"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("InputDecoration")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n hintText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Enter your mnemonic"')])]),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 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("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 comment"}},[t._v("/* Send Transaction Buttons */")]),t._v("\n\n "),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 punctuation"}},[t._v(",")]),t._v("\n "),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 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("Now we need to add a component to display the output of our method calls and this will also need a "),a("code",[t._v("displayText")]),t._v(" variable to track our method call response. To achieve this add the following code.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.dart")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// add this as another state variable under mnemonic")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" displayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// modify the generateMnemonicHandler method to also set mnemonic as displayText")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateMnemonicHandler")]),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 keyword"}},[t._v("async")]),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("var")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("WordCount.Words12")]),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 function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("text "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("asString")]),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 displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("asString")]),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 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("p",[t._v("and finally, let's add the component to display the output under "),a("code",[t._v("/* Result */")])]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.dart")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Result */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// display the component only if displayText has a value")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ResponseContainer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"No Response"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),a("p",[t._v('We should now have a working "Generate Mnemonic" button that displays the new mnemonic')]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"25%"},attrs:{src:s(360)}}),t._v(" "),a("p",[t._v("A quick recap, we added a button to call a click handler ("),a("code",[t._v("generateMnemonicHandler")]),t._v(") which calls "),a("code",[t._v("generateMnemonic")]),t._v(" API of "),a("code",[t._v("bdk-flutter")]),t._v(". The click handler also sets the state for the app and also updates the "),a("code",[t._v("displayText")]),t._v(" variable to display the output of the call in the display section. We will follow this pattern for the remaining calls to "),a("code",[t._v("bdk-flutter")]),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"creating-a-wallet"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#creating-a-wallet"}},[t._v("#")]),t._v(" Creating a wallet")]),t._v(" "),a("p",[t._v("Before moving on to creating a wallet, let's add a section at the top to display the balance of the wallet.")]),t._v(" "),a("p",[t._v("To display the balance we will need a state variable to store the balance and a display component to display it. We will also be creating a receive address for the wallet so a state variable will be required for the address as well.")]),t._v(" "),a("p",[t._v("Under the "),a("code",[t._v("mnemonic")]),t._v(" and "),a("code",[t._v("displayText")]),t._v(" state variables, let's add one for "),a("code",[t._v("balance")]),t._v(" and one for "),a("code",[t._v("address")])]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" _HomeState "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("State")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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 "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),t._v(" mnemonic "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),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("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" displayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("Just below "),a("code",[t._v("/* Balance */")]),t._v(" and above "),a("code",[t._v("/* Result */")]),t._v(" add the following UI components to display the balance. We only want to show the balance when it has a value so we will use a null-aware operator "),a("code",[t._v("??")]),t._v(" for a quick "),a("code",[t._v("null")]),t._v(" check and use "),a("code",[t._v("0")]),t._v(" in case of a "),a("code",[t._v("null")]),t._v(" value.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Balance */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BalanceContainer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"${balance ?? "')])]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"} Sats"')])]),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 punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Result */")]),t._v("\n")])])]),a("p",[a("code",[t._v("bdk_flutter")]),t._v(" creates a wallet using output descriptors which define the derivation path to derive addresses and sign transactions. More about output descriptors "),a("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(". Before creating the "),a("code",[t._v("Wallet")]),t._v(" we need to create a "),a("code",[t._v("descriptor")]),t._v(" object which will be used to generate receive addresses and a "),a("code",[t._v("changeDescriptor")]),t._v(" object to to create change addresses to collect from outgoing transactions.")]),t._v(" "),a("p",[a("code",[t._v("bdk_flutter")]),t._v("'s "),a("code",[t._v("Descriptor")]),t._v(" class has a number of descriptor templates that will help you create a simple wallet.")]),t._v(" "),a("p",[t._v("Let's add some code to create a simple "),a("code",[t._v("wpkh")]),t._v(" descriptor object by using the "),a("code",[t._v("BIP84")]),t._v(" template. This template will create a descriptor in the format "),a("code",[t._v("wpkh(key/84'/{0,1}'/0'/{0,1}/*)")])]),t._v(" "),a("p",[t._v("This descriptor will create receive ("),a("code",[t._v("KeyChainKind.External")]),t._v(") and change descriptor ("),a("code",[t._v("KeyChainKind.Internal")]),t._v(") for a specified mnemonic.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("List")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Descriptor")]),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 function"}},[t._v("getDescriptors")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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("final")]),t._v(" descriptors "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Descriptor")]),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 keyword"}},[t._v("try")]),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("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" e "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind.External")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind.Internal")]),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 punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" mnemonicObj "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("fromString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mnemonic"),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 keyword"}},[t._v("final")]),t._v(" descriptorSecretKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorSecretKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n network"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network.Testnet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" mnemonicObj"),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 punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" descriptor "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Descriptor")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("newBip84")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n secretKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" descriptorSecretKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n network"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network.Testnet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n keychain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" e"),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 punctuation"}},[t._v(";")]),t._v("\n descriptors"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("descriptor"),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 keyword"}},[t._v("return")]),t._v(" descriptors"),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(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("on")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Exception")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("catch")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("e"),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 "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Error : ')]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),a("span",{pre:!0,attrs:{class:"token expression"}},[t._v("e"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),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 string"}},[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 punctuation"}},[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("rethrow")]),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\n")])])]),a("p",[t._v("Under the "),a("code",[t._v("address")]),t._v(" state variable, let's add a state variable called "),a("code",[t._v("wallet")]),t._v(" of the type "),a("code",[t._v("Wallet")]),t._v(" for saving the bitcoin wallet.")]),t._v(" "),a("p",[t._v("To create a wallet with "),a("code",[t._v("bdk-flutter")]),t._v(" call the "),a("code",[t._v("create")]),t._v(" constructor with "),a("code",[t._v("descriptor")]),t._v(", "),a("code",[t._v("changeDescriptor")]),t._v(" "),a("code",[t._v("network")]),t._v(", and the "),a("code",[t._v("databaseConfig")]),t._v(". For database, we can use memory as the database by specifying "),a("code",[t._v("DatabaseConfig.memory()")]),t._v("\nFollowing our pattern of a button, click handler and bdk-flutter API call, Let's add an internal method which will serve as the click handler for the \"Create Wallet\" button. We want to see the output of this call so let's use "),a("code",[t._v("setState()")]),t._v(" to set the "),a("code",[t._v("wallet")]),t._v(" object created and the "),a("code",[t._v("displayText")]),t._v(" variable with the wallet's first receive address.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOrRestoreWallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),t._v(" network"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" password"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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("try")]),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("final")]),t._v(" descriptors "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getDescriptors")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mnemonic"),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 keyword"}},[t._v("final")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),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("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n descriptor"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" descriptors"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n changeDescriptor"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" descriptors"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n network"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" network"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n databaseConfig"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DatabaseConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("memory")]),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 keyword"}},[t._v("var")]),t._v(" addressInfo "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("addressIndex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),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 function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" addressInfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n wallet "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Wallet Created: ')]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),a("span",{pre:!0,attrs:{class:"token expression"}},[t._v("address")])]),a("span",{pre:!0,attrs:{class:"token string"}},[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 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(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("on")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Exception")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("catch")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("e"),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 "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Error: ')]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),a("span",{pre:!0,attrs:{class:"token expression"}},[t._v("e"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),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 string"}},[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 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("A new button will be required to call "),a("code",[t._v("createOrRestoreWallet()")])]),t._v(" "),a("p",[t._v("Let's add a new button just below the mnemonic "),a("code",[t._v("TextFieldContainer")])]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SubmitButton")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Create Wallet"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n callback"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),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 keyword"}},[t._v("async")]),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("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOrRestoreWallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("text"),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.Testnet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')])]),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 punctuation"}},[t._v(";")]),t._v("\n "),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 punctuation"}},[t._v(",")]),t._v("\n")])])]),a("p",[t._v("The response returned by "),a("code",[t._v("create()")]),t._v(" is a "),a("code",[t._v("Wallet")]),t._v(" object.")]),t._v(" "),a("p",[t._v("The App should now be creating a wallet when we click "),a("strong",[t._v("Create Mnemonic")]),t._v(" followed by "),a("strong",[t._v("Create Wallet")]),t._v(".")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"25%"},attrs:{src:s(361)}}),t._v(" "),a("p",[t._v("Before going forward, we need to create a "),a("code",[t._v("Blockchain")]),t._v(" object as well. The Blockchain object will encapsulate the bitcoin node configuration which the wallet will use for syncing blocks and broadcasting transactions.")]),t._v(" "),a("p",[t._v("Let's add an internal method to create and initialize the "),a("code",[t._v("Blockchain")]),t._v(" object.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("blockchainInit")]),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 keyword"}},[t._v("async")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n blockchain "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Blockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BlockchainConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("electrum")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n stopGap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timeout"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n retry"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n url"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ssl://electrum.blockstream.info:60002"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n validateDomain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),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("}")]),t._v("\n")])])]),a("p",[t._v("Here we are initializing the "),a("code",[t._v("late")]),t._v(" non-nullable "),a("code",[t._v("blockchain")]),t._v(" variable, by calling the named constructor "),a("code",[t._v("create")]),t._v(", which takes a "),a("code",[t._v("BlockchainConfig")]),t._v(" object.\nThe bitcoin node specified is an Electrum node and we are specifying the url for Blockstream's public Electrum Testnet servers over SSL.")]),t._v(" "),a("p",[t._v("After creating the "),a("code",[t._v("blockchainInit()")]),t._v(" method, call it from "),a("code",[t._v("createOrRestoreWallet()")]),t._v(", so the "),a("code",[t._v("blockchain")]),t._v(" variable gets initialized before the "),a("code",[t._v("wallet")]),t._v(" is created.")]),t._v(" "),a("p",[t._v("Include the following line of code inside "),a("code",[t._v("createOrRestoreWallet()")]),t._v(" just before calling Wallet.create().")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[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 keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("blockchainInit")]),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 keyword"}},[t._v("final")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),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("create")]),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 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("p",[a("strong",[t._v("blockChainConfig")]),t._v(": BlockchainConfig is an enum that has 3 values, "),a("code",[t._v("BlockchainConfig.electrum")]),t._v(" for "),a("a",{attrs:{href:"https://github.com/romanz/electrs",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("electrum")]),a("OutboundLink")],1),t._v(" ,"),a("code",[t._v("BlockchainConfig.esplora")]),t._v(" for "),a("a",{attrs:{href:"https://github.com/Blockstream/esplora",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("esplora")]),a("OutboundLink")],1),t._v(" and "),a("code",[t._v("BlockchainConfig.rpc")]),t._v(" .")]),t._v(" "),a("p",[a("code",[t._v("BlockchainConfig.electrum")]),t._v(", "),a("code",[t._v("BlockchainConfig.rpc")]),t._v(" & "),a("code",[t._v("BlockchainConfig.esplora")]),t._v(" has "),a("code",[t._v("ElectrumConfig")]),t._v(" object, "),a("code",[t._v("RpcConfig")]),t._v(" object and "),a("code",[t._v("EsploraConfig")]),t._v(" object, respectively as its parameter.")]),t._v(" "),a("p",[a("strong",[t._v("ElectrumConfig")]),t._v(": This is the object type of "),a("code",[t._v("BlockchainConfig.electrum")]),t._v("'s config that takes a timeout, retry & url as its required parameter.")]),t._v(" "),a("p",[a("strong",[t._v("EsploraConfig")]),t._v(": This is the object type of "),a("code",[t._v("BlockchainConfig.esplora")]),t._v("'s config that takes baseUrl & stopGap as its required parameter.")]),t._v(" "),a("p",[a("strong",[t._v("RpcConfig")]),t._v(": This is the object type of "),a("code",[t._v("BlockchainConfig.rpc")]),t._v("'s config that takes url, network, & walletName as its required parameter. If "),a("code",[t._v("Rpc Blockchain")]),t._v(" has its authentication values inside a cookie file, please pass in cookie path as authCookie parameter, or you can pass in rpc username and password using "),a("code",[t._v("UserPass")]),t._v(" class.")]),t._v(" "),a("p",[t._v("Refer to the readme for a complete list of options for "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter#createwallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("createWallet()"),a("OutboundLink")],1)]),t._v(" "),a("h2",{attrs:{id:"utxos-and-balance"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#utxos-and-balance"}},[t._v("#")]),t._v(" UTXOs and balance")]),t._v(" "),a("p",[t._v("With the "),a("code",[t._v("Wallet")]),t._v(" and "),a("code",[t._v("Blockchain")]),t._v(" created, we can now add methods to sync UTXOs and compute balance.")]),t._v(" "),a("p",[a("code",[t._v("Wallet")]),t._v(" has a "),a("code",[t._v("sync")]),t._v(" method to sync all UTXOs belonging to the wallet using the "),a("code",[t._v("Blockchain")]),t._v(" object. Once the wallet sync is complete balance is computed and "),a("code",[t._v("getBalance")]),t._v(" can fetch the balance.")]),t._v(" "),a("p",[t._v("Earlier we have already added a variable for "),a("code",[t._v("balance")]),t._v(". Now we will add buttons to call "),a("code",[t._v("sync")]),t._v(" and "),a("code",[t._v("getBalance")]),t._v(". Just below the Create Wallet button let's add two buttons as follows:")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SubmitButton")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v(" text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Sync Wallet"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n callback"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),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 keyword"}},[t._v("async")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("syncWallet")]),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 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 punctuation"}},[t._v(",")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SubmitButton")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v(" callback"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),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 keyword"}},[t._v("async")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),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 punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Get Balance"')])]),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 punctuation"}},[t._v(",")]),t._v("\n")])])]),a("p",[t._v("Let's add two internal functions for syncing UTXOs and compute balance.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),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 keyword"}},[t._v("async")]),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("final")]),t._v(" balanceObj "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),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 keyword"}},[t._v("final")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Total Balance: ')]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),a("span",{pre:!0,attrs:{class:"token expression"}},[t._v("balanceObj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("total"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),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 string"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("print")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("res"),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 function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" balanceObj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("total"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),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 displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),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 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\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("syncWallet")]),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 keyword"}},[t._v("async")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("sync")]),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(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])]),a("p",[t._v("We should now be able to create a wallet, sync UTXOs, and get the balance")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"25%"},attrs:{src:s(362)}}),t._v(" "),a("p",[t._v("We can use a public testnet faucet to send testnet coins to the wallet and check that the UTXO sync and balance fetch are working correctly. Before we do that add one more method to generate a new address we can then use this address to get testnet coins from a faucet.")]),t._v(" "),a("p",[t._v("Let's use the "),a("code",[t._v("address")]),t._v(" variable that was created before for this, we need to add a button for "),a("strong",[t._v("Get Address")]),t._v(" and an internal function to call "),a("code",[t._v("Wallet")]),t._v(" and create a new address. Let's do the following")]),t._v(" "),a("p",[t._v("Add a new "),a("code",[t._v("getNewAddress")]),t._v(" function below the "),a("code",[t._v("syncWallet()")]),t._v(" function:")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getNewAddress")]),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 keyword"}},[t._v("async")]),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("final")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("addressIndex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),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 function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),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 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("p",[t._v("And a "),a("strong",[t._v("Get Address")]),t._v(" button below the existing "),a("strong",[t._v("Get Balance")]),t._v(" button:")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SubmitButton")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n callback"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),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 keyword"}},[t._v("async")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getNewAddress")]),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 punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Get Address"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),a("p",[t._v("We should now have the following, and "),a("strong",[t._v("Get Address")]),t._v(" will be able to display a new address.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"25%"},attrs:{src:s(363)}}),t._v(" "),a("p",[t._v("Now that we are able to generate a receive address we can get some testnet bitcoin from one of the public "),a("a",{attrs:{href:"https://coinfaucet.eu/en/btc-testnet/",target:"_blank",rel:"noopener noreferrer"}},[t._v("testnet faucets"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("After we send and after the transaction is confirmed we will need to sync the wallet before we can see the new balance from the received transaction.")]),t._v(" "),a("h2",{attrs:{id:"restoring-a-wallet"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#restoring-a-wallet"}},[t._v("#")]),t._v(" Restoring a wallet")]),t._v(" "),a("p",[t._v("The "),a("code",[t._v("create")]),t._v(" method creates a wallet using a "),a("code",[t._v("mnemonic")]),t._v(", to restore we can use the same method, we won't need to call "),a("code",[t._v("generateMnemonic")]),t._v(" as we will already have a "),a("code",[t._v("mnemonic")]),t._v(" to restore with.")]),t._v(" "),a("p",[t._v("This text field below the "),a("code",[t._v("Generate Mnemonic")]),t._v(" button will also display the mnemonic variable if we click Generate Mnemonic' button. The generated mnemonic will show up in the text field. We can overwrite it with our mnemonic and doing so will also overwrite the mnemonic state variable. This way the mnemonic displayed will be the one used to create the wallet.")]),t._v(" "),a("p",[t._v("We can now use our mnemonic and use it to restore a wallet. This will come in handy if we have a wallet with testnet bitcoin as these are hard to come by.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"25%"},attrs:{src:s(364)}}),t._v(" "),a("h2",{attrs:{id:"sending-bitcoin"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sending-bitcoin"}},[t._v("#")]),t._v(" Sending bitcoin")]),t._v(" "),a("p",[t._v("We are now able to receive bitcoin, now its time to add functionality to send a bitcoin transaction.")]),t._v(" "),a("p",[t._v("For making a successful bitcoin transaction "),a("code",[t._v("bdk-flutter")]),t._v(" utilizes a couple of methods. A new unsigned transaction can be created by using TxBuilder](https://github.com/LtbLightning/bdk-flutter#quicksend).")]),t._v(" "),a("p",[t._v("First, we have to initialize the "),a("code",[t._v("TxBuilder")]),t._v(" object and call the "),a("code",[t._v("addRecipient()")]),t._v(" method.\n"),a("code",[t._v("addRecipient()")]),t._v(" takes a "),a("code",[t._v("Script")]),t._v(" object and the transaction "),a("code",[t._v("amount")]),t._v(".")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" txBuilder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addRecipient")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("script"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" amount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("We can create the"),a("code",[t._v("Script")]),t._v(" object by using the "),a("code",[t._v("Address")]),t._v(" class, by specifying the recipient address.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" addressStr"),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 keyword"}},[t._v("final")]),t._v(" script "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("scriptPubKey")]),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 keyword"}},[t._v("final")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" txBuilder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addRecipient")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("script"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" amount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("We can create a "),a("code",[t._v("psbt")]),t._v(" object by calling the "),a("code",[t._v("finish()")]),t._v(" method using the response object from "),a("code",[t._v("addRecipient()")]),t._v(" method.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" txBuilder "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TxBuilder")]),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 keyword"}},[t._v("final")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" addressStr"),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 keyword"}},[t._v("final")]),t._v(" script "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("scriptPubKey")]),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 keyword"}},[t._v("final")]),t._v(" psbt "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" txBuilder\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addRecipient")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("script"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" amount"),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("feeRate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),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("finish")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("This "),a("code",[t._v("psbt")]),t._v(" can be signed later with "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter#signtx",target:"_blank",rel:"noopener noreferrer"}},[t._v("sign()"),a("OutboundLink")],1),t._v(" method from the "),a("code",[t._v("Wallet")]),t._v(" and broadcast using "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter#broadcasttx",target:"_blank",rel:"noopener noreferrer"}},[t._v("broadcast()"),a("OutboundLink")],1),t._v(" from the "),a("code",[t._v("Blockchain")]),t._v(" .")]),t._v(" "),a("p",[t._v("We will need textfield controllers for the recipient address, amount, and for transaction, these can be added below our existing variable for "),a("code",[t._v("mnemonic")])]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),t._v(" recipientAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),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("TextEditingController")]),t._v(" amount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),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("p",[t._v("Let's make an internal function to send a bitcoin transaction, using "),a("code",[t._v("Wallet")]),t._v(", "),a("code",[t._v("Blockchain")]),t._v(" and "),a("code",[t._v("TxBuilder")]),t._v(".")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sendTx")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" addressStr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" int amount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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("try")]),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("final")]),t._v(" txBuilder "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TxBuilder")]),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 keyword"}},[t._v("final")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" addressStr"),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 keyword"}},[t._v("final")]),t._v(" script "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("scriptPubKey")]),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 keyword"}},[t._v("final")]),t._v(" txBuilderResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" txBuilder\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addRecipient")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("script"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" amount"),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("feeRate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),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("finish")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wallet"),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 keyword"}},[t._v("final")]),t._v(" sbt "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("psbt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" txBuilderResult"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("psbt"),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 keyword"}},[t._v("final")]),t._v(" tx "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" sbt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("extractTx")]),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 keyword"}},[t._v("await")]),t._v(" blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("broadcast")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tx"),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 function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Successfully broadcast ')]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),a("span",{pre:!0,attrs:{class:"token expression"}},[t._v("amount")])]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v(" Sats to ")]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),a("span",{pre:!0,attrs:{class:"token expression"}},[t._v("addressStr")])]),a("span",{pre:!0,attrs:{class:"token string"}},[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 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(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("on")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Exception")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("catch")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("e"),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 "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Error: ')]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),a("span",{pre:!0,attrs:{class:"token expression"}},[t._v("e"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),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 string"}},[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 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\n")])])]),a("p",[t._v("Add a new section for send transaction functionality. We will need a "),a("code",[t._v("form")]),t._v(", a "),a("code",[t._v("TextFormField")]),t._v(" for the receiver address and a "),a("code",[t._v("TextFormField")]),t._v(" for the amount to send. We will also need a button to call the "),a("code",[t._v("sendTx")]),t._v(" function.")]),t._v(" "),a("p",[t._v("Before submitting the form we need to make sure all the input fields are valid, for that purpose, we need to initialize a "),a("a",{attrs:{href:"https://api.flutter.dev/flutter/widgets/GlobalKey-class.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("GlobalKey")]),a("OutboundLink")],1),t._v(". This can be added above our "),a("code",[t._v("Scaffold")])]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" _formKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GlobalKey")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("FormState")]),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("p",[t._v("Let's add the send transaction section and UI components below "),a("code",[t._v("/* Send Transaction */")])]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StyledContainer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Form")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" _formKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Column")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n mainAxisAlignment"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MainAxisAlignment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n crossAxisAlignment"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CrossAxisAlignment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("center"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n children"),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 "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextFieldContainer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextFormField")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n controller"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" recipientAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n validator"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("isEmpty"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Please enter your address'")])]),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 keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),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 punctuation"}},[t._v(",")]),t._v("\n style"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Theme")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("of")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("textTheme"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bodyText1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n decoration"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("InputDecoration")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n hintText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Enter Address"')])]),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 punctuation"}},[t._v(",")]),t._v("\n "),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 punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextFieldContainer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextFormField")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n controller"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" amount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n validator"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("isEmpty"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Please enter the amount'")])]),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 keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),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 punctuation"}},[t._v(",")]),t._v("\n keyboardType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextInputType")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("number"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n style"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Theme")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("of")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("textTheme"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bodyText1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n decoration"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("InputDecoration")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n hintText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Enter Amount"')])]),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 punctuation"}},[t._v(",")]),t._v("\n "),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 punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SubmitButton")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Send Bit"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n callback"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),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 keyword"}},[t._v("async")]),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("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_formKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("currentState"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("validate")]),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 punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sendTx")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("recipientAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("parse")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("amount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("text"),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("}")]),t._v("\n "),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("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\n")])])]),a("p",[t._v("We should now be able to send a transaction as long as there is sufficient balance.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"25%"},attrs:{src:s(365)}}),t._v(" "),a("h2",{attrs:{id:"conclusion"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[t._v("#")]),t._v(" Conclusion")]),t._v(" "),a("p",[t._v("The App we created can be built and distributed for both iOS and Android thus sharing a code base and reducing development time. The development and coding focused on application-level code for use cases and we did not have to code intricate internal bitcoin protocol-level code or bitcoin node interactions, and transactions. UTXOs and sync-related functionalities were also not required. All this was managed by "),a("code",[t._v("bdk-flutter")]),t._v(" allowing us to focus on the product, functionality, and user journey. This is how "),a("code",[t._v("bdk")]),t._v(" and "),a("code",[t._v("bdk-flutter")]),t._v(" intend to make Rapid Bitcoin Application Development possible by allowing product and application developers to focus on what they know best while "),a("code",[t._v("bdk")]),t._v(" handles bitcoin complexity.")]),t._v(" "),a("p",[a("code",[t._v("bdk-flutter")]),t._v(" intends to expose functionality and APIs from "),a("code",[t._v("bdk")]),t._v(" which has a wide variety of APIs with granular details allowing for many interesting use cases to be implemented. "),a("code",[t._v("bdk-flutter")]),t._v(" and "),a("code",[t._v("bdk")]),t._v(" are constantly updated and enhanced based on feedback from product teams and developers in the bitcoin community.")]),t._v(" "),a("p",[t._v("Stay tuned for more APIs and enhancements coming to "),a("code",[t._v("bdk-flutter")]),t._v(" in the near future. Feature and API requests are most welcome. New blogs and tutorials will be published soon for a more in-depth exploration of "),a("code",[t._v("bdk-flutter")]),t._v(".")]),t._v(" "),a("p",[t._v("In the meantime keep in touch with the project by following us on "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter",target:"_blank",rel:"noopener noreferrer"}},[t._v("GitHub"),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://twitter.com/BitcoinZavior",target:"_blank",rel:"noopener noreferrer"}},[t._v("Twitter"),a("OutboundLink")],1)]),t._v(" "),a("h4",{attrs:{id:"references"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#references"}},[t._v("#")]),t._v(" References:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://github.com/bitcoindevkit",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-flutter"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter-quickstart",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-flutter-quickstart GitHub Repository"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://docs.flutter.dev/get-started/install",target:"_blank",rel:"noopener noreferrer"}},[t._v("Setup Flutter Development Environment"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch04.asciidoc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mastering Bitcoin(HD Wallet chapter)"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Output Descriptors from bitcoin GitHub"),a("OutboundLink")],1)]),t._v(" "),a("li",[t._v("Testnet Faucet: "),a("a",{attrs:{href:"https://coinfaucet.eu/en/btc-testnet/",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://coinfaucet.eu/en/btc-testnet/"),a("OutboundLink")],1),t._v(" or "),a("a",{attrs:{href:"https://bitcoinfaucet.uo1.net",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://bitcoinfaucet.uo1.net"),a("OutboundLink")],1)])])])}),[],!1,null,null,null);a.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{365:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_complete_app.c74da859.png"},366:function(t,a,s){t.exports=s.p+"assets/img/default_flutter_app.31b31721.png"},367:function(t,a,s){t.exports=s.p+"assets/img/assets_section.b43d75e9.png"},368:function(t,a,s){t.exports=s.p+"assets/img/folder_structure.b2750bd6.png"},369:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_title.e4e3484a.png"},370:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_tutorial_screen_mnemonic.df703b77.png"},371:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_tutorial_screen_createwallet.3b052736.png"},372:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_get_balance.bfdf9ced.png"},373:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_get_address.5db2e3cc.png"},374:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_get_restore.db8e7e55.png"},375:function(t,a,s){t.exports=s.p+"assets/img/bdk_flutter_send.1688372b.png"},414:function(t,a,s){"use strict";s.r(a);var n=s(7),e=Object(n.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[a("code",[t._v("bdk-flutter")]),t._v(" is the "),a("strong",[t._v("Bitcoin Dev kit")]),t._v("'s "),a("strong",[t._v("Flutter")]),t._v(" library which enables building bitcoin applications for Android and iOS mobile platforms. Using "),a("code",[t._v("bdk-flutter")]),t._v(" is similar to using any other Flutter module. Just do "),a("code",[t._v("flutter pub add bdk_flutter")]),t._v(" and you are ready to code! This is the first tutorial on how to use "),a("code",[t._v("bdk-flutter")]),t._v(", more coming soon, make sure to "),a("a",{attrs:{href:"https://twitter.com/BitcoinZavior",target:"_blank",rel:"noopener noreferrer"}},[t._v("follow"),a("OutboundLink")],1),t._v(" to be notified of new ones. There will also be a "),a("strong",[a("code",[t._v("bdk-flutter")])]),t._v(" focused Livestream on "),a("a",{attrs:{href:"https://www.twitch.tv/bitcoindevelopers",target:"_blank",rel:"noopener noreferrer"}},[t._v("Twitch"),a("OutboundLink")],1),t._v(" on the Bitcoin Developers "),a("a",{attrs:{href:"https://www.youtube.com/channel/UCUq_ZdezVWKPvkWRicAYxLA/videos",target:"_blank",rel:"noopener noreferrer"}},[t._v("YouTube Channel"),a("OutboundLink")],1),t._v(" so make sure to subscribe.")]),t._v(" "),a("p",[t._v("This tutorial will explore "),a("code",[t._v("bdk-flutter")]),t._v(" usage and the API it provides. This guide will walk through the development process and code for making a bitcoin application. The bitcoin application we create will be a non-custodial HD Wallet. The application will have the functionality to create a new wallet or restore from a known mnemonic seed phrase. This application will also be able to interact with the bitcoin network to sync UTXOs from new blocks and broadcast transactions.")]),t._v(" "),a("p",[t._v("The tutorial will focus on bitcoin concepts and "),a("code",[t._v("bdk-flutter")]),t._v(" API. So it will gloss over Flutter and Dart. If you are interested in learning more about Flutter and Dart please refer to the Flutter "),a("a",{attrs:{href:"https://flutter.dev/learn",target:"_blank",rel:"noopener noreferrer"}},[t._v("learning portal"),a("OutboundLink")],1),t._v(". The code for this tutorial is available on the "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter-quickstart",target:"_blank",rel:"noopener noreferrer"}},[t._v("LtbLightning GitHub"),a("OutboundLink")],1)]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"25%"},attrs:{src:s(365)}}),t._v(" "),a("h3",{attrs:{id:"prerequisites"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites"}},[t._v("#")]),t._v(" Prerequisites")]),t._v(" "),a("p",[t._v("To use "),a("code",[t._v("bdk-flutter")]),t._v(" in a Flutter App, a Flutter development environment is required. Please refer to resources out there on the internet if you need to set this up, here is one of many good resources to guide you on "),a("a",{attrs:{href:"https://docs.flutter.dev/get-started/install",target:"_blank",rel:"noopener noreferrer"}},[t._v("environment setup"),a("OutboundLink")],1)]),t._v(" "),a("h3",{attrs:{id:"bitcoin-basics"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-basics"}},[t._v("#")]),t._v(" Bitcoin Basics")]),t._v(" "),a("p",[t._v("The bitcoin concepts used in this blog post are detailed and explained very well in external bitcoin resources. Here are some links for reference:")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch04.asciidoc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mastering Bitcoin(HD Wallet chapter)"),a("OutboundLink")],1)]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Output Descriptors from bitcoin GitHub"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("Now let's jump into Bitcoin Dev Kit")]),t._v(" "),a("h2",{attrs:{id:"bitcoin-dev-kit-and-bdk-flutter"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-dev-kit-and-bdk-flutter"}},[t._v("#")]),t._v(" Bitcoin Dev Kit and bdk-flutter")]),t._v(" "),a("p",[a("code",[t._v("bdk-flutter")]),t._v(" is "),a("strong",[t._v("Bitcoin Dev kit")]),t._v("'s "),a("strong",[t._v("Flutter")]),t._v(" library for building Bitcoin apps in "),a("strong",[t._v("Flutter")]),t._v(".\nIt encapsulates all of the low-level APIs and methods for BDK and exposes them in a Flutter context. To use BDK in Flutter apps only the "),a("code",[t._v("bdk-flutter")]),t._v(" module is required. "),a("code",[t._v("bdk-flutter")]),t._v(" can be used like any other Flutter library and is available on "),a("a",{attrs:{href:"https://pub.dev/packages/bdk_flutter",target:"_blank",rel:"noopener noreferrer"}},[t._v("pub.dev"),a("OutboundLink")],1)]),t._v(" "),a("h2",{attrs:{id:"getting-started"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[t._v("#")]),t._v(" Getting Started")]),t._v(" "),a("p",[t._v("Although we won't delve deep into Flutter we will focus more on bitcoin and "),a("code",[t._v("bdk-flutter")]),t._v(", however, some rudimentary Flutter setup is required, especially a basic Flutter app to add our code.")]),t._v(" "),a("p",[t._v("start by creating a new Flutter project.")]),t._v(" "),a("p",[a("code",[t._v("flutter create bdk-flutter-quickstart")])]),t._v(" "),a("p",[t._v("Once done let's "),a("code",[t._v("cd")]),t._v(" into the new project directory and run the basic Flutter app that's created")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" bdk-flutter-quickstart\nflutter run\n")])])]),a("p",[t._v("This should start building the app and then launch the app in a simulator. So far we have created a basic Flutter project if this doesn't work then refer to the Flutter development setup guide to troubleshoot.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"25%"},attrs:{src:s(366),alt:"BDK Flutter Quick Start"}}),t._v(" "),a("h2",{attrs:{id:"setting-up-flutter-app-structure"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-flutter-app-structure"}},[t._v("#")]),t._v(" Setting up Flutter app structure")]),t._v(" "),a("p",[t._v("Let's set up a very basic app structure. Let's create an "),a("code",[t._v("assets")]),t._v(" folder in the project root and then add new folders "),a("code",[t._v("widgets")]),t._v(", "),a("code",[t._v("screens")]),t._v(", and "),a("code",[t._v("styles")]),t._v(" inside the existing "),a("code",[t._v("lib")]),t._v(" folder.")]),t._v(" "),a("p",[t._v("Paste the following code in your "),a("code",[t._v("pubspec.yaml")]),t._v(" file, assets section.")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[t._v("- assets/\n")])])]),a("p",[t._v("Please make sure your assets section looks like the screenshot below.\n"),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"60%"},attrs:{src:s(367),alt:"BDK Flutter Quick Start"}})]),t._v(" "),a("p",[t._v("Once done let's run a "),a("code",[t._v("get")]),t._v(" command from the pub tool commands, this will get all the required dependencies for our project.")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("flutter pub get\n")])])]),a("p",[t._v("To make this quick you can download the theme, styled widgets and images used in the tutorial from the repository. The "),a("code",[t._v("theme.dart")]),t._v(" file has the theme we will use and this can be taken from "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter-quickstart/blob/master/lib/styles/theme.dart",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(" and moved to the styles folder. The "),a("code",[t._v("widgets.dart")]),t._v(" file has the styled widgets we will use and these can be taken from "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter-quickstart/blob/master/lib/widgets/widgets.dart",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(" and moved to the widgets folder. The image assets can be taken from "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter-quickstart/tree/master/assets",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(" Alternatively, you can write your theme, widgets and use your images if you intend to style the app differently.")]),t._v(" "),a("p",[t._v("In addition to the the theme, widgets and assets. We also need to create a "),a("code",[t._v("screens")]),t._v(" folder and create a "),a("code",[t._v("home.dart")]),t._v(" file inside it, this will be where most of the code will be added.")]),t._v(" "),a("p",[t._v("Once done the file structure should look like this:")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"60%"},attrs:{src:s(368)}}),t._v(" "),a("p",[a("br"),t._v("Locate "),a("code",[t._v("main.dart")]),t._v(" in the project root, this will have the default code added by "),a("code",[t._v("flutter create")]),t._v(", let's delete all contents of "),a("code",[t._v("main.dart")]),t._v(" and replace it with the following code to use "),a("code",[t._v("home.dart")]),t._v(" as our main screen. This will probably crash the app but that's fine, it will be up and running once we add code to "),a("code",[t._v("home.dart")]),t._v(" in the next few steps")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// main.dart")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:bdk_flutter_quickstart/screens/home.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:bdk_flutter_quickstart/styles/theme.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:flutter/material.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("main")]),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 punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("runApp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyApp")]),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("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyApp")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StatelessWidget")]),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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyApp")]),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("Key")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" key"),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 punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),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(" key"),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 comment"}},[t._v("// This widget is the root of your application.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token metadata function"}},[t._v("@override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Widget")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BuildContext")]),t._v(" context"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MaterialApp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n debugShowCheckedModeBanner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n title"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'BDK-FLUTTER TUTORIAL'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n theme"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("theme")]),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 home"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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 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("h2",{attrs:{id:"installing-bdk-flutter"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#installing-bdk-flutter"}},[t._v("#")]),t._v(" Installing "),a("code",[t._v("bdk-flutter")])]),t._v(" "),a("p",[t._v("With the Flutter project in place, we can now add "),a("code",[t._v("bdk-flutter")]),t._v(" using "),a("code",[t._v("flutter pub add")]),t._v(".")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("flutter pub "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" bdk_flutter\n")])])]),a("p",[t._v("This will add a line like this to your package's "),a("code",[t._v("pubspec.yaml")]),t._v(" and this will also run an implicit flutter pub get to download "),a("code",[t._v("bdk-flutter")]),t._v(" from "),a("code",[t._v("pub.dev")]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("dependencies:\n bdk_flutter: ^0.28.2\n")])])]),a("h2",{attrs:{id:"configuring"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#configuring"}},[t._v("#")]),t._v(" Configuring")]),t._v(" "),a("p",[t._v("Make sure your app meets the following requirements for using "),a("code",[t._v("bdk-flutter")])]),t._v(" "),a("p",[a("strong",[t._v("Android")])]),t._v(" "),a("p",[t._v("MinSdkVersion : API 23 or higher.")]),t._v(" "),a("p",[a("strong",[t._v("IOS")])]),t._v(" "),a("p",[t._v("Deployment target: iOS 12.0 or greater.")]),t._v(" "),a("p",[t._v("Locate your Podfile in the ios folder of your project and paste the following code at the beginning")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("platform :ios, '12.0'\n")])])]),a("p",[t._v("After changing the deployment target in your project's "),a("code",[t._v("PodFile")]),t._v(", let's use the following "),a("code",[t._v("command")]),t._v(" to install pod dependencies for iOS.")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" ios "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" pod "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("\n")])])]),a("p",[t._v("Once done, bdk-flutter is installed and configured and ready to be used in our "),a("strong",[t._v("bdk-flutter-quickstart")]),t._v(" App.")]),t._v(" "),a("h2",{attrs:{id:"importing-bdk-flutter"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#importing-bdk-flutter"}},[t._v("#")]),t._v(" Importing "),a("code",[t._v("bdk-flutter")])]),t._v(" "),a("p",[t._v("Locate "),a("code",[t._v("home.dart")]),t._v(" which we added in the setup section and import "),a("code",[t._v("bdk-flutter")]),t._v(" at the top of the file. Create a stateful widget called "),a("code",[t._v("Home")])]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.dart")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:bdk_flutter/bdk_flutter.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StatefulWidget")]),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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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("Key")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" key"),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 punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),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(" key"),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 metadata function"}},[t._v("@override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("State")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createState")]),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 operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_HomeState")]),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("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" _HomeState "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("State")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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 "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),t._v(" mnemonic "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),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 metadata function"}},[t._v("@override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Widget")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BuildContext")]),t._v(" context"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Container")]),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("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Before we start using "),a("code",[t._v("bdk-flutter")]),t._v(" let's add some additional imports and also import styles, to create a basic layout to build our home screen")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.dart")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:bdk_flutter/bdk_flutter.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:bdk_flutter_quickstart/widgets/widgets.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:flutter/cupertino.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:flutter/material.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StatefulWidget")]),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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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("Key")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" key"),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 punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),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(" key"),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 metadata function"}},[t._v("@override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("State")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createState")]),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 operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_HomeState")]),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("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" _HomeState "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("State")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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\n "),a("span",{pre:!0,attrs:{class:"token metadata function"}},[t._v("@override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Widget")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BuildContext")]),t._v(" context"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Scaffold")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n resizeToAvoidBottomInset"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n backgroundColor"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Colors")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("white"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* AppBar */")]),t._v("\n appBar"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("buildAppBar")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n body"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SingleChildScrollView")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Container")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n padding"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EdgeInsets")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("symmetric")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("horizontal"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Column")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n children"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),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("/* Balance */")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Create Wallet */")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Send Transaction */")]),t._v("\n "),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 punctuation"}},[t._v(",")]),t._v("\n "),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 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("We now have an app title section and a structure to hold the rest of our app components.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"33%"},attrs:{src:s(369)}}),t._v(" "),a("h2",{attrs:{id:"calling-bdk-flutter-methods"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#calling-bdk-flutter-methods"}},[t._v("#")]),t._v(" Calling bdk-flutter methods")]),t._v(" "),a("p",[t._v("To call all methods properly from the "),a("code",[t._v("bdk-flutter")]),t._v(" package, first, we need to create state variables to store "),a("code",[t._v("Wallet")]),t._v(" and "),a("code",[t._v("Blockchain")]),t._v(" objects.")]),t._v(" "),a("p",[t._v("Here we use the late keyword to declare both "),a("code",[t._v("Wallet")]),t._v(" and "),a("code",[t._v("Blockchain")]),t._v(". These are non-nullable variables that are initialized after the declaration.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'package:bdk_flutter/bdk_flutter.dart'")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nlate "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nlate "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Blockchain")]),t._v(" blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("The first step in creating a non-custodial bitcoin app is creating a mnemonic seed phrase for the wallet.")]),t._v(" "),a("p",[a("code",[t._v("bdk-flutter")]),t._v(" provides a "),a("code",[t._v("Mnemonic")]),t._v(" class to create a "),a("code",[t._v("Mnemonic")]),t._v(". The "),a("code",[t._v("create")]),t._v(" method is a named constructor and can be used to create a mnemonic, it takes "),a("code",[t._v("WordCount")]),t._v(" as its required parameter.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("WordCount.Words12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("We can generate a mnemonic of longer length by passing in a wordCount argument of required length.")]),t._v(" "),a("p",[t._v("To create a mnemonic with a "),a("code",[t._v("WordCount")]),t._v(" of 18 words, we can use "),a("code",[t._v("(WordCount.Words18)")]),t._v("\nRefer to the API docs on "),a("a",{attrs:{href:"https://pub.dev/documentation/bdk_flutter/latest/bdk_flutter/bdk_flutter-library.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("pub.dev"),a("OutboundLink")],1),t._v(" for more details.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("WordCount.Words18")]),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 comment"}},[t._v("// here response is saved as a 'Mnemonic' object")]),t._v("\n")])])]),a("p",[t._v("In order to use this in our Flutter app, we want a button that will generate a mnemonic when clicked, and a text input box to show the generated mnemonic. Let's first create a "),a("code",[t._v("TextEditingController")]),t._v(" for the "),a("code",[t._v("mnemonic")]),t._v(" textfield to store the mnemonic, and an internal "),a("code",[t._v("generateMnemonicHandler")]),t._v(" method which can be called on button click. We will also need a button that will call the internal "),a("code",[t._v("generateMnemonicHandler")]),t._v(" method when clicked. Adding the following code achieves all of this.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StatefulWidget")]),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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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("Key")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" key"),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 punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),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(" key"),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 metadata function"}},[t._v("@override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("State")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createState")]),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 operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_HomeState")]),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("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" _HomeState "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("State")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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 late "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n late "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Blockchain")]),t._v(" blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),t._v(" mnemonic "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),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\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateMnemonicHandler")]),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 keyword"}},[t._v("async")]),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("var")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("WordCount.Words12")]),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 function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("text "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("asString")]),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 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 metadata function"}},[t._v("@override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Widget")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BuildContext")]),t._v(" context"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Scaffold")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n resizeToAvoidBottomInset"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n backgroundColor"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Colors")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("white"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Header */")]),t._v("\n appBar"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("buildAppBar")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n body"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SingleChildScrollView")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Container")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n padding"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EdgeInsets")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("symmetric")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("horizontal"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Column")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n children"),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 "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Balance */")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Result */")]),t._v("\n\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Create Wallet */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StyledContainer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Column")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n mainAxisAlignment"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MainAxisAlignment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n crossAxisAlignment"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CrossAxisAlignment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("center"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n children"),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 "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SubmitButton")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Generate Mnemonic"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n callback"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),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 keyword"}},[t._v("async")]),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("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateMnemonicHandler")]),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("}")]),t._v("\n "),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("TextFieldContainer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextFormField")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n controller"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n style"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Theme")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("of")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("textTheme"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bodyText1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n keyboardType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextInputType")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("multiline"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n maxLines"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n decoration"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("InputDecoration")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n hintText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Enter your mnemonic"')])]),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 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("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 comment"}},[t._v("/* Send Transaction Buttons */")]),t._v("\n\n "),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 punctuation"}},[t._v(",")]),t._v("\n "),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 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("Now we need to add a component to display the output of our method calls and this will also need a "),a("code",[t._v("displayText")]),t._v(" variable to track our method call response. To achieve this add the following code.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.dart")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// add this as another state variable under mnemonic")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" displayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// modify the generateMnemonicHandler method to also set mnemonic as displayText")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateMnemonicHandler")]),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 keyword"}},[t._v("async")]),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("var")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("WordCount.Words12")]),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 function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("text "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("asString")]),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 displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("asString")]),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 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("p",[t._v("and finally, let's add the component to display the output under "),a("code",[t._v("/* Result */")])]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.dart")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Result */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// display the component only if displayText has a value")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ResponseContainer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"No Response"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),a("p",[t._v('We should now have a working "Generate Mnemonic" button that displays the new mnemonic')]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"25%"},attrs:{src:s(370)}}),t._v(" "),a("p",[t._v("A quick recap, we added a button to call a click handler ("),a("code",[t._v("generateMnemonicHandler")]),t._v(") which calls "),a("code",[t._v("generateMnemonic")]),t._v(" API of "),a("code",[t._v("bdk-flutter")]),t._v(". The click handler also sets the state for the app and also updates the "),a("code",[t._v("displayText")]),t._v(" variable to display the output of the call in the display section. We will follow this pattern for the remaining calls to "),a("code",[t._v("bdk-flutter")]),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"creating-a-wallet"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#creating-a-wallet"}},[t._v("#")]),t._v(" Creating a wallet")]),t._v(" "),a("p",[t._v("Before moving on to creating a wallet, let's add a section at the top to display the balance of the wallet.")]),t._v(" "),a("p",[t._v("To display the balance we will need a state variable to store the balance and a display component to display it. We will also be creating a receive address for the wallet so a state variable will be required for the address as well.")]),t._v(" "),a("p",[t._v("Under the "),a("code",[t._v("mnemonic")]),t._v(" and "),a("code",[t._v("displayText")]),t._v(" state variables, let's add one for "),a("code",[t._v("balance")]),t._v(" and one for "),a("code",[t._v("address")])]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" _HomeState "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("State")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Home")]),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 "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),t._v(" mnemonic "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),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("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" displayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("Just below "),a("code",[t._v("/* Balance */")]),t._v(" and above "),a("code",[t._v("/* Result */")]),t._v(" add the following UI components to display the balance. We only want to show the balance when it has a value so we will use a null-aware operator "),a("code",[t._v("??")]),t._v(" for a quick "),a("code",[t._v("null")]),t._v(" check and use "),a("code",[t._v("0")]),t._v(" in case of a "),a("code",[t._v("null")]),t._v(" value.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Balance */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BalanceContainer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"${balance ?? "')])]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"} Sats"')])]),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 punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Result */")]),t._v("\n")])])]),a("p",[a("code",[t._v("bdk_flutter")]),t._v(" creates a wallet using output descriptors which define the derivation path to derive addresses and sign transactions. More about output descriptors "),a("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(". Before creating the "),a("code",[t._v("Wallet")]),t._v(" we need to create a "),a("code",[t._v("descriptor")]),t._v(" object which will be used to generate receive addresses and a "),a("code",[t._v("changeDescriptor")]),t._v(" object to to create change addresses to collect from outgoing transactions.")]),t._v(" "),a("p",[a("code",[t._v("bdk_flutter")]),t._v("'s "),a("code",[t._v("Descriptor")]),t._v(" class has a number of descriptor templates that will help you create a simple wallet.")]),t._v(" "),a("p",[t._v("Let's add some code to create a simple "),a("code",[t._v("wpkh")]),t._v(" descriptor object by using the "),a("code",[t._v("BIP84")]),t._v(" template. This template will create a descriptor in the format "),a("code",[t._v("wpkh(key/84'/{0,1}'/0'/{0,1}/*)")])]),t._v(" "),a("p",[t._v("This descriptor will create receive ("),a("code",[t._v("KeyChainKind.External")]),t._v(") and change descriptor ("),a("code",[t._v("KeyChainKind.Internal")]),t._v(") for a specified mnemonic.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("List")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Descriptor")]),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 function"}},[t._v("getDescriptors")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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("final")]),t._v(" descriptors "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Descriptor")]),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 keyword"}},[t._v("try")]),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("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" e "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind.External")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind.Internal")]),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 punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" mnemonicObj "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("fromString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mnemonic"),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 keyword"}},[t._v("final")]),t._v(" descriptorSecretKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorSecretKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n network"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network.Testnet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" mnemonicObj"),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 punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" descriptor "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Descriptor")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("newBip84")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n secretKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" descriptorSecretKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n network"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network.Testnet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n keychain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" e"),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 punctuation"}},[t._v(";")]),t._v("\n descriptors"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("descriptor"),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 keyword"}},[t._v("return")]),t._v(" descriptors"),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(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("on")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Exception")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("catch")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("e"),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 "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Error : ')]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),a("span",{pre:!0,attrs:{class:"token expression"}},[t._v("e"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),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 string"}},[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 punctuation"}},[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("rethrow")]),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\n")])])]),a("p",[t._v("Under the "),a("code",[t._v("address")]),t._v(" state variable, let's add a state variable called "),a("code",[t._v("wallet")]),t._v(" of the type "),a("code",[t._v("Wallet")]),t._v(" for saving the bitcoin wallet.")]),t._v(" "),a("p",[t._v("To create a wallet with "),a("code",[t._v("bdk-flutter")]),t._v(" call the "),a("code",[t._v("create")]),t._v(" constructor with "),a("code",[t._v("descriptor")]),t._v(", "),a("code",[t._v("changeDescriptor")]),t._v(" "),a("code",[t._v("network")]),t._v(", and the "),a("code",[t._v("databaseConfig")]),t._v(". For database, we can use memory as the database by specifying "),a("code",[t._v("DatabaseConfig.memory()")]),t._v("\nFollowing our pattern of a button, click handler and bdk-flutter API call, Let's add an internal method which will serve as the click handler for the \"Create Wallet\" button. We want to see the output of this call so let's use "),a("code",[t._v("setState()")]),t._v(" to set the "),a("code",[t._v("wallet")]),t._v(" object created and the "),a("code",[t._v("displayText")]),t._v(" variable with the wallet's first receive address.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOrRestoreWallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),t._v(" network"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" password"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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("try")]),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("final")]),t._v(" descriptors "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getDescriptors")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mnemonic"),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 keyword"}},[t._v("final")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),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("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n descriptor"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" descriptors"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n changeDescriptor"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" descriptors"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n network"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" network"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n databaseConfig"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DatabaseConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("memory")]),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 keyword"}},[t._v("var")]),t._v(" addressInfo "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("addressIndex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),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 function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" addressInfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n wallet "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Wallet Created: ')]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),a("span",{pre:!0,attrs:{class:"token expression"}},[t._v("address")])]),a("span",{pre:!0,attrs:{class:"token string"}},[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 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(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("on")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Exception")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("catch")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("e"),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 "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Error: ')]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),a("span",{pre:!0,attrs:{class:"token expression"}},[t._v("e"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),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 string"}},[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 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("A new button will be required to call "),a("code",[t._v("createOrRestoreWallet()")])]),t._v(" "),a("p",[t._v("Let's add a new button just below the mnemonic "),a("code",[t._v("TextFieldContainer")])]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SubmitButton")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Create Wallet"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n callback"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),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 keyword"}},[t._v("async")]),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("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOrRestoreWallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("text"),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.Testnet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')])]),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 punctuation"}},[t._v(";")]),t._v("\n "),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 punctuation"}},[t._v(",")]),t._v("\n")])])]),a("p",[t._v("The response returned by "),a("code",[t._v("create()")]),t._v(" is a "),a("code",[t._v("Wallet")]),t._v(" object.")]),t._v(" "),a("p",[t._v("The App should now be creating a wallet when we click "),a("strong",[t._v("Create Mnemonic")]),t._v(" followed by "),a("strong",[t._v("Create Wallet")]),t._v(".")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"25%"},attrs:{src:s(371)}}),t._v(" "),a("p",[t._v("Before going forward, we need to create a "),a("code",[t._v("Blockchain")]),t._v(" object as well. The Blockchain object will encapsulate the bitcoin node configuration which the wallet will use for syncing blocks and broadcasting transactions.")]),t._v(" "),a("p",[t._v("Let's add an internal method to create and initialize the "),a("code",[t._v("Blockchain")]),t._v(" object.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("blockchainInit")]),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 keyword"}},[t._v("async")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n blockchain "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Blockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BlockchainConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("electrum")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n stopGap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timeout"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n retry"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n url"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ssl://electrum.blockstream.info:60002"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n validateDomain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),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("}")]),t._v("\n")])])]),a("p",[t._v("Here we are initializing the "),a("code",[t._v("late")]),t._v(" non-nullable "),a("code",[t._v("blockchain")]),t._v(" variable, by calling the named constructor "),a("code",[t._v("create")]),t._v(", which takes a "),a("code",[t._v("BlockchainConfig")]),t._v(" object.\nThe bitcoin node specified is an Electrum node and we are specifying the url for Blockstream's public Electrum Testnet servers over SSL.")]),t._v(" "),a("p",[t._v("After creating the "),a("code",[t._v("blockchainInit()")]),t._v(" method, call it from "),a("code",[t._v("createOrRestoreWallet()")]),t._v(", so the "),a("code",[t._v("blockchain")]),t._v(" variable gets initialized before the "),a("code",[t._v("wallet")]),t._v(" is created.")]),t._v(" "),a("p",[t._v("Include the following line of code inside "),a("code",[t._v("createOrRestoreWallet()")]),t._v(" just before calling Wallet.create().")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[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 keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("blockchainInit")]),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 keyword"}},[t._v("final")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),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("create")]),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 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("p",[a("strong",[t._v("blockChainConfig")]),t._v(": BlockchainConfig is an enum that has 3 values, "),a("code",[t._v("BlockchainConfig.electrum")]),t._v(" for "),a("a",{attrs:{href:"https://github.com/romanz/electrs",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("electrum")]),a("OutboundLink")],1),t._v(" ,"),a("code",[t._v("BlockchainConfig.esplora")]),t._v(" for "),a("a",{attrs:{href:"https://github.com/Blockstream/esplora",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("esplora")]),a("OutboundLink")],1),t._v(" and "),a("code",[t._v("BlockchainConfig.rpc")]),t._v(" .")]),t._v(" "),a("p",[a("code",[t._v("BlockchainConfig.electrum")]),t._v(", "),a("code",[t._v("BlockchainConfig.rpc")]),t._v(" & "),a("code",[t._v("BlockchainConfig.esplora")]),t._v(" has "),a("code",[t._v("ElectrumConfig")]),t._v(" object, "),a("code",[t._v("RpcConfig")]),t._v(" object and "),a("code",[t._v("EsploraConfig")]),t._v(" object, respectively as its parameter.")]),t._v(" "),a("p",[a("strong",[t._v("ElectrumConfig")]),t._v(": This is the object type of "),a("code",[t._v("BlockchainConfig.electrum")]),t._v("'s config that takes a timeout, retry & url as its required parameter.")]),t._v(" "),a("p",[a("strong",[t._v("EsploraConfig")]),t._v(": This is the object type of "),a("code",[t._v("BlockchainConfig.esplora")]),t._v("'s config that takes baseUrl & stopGap as its required parameter.")]),t._v(" "),a("p",[a("strong",[t._v("RpcConfig")]),t._v(": This is the object type of "),a("code",[t._v("BlockchainConfig.rpc")]),t._v("'s config that takes url, network, & walletName as its required parameter. If "),a("code",[t._v("Rpc Blockchain")]),t._v(" has its authentication values inside a cookie file, please pass in cookie path as authCookie parameter, or you can pass in rpc username and password using "),a("code",[t._v("UserPass")]),t._v(" class.")]),t._v(" "),a("p",[t._v("Refer to the readme for a complete list of options for "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter#createwallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("createWallet()"),a("OutboundLink")],1)]),t._v(" "),a("h2",{attrs:{id:"utxos-and-balance"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#utxos-and-balance"}},[t._v("#")]),t._v(" UTXOs and balance")]),t._v(" "),a("p",[t._v("With the "),a("code",[t._v("Wallet")]),t._v(" and "),a("code",[t._v("Blockchain")]),t._v(" created, we can now add methods to sync UTXOs and compute balance.")]),t._v(" "),a("p",[a("code",[t._v("Wallet")]),t._v(" has a "),a("code",[t._v("sync")]),t._v(" method to sync all UTXOs belonging to the wallet using the "),a("code",[t._v("Blockchain")]),t._v(" object. Once the wallet sync is complete balance is computed and "),a("code",[t._v("getBalance")]),t._v(" can fetch the balance.")]),t._v(" "),a("p",[t._v("Earlier we have already added a variable for "),a("code",[t._v("balance")]),t._v(". Now we will add buttons to call "),a("code",[t._v("sync")]),t._v(" and "),a("code",[t._v("getBalance")]),t._v(". Just below the Create Wallet button let's add two buttons as follows:")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SubmitButton")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v(" text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Sync Wallet"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n callback"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),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 keyword"}},[t._v("async")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("syncWallet")]),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 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 punctuation"}},[t._v(",")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SubmitButton")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v(" callback"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),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 keyword"}},[t._v("async")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),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 punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Get Balance"')])]),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 punctuation"}},[t._v(",")]),t._v("\n")])])]),a("p",[t._v("Let's add two internal functions for syncing UTXOs and compute balance.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),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 keyword"}},[t._v("async")]),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("final")]),t._v(" balanceObj "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),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 keyword"}},[t._v("final")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Total Balance: ')]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),a("span",{pre:!0,attrs:{class:"token expression"}},[t._v("balanceObj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("total"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),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 string"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("print")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("res"),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 function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" balanceObj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("total"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),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 displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),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 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\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("syncWallet")]),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 keyword"}},[t._v("async")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("sync")]),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(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])]),a("p",[t._v("We should now be able to create a wallet, sync UTXOs, and get the balance")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"25%"},attrs:{src:s(372)}}),t._v(" "),a("p",[t._v("We can use a public testnet faucet to send testnet coins to the wallet and check that the UTXO sync and balance fetch are working correctly. Before we do that add one more method to generate a new address we can then use this address to get testnet coins from a faucet.")]),t._v(" "),a("p",[t._v("Let's use the "),a("code",[t._v("address")]),t._v(" variable that was created before for this, we need to add a button for "),a("strong",[t._v("Get Address")]),t._v(" and an internal function to call "),a("code",[t._v("Wallet")]),t._v(" and create a new address. Let's do the following")]),t._v(" "),a("p",[t._v("Add a new "),a("code",[t._v("getNewAddress")]),t._v(" function below the "),a("code",[t._v("syncWallet()")]),t._v(" function:")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getNewAddress")]),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 keyword"}},[t._v("async")]),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("final")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("addressIndex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),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 function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),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 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("p",[t._v("And a "),a("strong",[t._v("Get Address")]),t._v(" button below the existing "),a("strong",[t._v("Get Balance")]),t._v(" button:")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SubmitButton")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n callback"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),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 keyword"}},[t._v("async")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getNewAddress")]),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 punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Get Address"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),a("p",[t._v("We should now have the following, and "),a("strong",[t._v("Get Address")]),t._v(" will be able to display a new address.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"25%"},attrs:{src:s(373)}}),t._v(" "),a("p",[t._v("Now that we are able to generate a receive address we can get some testnet bitcoin from one of the public "),a("a",{attrs:{href:"https://coinfaucet.eu/en/btc-testnet/",target:"_blank",rel:"noopener noreferrer"}},[t._v("testnet faucets"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("After we send and after the transaction is confirmed we will need to sync the wallet before we can see the new balance from the received transaction.")]),t._v(" "),a("h2",{attrs:{id:"restoring-a-wallet"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#restoring-a-wallet"}},[t._v("#")]),t._v(" Restoring a wallet")]),t._v(" "),a("p",[t._v("The "),a("code",[t._v("create")]),t._v(" method creates a wallet using a "),a("code",[t._v("mnemonic")]),t._v(", to restore we can use the same method, we won't need to call "),a("code",[t._v("generateMnemonic")]),t._v(" as we will already have a "),a("code",[t._v("mnemonic")]),t._v(" to restore with.")]),t._v(" "),a("p",[t._v("This text field below the "),a("code",[t._v("Generate Mnemonic")]),t._v(" button will also display the mnemonic variable if we click Generate Mnemonic' button. The generated mnemonic will show up in the text field. We can overwrite it with our mnemonic and doing so will also overwrite the mnemonic state variable. This way the mnemonic displayed will be the one used to create the wallet.")]),t._v(" "),a("p",[t._v("We can now use our mnemonic and use it to restore a wallet. This will come in handy if we have a wallet with testnet bitcoin as these are hard to come by.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"25%"},attrs:{src:s(374)}}),t._v(" "),a("h2",{attrs:{id:"sending-bitcoin"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sending-bitcoin"}},[t._v("#")]),t._v(" Sending bitcoin")]),t._v(" "),a("p",[t._v("We are now able to receive bitcoin, now its time to add functionality to send a bitcoin transaction.")]),t._v(" "),a("p",[t._v("For making a successful bitcoin transaction "),a("code",[t._v("bdk-flutter")]),t._v(" utilizes a couple of methods. A new unsigned transaction can be created by using TxBuilder](https://github.com/LtbLightning/bdk-flutter#quicksend).")]),t._v(" "),a("p",[t._v("First, we have to initialize the "),a("code",[t._v("TxBuilder")]),t._v(" object and call the "),a("code",[t._v("addRecipient()")]),t._v(" method.\n"),a("code",[t._v("addRecipient()")]),t._v(" takes a "),a("code",[t._v("Script")]),t._v(" object and the transaction "),a("code",[t._v("amount")]),t._v(".")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" txBuilder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addRecipient")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("script"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" amount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("We can create the"),a("code",[t._v("Script")]),t._v(" object by using the "),a("code",[t._v("Address")]),t._v(" class, by specifying the recipient address.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" addressStr"),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 keyword"}},[t._v("final")]),t._v(" script "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("scriptPubKey")]),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 keyword"}},[t._v("final")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" txBuilder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addRecipient")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("script"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" amount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("We can create a "),a("code",[t._v("psbt")]),t._v(" object by calling the "),a("code",[t._v("finish()")]),t._v(" method using the response object from "),a("code",[t._v("addRecipient()")]),t._v(" method.")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" txBuilder "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TxBuilder")]),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 keyword"}},[t._v("final")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" addressStr"),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 keyword"}},[t._v("final")]),t._v(" script "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("scriptPubKey")]),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 keyword"}},[t._v("final")]),t._v(" psbt "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" txBuilder\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addRecipient")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("script"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" amount"),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("feeRate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),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("finish")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("This "),a("code",[t._v("psbt")]),t._v(" can be signed later with "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter#signtx",target:"_blank",rel:"noopener noreferrer"}},[t._v("sign()"),a("OutboundLink")],1),t._v(" method from the "),a("code",[t._v("Wallet")]),t._v(" and broadcast using "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter#broadcasttx",target:"_blank",rel:"noopener noreferrer"}},[t._v("broadcast()"),a("OutboundLink")],1),t._v(" from the "),a("code",[t._v("Blockchain")]),t._v(" .")]),t._v(" "),a("p",[t._v("We will need textfield controllers for the recipient address, amount, and for transaction, these can be added below our existing variable for "),a("code",[t._v("mnemonic")])]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),t._v(" recipientAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),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("TextEditingController")]),t._v(" amount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextEditingController")]),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("p",[t._v("Let's make an internal function to send a bitcoin transaction, using "),a("code",[t._v("Wallet")]),t._v(", "),a("code",[t._v("Blockchain")]),t._v(" and "),a("code",[t._v("TxBuilder")]),t._v(".")]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Future")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sendTx")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" addressStr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" int amount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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("try")]),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("final")]),t._v(" txBuilder "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TxBuilder")]),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 keyword"}},[t._v("final")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" addressStr"),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 keyword"}},[t._v("final")]),t._v(" script "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("scriptPubKey")]),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 keyword"}},[t._v("final")]),t._v(" txBuilderResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" txBuilder\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addRecipient")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("script"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" amount"),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("feeRate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),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("finish")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wallet"),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 keyword"}},[t._v("final")]),t._v(" sbt "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("psbt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" txBuilderResult"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("psbt"),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 keyword"}},[t._v("final")]),t._v(" tx "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" sbt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("extractTx")]),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 keyword"}},[t._v("await")]),t._v(" blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("broadcast")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tx"),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 function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Successfully broadcast ')]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),a("span",{pre:!0,attrs:{class:"token expression"}},[t._v("amount")])]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v(" Sats to ")]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),a("span",{pre:!0,attrs:{class:"token expression"}},[t._v("addressStr")])]),a("span",{pre:!0,attrs:{class:"token string"}},[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 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(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("on")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Exception")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("catch")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("e"),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 "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setState")]),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 punctuation"}},[t._v("{")]),t._v("\n displayText "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Error: ')]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),a("span",{pre:!0,attrs:{class:"token expression"}},[t._v("e"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),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 string"}},[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 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\n")])])]),a("p",[t._v("Add a new section for send transaction functionality. We will need a "),a("code",[t._v("form")]),t._v(", a "),a("code",[t._v("TextFormField")]),t._v(" for the receiver address and a "),a("code",[t._v("TextFormField")]),t._v(" for the amount to send. We will also need a button to call the "),a("code",[t._v("sendTx")]),t._v(" function.")]),t._v(" "),a("p",[t._v("Before submitting the form we need to make sure all the input fields are valid, for that purpose, we need to initialize a "),a("a",{attrs:{href:"https://api.flutter.dev/flutter/widgets/GlobalKey-class.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("GlobalKey")]),a("OutboundLink")],1),t._v(". This can be added above our "),a("code",[t._v("Scaffold")])]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" _formKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GlobalKey")]),a("span",{pre:!0,attrs:{class:"token generics"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("FormState")]),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("p",[t._v("Let's add the send transaction section and UI components below "),a("code",[t._v("/* Send Transaction */")])]),t._v(" "),a("div",{staticClass:"language-dart extra-class"},[a("pre",{pre:!0,attrs:{class:"language-dart"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StyledContainer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Form")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" _formKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Column")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n mainAxisAlignment"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MainAxisAlignment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n crossAxisAlignment"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CrossAxisAlignment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("center"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n children"),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 "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextFieldContainer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextFormField")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n controller"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" recipientAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n validator"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("isEmpty"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Please enter your address'")])]),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 keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),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 punctuation"}},[t._v(",")]),t._v("\n style"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Theme")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("of")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("textTheme"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bodyText1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n decoration"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("InputDecoration")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n hintText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Enter Address"')])]),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 punctuation"}},[t._v(",")]),t._v("\n "),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 punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextFieldContainer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n child"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextFormField")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n controller"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" amount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n validator"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("isEmpty"),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 "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Please enter the amount'")])]),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 keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),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 punctuation"}},[t._v(",")]),t._v("\n keyboardType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextInputType")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("number"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n style"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Theme")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("of")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("textTheme"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bodyText1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n decoration"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("InputDecoration")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n hintText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Enter Amount"')])]),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 punctuation"}},[t._v(",")]),t._v("\n "),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 punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SubmitButton")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string-literal"}},[a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Send Bit"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n callback"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),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 keyword"}},[t._v("async")]),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("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_formKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("currentState"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("validate")]),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 punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sendTx")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("recipientAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("parse")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("amount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("text"),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("}")]),t._v("\n "),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("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\n")])])]),a("p",[t._v("We should now be able to send a transaction as long as there is sufficient balance.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"25%"},attrs:{src:s(375)}}),t._v(" "),a("h2",{attrs:{id:"conclusion"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[t._v("#")]),t._v(" Conclusion")]),t._v(" "),a("p",[t._v("The App we created can be built and distributed for both iOS and Android thus sharing a code base and reducing development time. The development and coding focused on application-level code for use cases and we did not have to code intricate internal bitcoin protocol-level code or bitcoin node interactions, and transactions. UTXOs and sync-related functionalities were also not required. All this was managed by "),a("code",[t._v("bdk-flutter")]),t._v(" allowing us to focus on the product, functionality, and user journey. This is how "),a("code",[t._v("bdk")]),t._v(" and "),a("code",[t._v("bdk-flutter")]),t._v(" intend to make Rapid Bitcoin Application Development possible by allowing product and application developers to focus on what they know best while "),a("code",[t._v("bdk")]),t._v(" handles bitcoin complexity.")]),t._v(" "),a("p",[a("code",[t._v("bdk-flutter")]),t._v(" intends to expose functionality and APIs from "),a("code",[t._v("bdk")]),t._v(" which has a wide variety of APIs with granular details allowing for many interesting use cases to be implemented. "),a("code",[t._v("bdk-flutter")]),t._v(" and "),a("code",[t._v("bdk")]),t._v(" are constantly updated and enhanced based on feedback from product teams and developers in the bitcoin community.")]),t._v(" "),a("p",[t._v("Stay tuned for more APIs and enhancements coming to "),a("code",[t._v("bdk-flutter")]),t._v(" in the near future. Feature and API requests are most welcome. New blogs and tutorials will be published soon for a more in-depth exploration of "),a("code",[t._v("bdk-flutter")]),t._v(".")]),t._v(" "),a("p",[t._v("In the meantime keep in touch with the project by following us on "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter",target:"_blank",rel:"noopener noreferrer"}},[t._v("GitHub"),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://twitter.com/BitcoinZavior",target:"_blank",rel:"noopener noreferrer"}},[t._v("Twitter"),a("OutboundLink")],1)]),t._v(" "),a("h4",{attrs:{id:"references"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#references"}},[t._v("#")]),t._v(" References:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://github.com/bitcoindevkit",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-flutter"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-flutter-quickstart",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-flutter-quickstart GitHub Repository"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://docs.flutter.dev/get-started/install",target:"_blank",rel:"noopener noreferrer"}},[t._v("Setup Flutter Development Environment"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch04.asciidoc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mastering Bitcoin(HD Wallet chapter)"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Output Descriptors from bitcoin GitHub"),a("OutboundLink")],1)]),t._v(" "),a("li",[t._v("Testnet Faucet: "),a("a",{attrs:{href:"https://coinfaucet.eu/en/btc-testnet/",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://coinfaucet.eu/en/btc-testnet/"),a("OutboundLink")],1),t._v(" or "),a("a",{attrs:{href:"https://bitcoinfaucet.uo1.net",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://bitcoinfaucet.uo1.net"),a("OutboundLink")],1)])])])}),[],!1,null,null,null);a.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/21.ba9955f1.js b/assets/js/21.aa6ad25b.js similarity index 98% rename from assets/js/21.ba9955f1.js rename to assets/js/21.aa6ad25b.js index 45801a0b39..c861a4b143 100644 --- a/assets/js/21.ba9955f1.js +++ b/assets/js/21.aa6ad25b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{366:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_complete_app.e382f61c.png"},367:function(t,a,s){t.exports=s.p+"assets/img/default_rn_app.9e60b4fb.png"},368:function(t,a,s){t.exports=s.p+"assets/img/folder_structure.d1c95bd6.png"},369:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_title.289f266d.png"},370:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_tutorial_screen_mnemonic.9963c418.png"},371:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_tutorial_screen_createwallet.916f2610.png"},372:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_get_balance.75af17bf.png"},373:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_get_address.4f570fb2.png"},374:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_get_restore.134b3681.png"},375:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_send.4e9dbc4a.png"},414:function(t,a,s){"use strict";s.r(a);var n=s(7),e=Object(n.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[a("code",[t._v("bdk-rn")]),t._v(" is the "),a("strong",[t._v("Bitcoin Dev kit")]),t._v("'s "),a("strong",[t._v("React Native")]),t._v(" library which enables building bitcoin applications for Android and iOS mobile platforms. Using "),a("code",[t._v("bdk-rn")]),t._v(" does not require knowledge of the underlying bitcoin or BDK API. Using "),a("code",[t._v("bdk-rn")]),t._v(" is similar to using any other RN module. Just do "),a("code",[t._v("yarn add bdk-rn")]),t._v(" and you are ready to code! This is the first tutorial on how to use "),a("code",[t._v("bdk-rn")]),t._v(", more coming soon, make sure to "),a("a",{attrs:{href:"https://twitter.com/BitcoinZavior?ref_src=twsrc%5Etfw",target:"_blank",rel:"noopener noreferrer"}},[t._v("follow"),a("OutboundLink")],1),t._v(" to be notified of new ones. In case you missed it, there is a recorded "),a("code",[t._v("bdk-rn")]),t._v(" focused Twitch Livestream available on the "),a("a",{attrs:{href:"https://www.youtube.com/watch?v=gMpWA875go4",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Developers"),a("OutboundLink")],1),t._v(" YouTube channel which covers most of this article, make sure to subscribe to Bitcoin Developers "),a("a",{attrs:{href:"https://www.youtube.com/channel/UCUq_ZdezVWKPvkWRicAYxLA/videos",target:"_blank",rel:"noopener noreferrer"}},[t._v("YouTube Channel"),a("OutboundLink")],1),t._v(" for more bitcoin development videos.")]),t._v(" "),a("p",[t._v("In this tutorial, we will explore "),a("code",[t._v("bdk-rn")]),t._v(" usage and the API it provides. This guide will walk through the development process and code for making a bitcoin application. The bitcoin application we create will be a non-custodial HD Wallet. The application will have the functionality to create a new wallet or restore from a known mnemonic seed phrase. This application will also be able to interact with the bitcoin network to sync UTXOs from new blocks and broadcast transactions.")]),t._v(" "),a("p",[t._v("The tutorial will focus on bitcoin and "),a("code",[t._v("bdk-rn")]),t._v(" concepts and API. So it will gloss over React Native aspects. The code for this tutorial is available on the "),a("a",{attrs:{href:"https://github.com/LtbLightning/BdkRnQuickStart",target:"_blank",rel:"noopener noreferrer"}},[t._v("LtbLightning GitHub"),a("OutboundLink")],1)]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"50%"},attrs:{src:s(366),alt:"BDK RN Quick Start"}}),t._v(" "),a("h3",{attrs:{id:"prerequisites"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites"}},[t._v("#")]),t._v(" Prerequisites")]),t._v(" "),a("p",[t._v("In order to use "),a("code",[t._v("bdk-rn")]),t._v(" in a React Native App, a React Native development environment is required. Please refer to resources out there on the internet if you need to set this up, here is one of many good resources to guide you on "),a("a",{attrs:{href:"https://reactnative.dev/docs/environment-setup",target:"_blank",rel:"noopener noreferrer"}},[t._v("environment setup"),a("OutboundLink")],1)]),t._v(" "),a("h3",{attrs:{id:"bitcoin-basics"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-basics"}},[t._v("#")]),t._v(" Bitcoin Basics")]),t._v(" "),a("p",[t._v("The bitcoin concepts used in this blog post are detailed and explained very well in external bitcoin resources. Here are some links for reference:")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch04.asciidoc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mastering Bitcoin(HD Wallet chapter)"),a("OutboundLink")],1)]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Output Descriptors from bitcoin GitHub"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("Now let's jump into Bitcoin Dev Kit")]),t._v(" "),a("h2",{attrs:{id:"bitcoin-dev-kit-and-bdk-rn"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-dev-kit-and-bdk-rn"}},[t._v("#")]),t._v(" Bitcoin Dev Kit and bdk-rn")]),t._v(" "),a("p",[a("code",[t._v("bdk-rn")]),t._v(" is a React Native library of Bitcoin Dev Kit(BDK) for building React Native Apps.\nIt encapsulates all of the low-level APIs and methods for BDK and exposes them in a react native context. To use BDK in React Native(RN) apps only the "),a("code",[t._v("bdk-rn")]),t._v(" module is required. "),a("code",[t._v("Bdk-rn")]),t._v(" can be used like any other react native library and is available on "),a("a",{attrs:{href:"https://www.npmjs.com/package/bdk-rn",target:"_blank",rel:"noopener noreferrer"}},[t._v("public package managers(npm and yarn)"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"getting-started"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[t._v("#")]),t._v(" Getting Started")]),t._v(" "),a("p",[t._v("Although we won't delve deep into RN we will focus more on bitcoin and bdk-rn, however, some rudimentary RN setup is required, especially a basic RN app to add our code.")]),t._v(" "),a("p",[t._v("start by creating a new RN project.")]),t._v(" "),a("p",[a("code",[t._v("npx react-native init BdkRnQuickStart")])]),t._v(" "),a("p",[t._v("If this fails in an error on an M1/M2 Mac please use\n"),a("code",[t._v("arch -x86_64 pod install --repo-update")])]),t._v(" "),a("p",[t._v("Once done "),a("code",[t._v("cd")]),t._v(" into the new project directory and run the basic RN app that's created")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" BdkRnQuickStart\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" ios\n")])])]),a("p",[t._v("This should start building the app and launch the app in a simulator. So far we have created a basic RN project if this doesn't work then refer to the React Native development setup guide to troubleshoot.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"25%"},attrs:{src:s(367)}}),t._v(" "),a("h2",{attrs:{id:"setting-up-styles-and-rn-app-structure"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-styles-and-rn-app-structure"}},[t._v("#")]),t._v(" Setting up styles and RN app structure")]),t._v(" "),a("p",[t._v("Let's set up a very basic app structure and some RN scaffolding. Let's create an "),a("code",[t._v("src")]),t._v(" folder in the project root and inside it add new folders for "),a("code",[t._v("assets")]),t._v(", "),a("code",[t._v("elements")]),t._v(", "),a("code",[t._v("screens")]),t._v(" and "),a("code",[t._v("styles")])]),t._v(" "),a("p",[t._v("To make this quick you can download the styles and images used in the tutorial from the repository. The image assets, "),a("code",[t._v("Button.tsx")]),t._v(" and "),a("code",[t._v("styles.js")]),t._v(" can be taken from "),a("a",{attrs:{href:"https://github.com/LtbLightning/BdkRnQuickStart/tree/master/src",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(" and moved to the folders as shown. Alternatively, you can write your own styles and use your own images if you intend to style the app in a different way.")]),t._v(" "),a("p",[t._v("Create a "),a("code",[t._v("home.js")]),t._v(" file under "),a("code",[t._v("screens")]),t._v(" folder, this will be where we will be adding most of the code.")]),t._v(" "),a("p",[t._v("Once done the project structure should look like this:")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"67%"},attrs:{src:s(368)}}),t._v(" "),a("p",[t._v("Locate "),a("code",[t._v("App.js")]),t._v(" in the project root, this will have the default code added by "),a("code",[t._v("react-native init")]),t._v(", let's delete all contents of "),a("code",[t._v("App.js")]),t._v(" and replace it with code to import "),a("code",[t._v("home.js")]),t._v(" as our main screen.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// App.js ")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" React "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'react'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Home "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'./src/screens/home'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("App")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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 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("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Home "),a("span",{pre:!0,attrs:{class:"token operator"}},[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("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("export")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v(" App"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("This will probably crash your app in the simulator but that's fine, it will be fixed in the next step.")]),t._v(" "),a("h2",{attrs:{id:"installing-bdk-rn"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#installing-bdk-rn"}},[t._v("#")]),t._v(" Installing "),a("code",[t._v("bdk-rn")])]),t._v(" "),a("p",[t._v("With the RN app project in place, we can now add "),a("code",[t._v("bdk-rn")]),t._v(" using either npm or yarn.")]),t._v(" "),a("p",[t._v("Using npm:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("npm")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--save")]),t._v(" bdk-rn\n")])])]),a("p",[t._v("Using yarn:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" bdk-rn\n")])])]),a("p",[t._v("[iOS Only] Install pods:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("npx pod-install\nor\n"),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" ios "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" pod "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("\n")])])]),a("p",[t._v("Verify that "),a("code",[t._v("bdk-rn")]),t._v(" has been added to "),a("code",[t._v("package.json")]),t._v(", once done "),a("code",[t._v("bdk-rn")]),t._v(" is installed and ready to be used in our "),a("strong",[t._v("BdkRnQuickStart")]),t._v(" App.")]),t._v(" "),a("h2",{attrs:{id:"importing-bdk-rn"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#importing-bdk-rn"}},[t._v("#")]),t._v(" Importing "),a("code",[t._v("bdk-rn")])]),t._v(" "),a("p",[t._v("Locate "),a("code",[t._v("home.js")]),t._v(" which we added in the setup section and import "),a("code",[t._v("bdk-rn")]),t._v(" and also create an RN functional component.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.js")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" BdkRn "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-rn'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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 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 punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("export")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v(" Home"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("Before we start using "),a("code",[t._v("bdk-rn")]),t._v(" let's add some additional RN component imports, as well as import styles, a button and image assets to create a basic layout to build our home screen.")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.js")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" BdkRn "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-rn'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" React"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" Fragment"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" useState "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'react'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ActivityIndicator"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n SafeAreaView"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n ScrollView"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n StatusBar"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n Text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n TextInput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n Image"),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(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'react-native'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Button "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'../elements/Button'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" styles "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'../styles/styles'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" bitcoinLogo "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'../assets/bitcoin_logo.png'")]),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 keyword"}},[t._v("const")]),t._v(" bdkLogo "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'../assets/bdk_logo.png'")]),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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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 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("// BDK-RN method calls and state variables will be added here")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SafeAreaView")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StatusBar")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ScrollView")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("contentInsetAdjustmentBehavior")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("automatic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("contentContainerStyle")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("container"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Header */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("headerSection"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Image")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation 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 literal-property property"}},[t._v("resizeMode")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'stretch'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("height")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("36")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("width")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("36")]),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 attr-name"}},[t._v("source")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("bitcoinLogo"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Text")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("headerText"),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 plain-text"}},[t._v("BDK-RN Tutorial")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Image")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation 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 literal-property property"}},[t._v("resizeMode")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'center'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("height")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("40")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("width")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("25")]),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 attr-name"}},[t._v("source")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("bdkLogo"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Balance */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* method call result */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* buttons for method calls */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* input boxes and send transaction button */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[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 punctuation"}},[t._v(";")]),t._v("\n"),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("export")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v(" Home"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("We now have an app title section and a structure to hold the rest of our app components.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"33%"},attrs:{src:s(369)}}),t._v(" "),a("h2",{attrs:{id:"calling-bdk-rn-methods"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#calling-bdk-rn-methods"}},[t._v("#")]),t._v(" Calling "),a("code",[t._v("bdk-rn")]),t._v(" methods")]),t._v(" "),a("p",[t._v("All "),a("code",[t._v("bdk-rn")]),t._v(" methods return a JSON response with data and error properties. All methods return a response as follows:")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[t._v("Promise"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Response"),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 punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("error")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// success returns true else false.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("data")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" string "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" object "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" any"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// output data for the method call.")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The first step in creating a non-custodial bitcoin app is creating a mnemonic seed phrase for the wallet.")]),t._v(" "),a("p",[a("code",[t._v("bdk-rn")]),t._v(" provides "),a("code",[t._v("generateMnemonic()")]),t._v(" method to create a default 12 word length mnemonic.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" BdkRn "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-rn'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" response "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateMnemonic")]),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 keyword"}},[t._v("const")]),t._v(" mnemonic "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" response"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("We can specify a longer length or we can also specify the bits of entropy we need by passing the length or entropy arguments.")]),t._v(" "),a("p",[t._v("To create a mnemonic with an entropy of 256 bits, which will be a 24-word length mnemonic sentence, we can use "),a("code",[t._v("{ entropy: 256 }")]),t._v(".\nRefer to the readme file on "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#generatemnemomic",target:"_blank",rel:"noopener noreferrer"}},[t._v("GitHub"),a("OutboundLink")],1),t._v(" for more details.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("data")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateMnemonic")]),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 literal-property property"}},[t._v("entropy")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("256")]),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 comment"}},[t._v("// here data is destructured and saved as 'mnemonic'")]),t._v("\n")])])]),a("p",[t._v("In order to use this in our RN app let's create a state variable to store the mnemonic and internal "),a("code",[t._v("generateMnemonic")]),t._v(" method which we can invoke when a button is clicked. We will also need a button which will invoke generateMnemonic when clicked. Adding the following code achieves all of this.")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.js")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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 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("// BDK-RN method calls and state variables will be added here")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// state variable to store and set mnemonic")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setMnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// internal method to call bdk-rn to generate mnemonic")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("getMnemonic")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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 operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// call bdk-rn to generate mnemonic")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateMnemonic")]),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 literal-property property"}},[t._v("length")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),t._v("\n "),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 comment"}},[t._v("// save generated mnemonic to state variable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setMnemonic")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SafeAreaView")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StatusBar")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ScrollView")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("contentInsetAdjustmentBehavior")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("automatic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("contentContainerStyle")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("container"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Header */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("headerSection"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Image")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation 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 literal-property property"}},[t._v("resizeMode")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'stretch'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("height")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("36")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("width")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("36")]),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 attr-name"}},[t._v("source")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("bitcoinLogo"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Text")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("headerText"),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 plain-text"}},[t._v("BDK-RN Tutorial")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Image")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation 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 literal-property property"}},[t._v("resizeMode")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'center'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("height")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("40")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("width")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("25")]),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 attr-name"}},[t._v("source")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("bdkLogo"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Balance */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* method call result */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* buttons for method calls */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("methodSection"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Button")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("title")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Generate Mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("methodButton"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onPress")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("getMnemonic"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* input boxes and send transaction button */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[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 punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("Now we need to add a component to display the output of our method calls and this will also need a state variable to track our method call response. To achieve this add the following code.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.js")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// add this as another state variable under mnemonic")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("displayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setDisplayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// modify the generateMnenomic method to also set mnemonic as displayText")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("getMnemonic")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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 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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateMnemonic")]),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 literal-property property"}},[t._v("length")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("network")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'testnet'")]),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 punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setMnemonic")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 function"}},[t._v("setDisplayText")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("and finally, let's add the component to display the output under "),a("code",[t._v("{/* method call result */}")])]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.js")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* method call result */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// display the component only if displayText has a value")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("displayText "),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 tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("responseSection"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Text")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("responseText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("selectable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n Response:\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Text")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("selectable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("displayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[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 punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v('We should now have a working" Generate Mnemonic" button which displays the new mnemonic')]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"50%"},attrs:{src:s(370)}}),t._v(" "),a("p",[t._v("A quick recap, we added a button to trigger a call to a method. We created a button click event handler to call bdk-rn. Set the display state variable to display the output of the call in the display section. We will follow this pattern for the remaining calls to bdk-rn.")]),t._v(" "),a("h2",{attrs:{id:"creating-a-wallet"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#creating-a-wallet"}},[t._v("#")]),t._v(" Creating a wallet")]),t._v(" "),a("p",[t._v("Before moving on to creating a wallet, let's add a section at the top to display the balance of the wallet.")]),t._v(" "),a("p",[t._v("To display the balance we will need a state variable to store the balance and a display section to display it.")]),t._v(" "),a("p",[t._v("Under the "),a("code",[t._v("mnemonic")]),t._v(" and "),a("code",[t._v("displayText")]),t._v(" variables, let's add one for "),a("code",[t._v("balance")]),t._v(" as well")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[t._v("\t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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 operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// BDK-RN method calls and state variables will be added here")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setMnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 punctuation"}},[t._v(";")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("displayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setDisplayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 punctuation"}},[t._v(";")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setBalance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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("p",[t._v("And we will shortly need a "),a("code",[t._v("wallet")]),t._v(" and "),a("code",[t._v("syncResponse")]),t._v(" as well so add these too.")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[t._v("\t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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 operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// BDK-RN method calls and state variables will be added here")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setMnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 punctuation"}},[t._v(";")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("displayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setDisplayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 punctuation"}},[t._v(";")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setBalance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setWallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 \t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("syncResponse"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setSyncResponse"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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("p",[t._v("Now we need some "),a("code",[t._v("jsx")]),t._v(" code to display the balance.")]),t._v(" "),a("p",[t._v("Just below "),a("code",[t._v("{/* Balance */}")]),t._v(" and above "),a("code",[t._v("{*/ method call result */}")]),t._v(" add the following UI components to display the balance. We only want to show the balance when it has a value so we will use a tertiary operator for a quick check.")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[t._v("\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Balance */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("balanceSection"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Text")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("balanceText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("selectable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Balance: '")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Text")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("selectable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'0'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v(" Sats")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* method call result */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("We will next add code to create a wallet.")]),t._v(" "),a("p",[t._v("To create a wallet the simple approach is to call "),a("code",[t._v("createWallet()")]),t._v(" method with "),a("code",[t._v("mnemonic")]),t._v(" , "),a("code",[t._v("password")]),t._v(" and "),a("code",[t._v("network")]),t._v(".\nLet's add another click event handler below where we have the "),a("code",[t._v("getMnemonic()")]),t._v(" method\nWe want to see the response to this call so let's use "),a("code",[t._v("setDisplayText()")]),t._v(" to see the output")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("createWallet")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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 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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" data "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),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 literal-property property"}},[t._v("mnemonic")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("password")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'password'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("network")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'testnet'")]),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 punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setWallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 function"}},[t._v("setDisplayText")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("A new button will be required to trigger "),a("code",[t._v("createWallet")])]),t._v(" "),a("p",[t._v("Let's add a new button just above "),a("code",[t._v("{/* input boxes and send transaction button */}")])]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[t._v("\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Button")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("title")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Create Wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("methodButton"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onPress")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("createWallet"),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 tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[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 comment"}},[t._v("/* input boxes and send transaction button */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The response returned by "),a("code",[t._v("createWallet")]),t._v(" is a new address for the created wallet.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string-property property"}},[t._v('"data"')]),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 string-property property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tb1qxg8g8cdzgs09cttu3y7lc33udqc4wsesunjnhe"')]),t._v("\n "),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 string-property property"}},[t._v('"error"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The App should now be creating a wallet when we click "),a("strong",[t._v("Create Mnemonic")]),t._v(" followed by "),a("strong",[t._v("Create Wallet")]),t._v(".")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"50%"},attrs:{src:s(371)}}),t._v(" "),a("p",[t._v("The wallet created is a HD wallet and the address displayed is the 0 index address for the wallet. The path used by default is 84'/1'/0'/0/* for addresses and 84'/1'/0'/1/* for change.")]),t._v(" "),a("p",[t._v("As we specified "),a("code",[t._v("testnet")]),t._v(" and did not specify "),a("code",[t._v("blockChainName")]),t._v(" and "),a("code",[t._v("blockChainConfigUrl")]),t._v(" a default testnet server will be used as the bitcoin node, "),a("code",[t._v("ssl://electrum.blockstream.info")]),t._v(" is the default url used for testnet.")]),t._v(" "),a("p",[t._v("Using "),a("code",[t._v("mnemonic")]),t._v(" is a quick way to create a new wallet with "),a("code",[t._v("bdk-rn")]),t._v(". The "),a("code",[t._v("createWallet()")]),t._v(" method in "),a("code",[t._v("bdk-rn")]),t._v(" has many optional arguments to configure the wallet. In addition to mnemonic, a wallet can also be created with a descriptor. If a descriptor is passed as an argument the wallet will be created using the descriptor. When using a descriptor, arguments for network, password and mnemonic are not required. "),a("code",[t._v("bdk-rn")]),t._v(" has a "),a("code",[t._v("createDescriptor()")]),t._v(" method to create a descriptor. More about output descriptors "),a("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(". Refer to the "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#createdescriptor",target:"_blank",rel:"noopener noreferrer"}},[t._v("readme"),a("OutboundLink")],1),t._v(" for all options available when creating output descriptors with "),a("code",[t._v("bdk-rn")])]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// using a descriptor to create wallet ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" response "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),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 literal-property property"}},[t._v("descriptor")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'tprv8ZgxMBicQKsPd3G66kPkZEuJZgUK9QXJRYCwnCtYLJjEZmw8xFjCxGoyx533AL83XFcSQeuVmVeJbZai5RTBxDp71Abd2FPSyQumRL79BKw'")]),t._v("\n"),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("p",[t._v("Other arguments for "),a("code",[t._v("createWallet()")]),t._v(" are:")]),t._v(" "),a("p",[a("strong",[t._v("blockChainName")]),t._v(": Blockchain backend to use, like "),a("a",{attrs:{href:"https://github.com/romanz/electrs",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("electrum")]),a("OutboundLink")],1),t._v(", "),a("a",{attrs:{href:"https://github.com/Blockstream/esplora",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("esplora")]),a("OutboundLink")],1),t._v(", "),a("code",[t._v("compact-filters")]),t._v(" ("),a("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP157"),a("OutboundLink")],1),t._v(") and Bitcoin Core. "),a("code",[t._v("bdk-rn")]),t._v(" at the moment doesn't support compact-filters and Bitcoin Core, this will be added shortly in a future release.")]),t._v(" "),a("p",[a("strong",[t._v("blockChainConfigUrl")]),t._v(": This is the url of the specified bitcoin node this should match the chain and the type of blockchain specified as "),a("strong",[t._v("blockChainName")])]),t._v(" "),a("p",[t._v("Refer to "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#createwallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("readme"),a("OutboundLink")],1),t._v(" for a complete list of options for "),a("code",[t._v("createWallet")])]),t._v(" "),a("h2",{attrs:{id:"utxos-and-balance"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#utxos-and-balance"}},[t._v("#")]),t._v(" UTXOs and balance")]),t._v(" "),a("p",[t._v("With the wallet created, we can now add methods to sync UTXOs compute balance.")]),t._v(" "),a("p",[a("code",[t._v("bdk-rn")]),t._v(" has a "),a("code",[t._v("syncWallet")]),t._v(" method to sync all UTXOs belonging to the wallet with the bitcoin network, the specified "),a("code",[t._v("blockChainName")]),t._v(" and "),a("code",[t._v("blockChainConfigUrl")]),t._v(" is used to sync. Once the wallet sync is complete balance is computed and "),a("code",[t._v("getBalance")]),t._v(" can fetch the balance.")]),t._v(" "),a("p",[t._v("Earlier we have aleady added state variables for"),a("code",[t._v("syncResponse")]),t._v("and "),a("code",[t._v("balance")]),t._v(". Now we will add buttons to call "),a("code",[t._v("syncWallet")]),t._v(" and "),a("code",[t._v("getBalance")]),t._v(". Just below the Create Wallet button lets add two buttons as follows:")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Button")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("title")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Sync Wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("methodButton"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onPress")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("syncWallet"),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 tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Button")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("title")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Get Balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("methodButton"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onPress")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("getBalance"),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 tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),a("p",[t._v("And two click handlers below createWallet:")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("syncWallet")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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 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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" data "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("syncWallet")]),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 function"}},[t._v("setSyncResponse")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 function"}},[t._v("setDisplayText")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("getBalance")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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 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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" data "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),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 function"}},[t._v("setBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 function"}},[t._v("setDisplayText")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 punctuation"}},[t._v(";")]),t._v("\n\n")])])]),a("p",[t._v("We should now be able to create a wallet, sync UTXOs and get balance")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"50%"},attrs:{src:s(372)}}),t._v(" "),a("p",[t._v("We can use a public testnet faucet to send testnet coins to the wallet and check that the UTXO sync and balance fetch are working correctly. Before we do that add one more method to generate a new address we can then use this address to get testnet coins from a faucet.")]),t._v(" "),a("p",[t._v("Let's add a state variable for "),a("code",[t._v("address")]),t._v(", a button for "),a("strong",[t._v("Get Address")]),t._v(" and a click event handler to call "),a("code",[t._v("bdk-rn")]),t._v(" and create a new address. Let's do the following")]),t._v(" "),a("p",[t._v("Add "),a("code",[t._v("address")]),t._v(" and "),a("code",[t._v("setAddress")]),t._v(" state variables below balance and "),a("code",[t._v("setBalance")]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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("p",[t._v("A new "),a("code",[t._v("getAddress")]),t._v(" click event handler below "),a("code",[t._v("getBalance")]),t._v(" click event handler:")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("getAddress")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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 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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" data "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getNewAddress")]),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 function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 function"}},[t._v("setDisplayText")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("And a Get Address button below the existing Get Balance button:")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Button")])]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("title")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Get Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("methodButton"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onPress")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("getAddress"),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("We should now have the following, and Get Address will be able to display a new address.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"50%"},attrs:{src:s(373)}}),t._v(" "),a("p",[t._v("Now that we are able to generate a receive address we can get some testnet bitcoin from one of the public "),a("a",{attrs:{href:"https://coinfaucet.eu/en/btc-testnet/",target:"_blank",rel:"noopener noreferrer"}},[t._v("testnet faucets"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("After we send and after the transaction is confirmed we will need to sync the wallet before we can see the new balance from the received transaction.")]),t._v(" "),a("h2",{attrs:{id:"restoring-wallet"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#restoring-wallet"}},[t._v("#")]),t._v(" Restoring wallet")]),t._v(" "),a("p",[t._v("The "),a("code",[t._v("createWallet")]),t._v(" method creates a wallet using a "),a("code",[t._v("mnemonic")]),t._v(", in order to restore we can use the same method, we won't need to call "),a("code",[t._v("generateMnemonic")]),t._v(" as we will already have a "),a("code",[t._v("mnemonic")]),t._v(" to restore with.")]),t._v(" "),a("p",[t._v("Let's add an input box to enter our own "),a("code",[t._v("mnemonic")]),t._v(", we will use the "),a("code",[t._v("mnemonic")]),t._v(" entered in the input box to create a wallet.")]),t._v(" "),a("p",[t._v("Let's add an input box for "),a("code",[t._v("mnemonic")]),t._v(" below the Generate Mnemonic button.")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextInput")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("multiline")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("value")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onChangeText")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("setMnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("textAlignVertical")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("top"),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("This code will also display the mnemonic state variable in the input box, if we click Generate Mnemonic the generated mnemonic will show up in the input box. We can overwrite it with our own mnemonic and doing so will also overwrite the mnemonic state variable. This way the mnemonic displayed will be the one used to create the wallet.")]),t._v(" "),a("p",[t._v("we are already using the mnemonic state variable in the "),a("code",[t._v("createWallet")]),t._v(" Method so no other changes are required.")]),t._v(" "),a("p",[t._v("We can now use our own mnemonic and use it to restore a wallet. This will come in handy if we have a wallet with testnet bitcoin as these are hard to come by.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"50%"},attrs:{src:s(374)}}),t._v(" "),a("h2",{attrs:{id:"sending-bitcoin"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sending-bitcoin"}},[t._v("#")]),t._v(" Sending bitcoin")]),t._v(" "),a("p",[t._v("We are now able to receive bitcoin, time to add functionality to send as well.")]),t._v(" "),a("p",[a("code",[t._v("bdk-rn")]),t._v(" has a number of transaction-related methods to enable varied use cases. A new send transaction can be created and broadcast using "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#quicksend",target:"_blank",rel:"noopener noreferrer"}},[t._v("quickSend()"),a("OutboundLink")],1),t._v(". If required an unsigned transaction can be created using "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#createtransaction",target:"_blank",rel:"noopener noreferrer"}},[t._v("createTransaction()"),a("OutboundLink")],1),t._v(" , this can be signed later with "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#signtransaction",target:"_blank",rel:"noopener noreferrer"}},[t._v("signTransactioin()"),a("OutboundLink")],1),t._v(" method and broadcast using "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#broadcasttransaction",target:"_blank",rel:"noopener noreferrer"}},[t._v("broadcastTransaction()"),a("OutboundLink")],1),t._v(". There are also methods to query transactions by pending or confirmed status and all transactions. Please refer to "),a("code",[t._v("bdk-rn")]),t._v(" "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn/blob/main/README.md#gettransactions",target:"_blank",rel:"noopener noreferrer"}},[t._v("readme"),a("OutboundLink")],1),t._v(" for more details on all the methods.")]),t._v(" "),a("p",[t._v("We will need state variables for recipient address and amount as well as for transaction, these can be added below our existing variables for syncResponse and address")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("syncResponse"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setSyncResponse"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("transaction"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setTransaction"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("recipient"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setRecipient"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("amount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setAmount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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("p",[t._v("A click event handler for send button, we will use the "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#quicksend",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("quickSend()")]),a("OutboundLink")],1),t._v(" method to send specified amount in sats to address.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[t._v("\t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("sendTx")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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 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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" data "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("quickSend")]),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 literal-property property"}},[t._v("address")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" recipient"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("amount")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" amount"),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 punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 function"}},[t._v("setDisplayText")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("Add a new section for send transaction functionality. We will need an input box for the receiver address and an input box for the amount to send. We will also need a button to trigger the transaction.")]),t._v(" "),a("p",[t._v("Let's add the send transaction section and UI components below "),a("code",[t._v("{/* input boxes and send transaction button */}")])]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* input boxes and send transaction button */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sendSection"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Fragment")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextInput")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("placeholder")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Recipient Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onChangeText")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("setRecipient"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextInput")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("placeholder")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Amount (in sats)"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onChangeText")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("e")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAmount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),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 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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Button")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("title")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Send Transaction"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("methodButton"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onPress")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("sendTx"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),a("p",[t._v("We should now be able to send a transaction as long as there is sufficient balance.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"50%"},attrs:{src:s(375)}}),t._v(" "),a("h2",{attrs:{id:"conclusion"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[t._v("#")]),t._v(" Conclusion")]),t._v(" "),a("p",[t._v("The App we created can be built and distributed for both iOS and Android thus sharing a code base and reducing development time. The development and coding focused on application-level code for use cases and we did not have to code intricate internal bitcoin protocol-level code or bitcoin node interactions, and transactions. UTXOs and sync-related functionalities were also not required. All this was managed by "),a("code",[t._v("bdk-rn")]),t._v(" allowing us to focus on the product, functionality and user journey. This is how "),a("code",[t._v("bdk")]),t._v(" and "),a("code",[t._v("bdk-rn")]),t._v(" intend to make Rapid Bitcoin Application Development possible by allowing product and application developers to focus on what they know best while "),a("code",[t._v("bdk")]),t._v(" handles bitcoin complexity.")]),t._v(" "),a("p",[a("code",[t._v("bdk-rn")]),t._v(" intends to expose functionality and APIs from "),a("code",[t._v("bdk")]),t._v(" which has a wide variety of API with granular details allowing for many interesting use cases to be implemented. "),a("code",[t._v("bdk-rn")]),t._v(" and "),a("code",[t._v("bdk")]),t._v(" are constantly updated and enhanced based on feedback from product teams and developers in the bitcoin community.")]),t._v(" "),a("p",[t._v("Stay tuned for more APIs and enhancements coming to "),a("code",[t._v("bdk-rn")]),t._v(" in the near future. Feature and API requests are most welcome. New blogs and tutorials will be published soon for a more in-depth exploration of bdk-rn.")]),t._v(" "),a("p",[t._v("In the meantime keep in touch with the project by following on "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn",target:"_blank",rel:"noopener noreferrer"}},[t._v("GitHub"),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://twitter.com/BitcoinZavior",target:"_blank",rel:"noopener noreferrer"}},[t._v("Twitter"),a("OutboundLink")],1)]),t._v(" "),a("h4",{attrs:{id:"references"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#references"}},[t._v("#")]),t._v(" References:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://github.com/bitcoindevkit",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-rn"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://www.youtube.com/watch?v=gMpWA875go4",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Developers YouTube"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/LtbLightning/BdkRnQuickStart",target:"_blank",rel:"noopener noreferrer"}},[t._v("BdkRnQuickStart App GitHub Repository"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://reactnative.dev/docs/environment-setup",target:"_blank",rel:"noopener noreferrer"}},[t._v("Setup React Native Development Environment"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch04.asciidoc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mastering Bitcoin(HD Wallet chapter)"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Output Descriptors from bitcoin GitHub"),a("OutboundLink")],1)]),t._v(" "),a("li",[t._v("Testnet Faucet: "),a("a",{attrs:{href:"https://coinfaucet.eu/en/btc-testnet/",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://coinfaucet.eu/en/btc-testnet/"),a("OutboundLink")],1),t._v(" or "),a("a",{attrs:{href:"https://bitcoinfaucet.uo1.net",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://bitcoinfaucet.uo1.net"),a("OutboundLink")],1)])])])}),[],!1,null,null,null);a.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{355:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_complete_app.e382f61c.png"},356:function(t,a,s){t.exports=s.p+"assets/img/default_rn_app.9e60b4fb.png"},357:function(t,a,s){t.exports=s.p+"assets/img/folder_structure.d1c95bd6.png"},358:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_title.289f266d.png"},359:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_tutorial_screen_mnemonic.9963c418.png"},360:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_tutorial_screen_createwallet.916f2610.png"},361:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_get_balance.75af17bf.png"},362:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_get_address.4f570fb2.png"},363:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_get_restore.134b3681.png"},364:function(t,a,s){t.exports=s.p+"assets/img/bdk_rn_send.4e9dbc4a.png"},412:function(t,a,s){"use strict";s.r(a);var n=s(7),e=Object(n.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[a("code",[t._v("bdk-rn")]),t._v(" is the "),a("strong",[t._v("Bitcoin Dev kit")]),t._v("'s "),a("strong",[t._v("React Native")]),t._v(" library which enables building bitcoin applications for Android and iOS mobile platforms. Using "),a("code",[t._v("bdk-rn")]),t._v(" does not require knowledge of the underlying bitcoin or BDK API. Using "),a("code",[t._v("bdk-rn")]),t._v(" is similar to using any other RN module. Just do "),a("code",[t._v("yarn add bdk-rn")]),t._v(" and you are ready to code! This is the first tutorial on how to use "),a("code",[t._v("bdk-rn")]),t._v(", more coming soon, make sure to "),a("a",{attrs:{href:"https://twitter.com/BitcoinZavior?ref_src=twsrc%5Etfw",target:"_blank",rel:"noopener noreferrer"}},[t._v("follow"),a("OutboundLink")],1),t._v(" to be notified of new ones. In case you missed it, there is a recorded "),a("code",[t._v("bdk-rn")]),t._v(" focused Twitch Livestream available on the "),a("a",{attrs:{href:"https://www.youtube.com/watch?v=gMpWA875go4",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Developers"),a("OutboundLink")],1),t._v(" YouTube channel which covers most of this article, make sure to subscribe to Bitcoin Developers "),a("a",{attrs:{href:"https://www.youtube.com/channel/UCUq_ZdezVWKPvkWRicAYxLA/videos",target:"_blank",rel:"noopener noreferrer"}},[t._v("YouTube Channel"),a("OutboundLink")],1),t._v(" for more bitcoin development videos.")]),t._v(" "),a("p",[t._v("In this tutorial, we will explore "),a("code",[t._v("bdk-rn")]),t._v(" usage and the API it provides. This guide will walk through the development process and code for making a bitcoin application. The bitcoin application we create will be a non-custodial HD Wallet. The application will have the functionality to create a new wallet or restore from a known mnemonic seed phrase. This application will also be able to interact with the bitcoin network to sync UTXOs from new blocks and broadcast transactions.")]),t._v(" "),a("p",[t._v("The tutorial will focus on bitcoin and "),a("code",[t._v("bdk-rn")]),t._v(" concepts and API. So it will gloss over React Native aspects. The code for this tutorial is available on the "),a("a",{attrs:{href:"https://github.com/LtbLightning/BdkRnQuickStart",target:"_blank",rel:"noopener noreferrer"}},[t._v("LtbLightning GitHub"),a("OutboundLink")],1)]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"50%"},attrs:{src:s(355),alt:"BDK RN Quick Start"}}),t._v(" "),a("h3",{attrs:{id:"prerequisites"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites"}},[t._v("#")]),t._v(" Prerequisites")]),t._v(" "),a("p",[t._v("In order to use "),a("code",[t._v("bdk-rn")]),t._v(" in a React Native App, a React Native development environment is required. Please refer to resources out there on the internet if you need to set this up, here is one of many good resources to guide you on "),a("a",{attrs:{href:"https://reactnative.dev/docs/environment-setup",target:"_blank",rel:"noopener noreferrer"}},[t._v("environment setup"),a("OutboundLink")],1)]),t._v(" "),a("h3",{attrs:{id:"bitcoin-basics"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-basics"}},[t._v("#")]),t._v(" Bitcoin Basics")]),t._v(" "),a("p",[t._v("The bitcoin concepts used in this blog post are detailed and explained very well in external bitcoin resources. Here are some links for reference:")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch04.asciidoc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mastering Bitcoin(HD Wallet chapter)"),a("OutboundLink")],1)]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Output Descriptors from bitcoin GitHub"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("Now let's jump into Bitcoin Dev Kit")]),t._v(" "),a("h2",{attrs:{id:"bitcoin-dev-kit-and-bdk-rn"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-dev-kit-and-bdk-rn"}},[t._v("#")]),t._v(" Bitcoin Dev Kit and bdk-rn")]),t._v(" "),a("p",[a("code",[t._v("bdk-rn")]),t._v(" is a React Native library of Bitcoin Dev Kit(BDK) for building React Native Apps.\nIt encapsulates all of the low-level APIs and methods for BDK and exposes them in a react native context. To use BDK in React Native(RN) apps only the "),a("code",[t._v("bdk-rn")]),t._v(" module is required. "),a("code",[t._v("Bdk-rn")]),t._v(" can be used like any other react native library and is available on "),a("a",{attrs:{href:"https://www.npmjs.com/package/bdk-rn",target:"_blank",rel:"noopener noreferrer"}},[t._v("public package managers(npm and yarn)"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"getting-started"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[t._v("#")]),t._v(" Getting Started")]),t._v(" "),a("p",[t._v("Although we won't delve deep into RN we will focus more on bitcoin and bdk-rn, however, some rudimentary RN setup is required, especially a basic RN app to add our code.")]),t._v(" "),a("p",[t._v("start by creating a new RN project.")]),t._v(" "),a("p",[a("code",[t._v("npx react-native init BdkRnQuickStart")])]),t._v(" "),a("p",[t._v("If this fails in an error on an M1/M2 Mac please use\n"),a("code",[t._v("arch -x86_64 pod install --repo-update")])]),t._v(" "),a("p",[t._v("Once done "),a("code",[t._v("cd")]),t._v(" into the new project directory and run the basic RN app that's created")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" BdkRnQuickStart\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" ios\n")])])]),a("p",[t._v("This should start building the app and launch the app in a simulator. So far we have created a basic RN project if this doesn't work then refer to the React Native development setup guide to troubleshoot.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"25%"},attrs:{src:s(356)}}),t._v(" "),a("h2",{attrs:{id:"setting-up-styles-and-rn-app-structure"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-styles-and-rn-app-structure"}},[t._v("#")]),t._v(" Setting up styles and RN app structure")]),t._v(" "),a("p",[t._v("Let's set up a very basic app structure and some RN scaffolding. Let's create an "),a("code",[t._v("src")]),t._v(" folder in the project root and inside it add new folders for "),a("code",[t._v("assets")]),t._v(", "),a("code",[t._v("elements")]),t._v(", "),a("code",[t._v("screens")]),t._v(" and "),a("code",[t._v("styles")])]),t._v(" "),a("p",[t._v("To make this quick you can download the styles and images used in the tutorial from the repository. The image assets, "),a("code",[t._v("Button.tsx")]),t._v(" and "),a("code",[t._v("styles.js")]),t._v(" can be taken from "),a("a",{attrs:{href:"https://github.com/LtbLightning/BdkRnQuickStart/tree/master/src",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(" and moved to the folders as shown. Alternatively, you can write your own styles and use your own images if you intend to style the app in a different way.")]),t._v(" "),a("p",[t._v("Create a "),a("code",[t._v("home.js")]),t._v(" file under "),a("code",[t._v("screens")]),t._v(" folder, this will be where we will be adding most of the code.")]),t._v(" "),a("p",[t._v("Once done the project structure should look like this:")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"67%"},attrs:{src:s(357)}}),t._v(" "),a("p",[t._v("Locate "),a("code",[t._v("App.js")]),t._v(" in the project root, this will have the default code added by "),a("code",[t._v("react-native init")]),t._v(", let's delete all contents of "),a("code",[t._v("App.js")]),t._v(" and replace it with code to import "),a("code",[t._v("home.js")]),t._v(" as our main screen.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// App.js ")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" React "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'react'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Home "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'./src/screens/home'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("App")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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 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("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Home "),a("span",{pre:!0,attrs:{class:"token operator"}},[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("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("export")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v(" App"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("This will probably crash your app in the simulator but that's fine, it will be fixed in the next step.")]),t._v(" "),a("h2",{attrs:{id:"installing-bdk-rn"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#installing-bdk-rn"}},[t._v("#")]),t._v(" Installing "),a("code",[t._v("bdk-rn")])]),t._v(" "),a("p",[t._v("With the RN app project in place, we can now add "),a("code",[t._v("bdk-rn")]),t._v(" using either npm or yarn.")]),t._v(" "),a("p",[t._v("Using npm:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("npm")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--save")]),t._v(" bdk-rn\n")])])]),a("p",[t._v("Using yarn:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" bdk-rn\n")])])]),a("p",[t._v("[iOS Only] Install pods:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("npx pod-install\nor\n"),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" ios "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" pod "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("\n")])])]),a("p",[t._v("Verify that "),a("code",[t._v("bdk-rn")]),t._v(" has been added to "),a("code",[t._v("package.json")]),t._v(", once done "),a("code",[t._v("bdk-rn")]),t._v(" is installed and ready to be used in our "),a("strong",[t._v("BdkRnQuickStart")]),t._v(" App.")]),t._v(" "),a("h2",{attrs:{id:"importing-bdk-rn"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#importing-bdk-rn"}},[t._v("#")]),t._v(" Importing "),a("code",[t._v("bdk-rn")])]),t._v(" "),a("p",[t._v("Locate "),a("code",[t._v("home.js")]),t._v(" which we added in the setup section and import "),a("code",[t._v("bdk-rn")]),t._v(" and also create an RN functional component.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.js")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" BdkRn "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-rn'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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 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 punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("export")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v(" Home"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("Before we start using "),a("code",[t._v("bdk-rn")]),t._v(" let's add some additional RN component imports, as well as import styles, a button and image assets to create a basic layout to build our home screen.")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.js")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" BdkRn "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-rn'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" React"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" Fragment"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" useState "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'react'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ActivityIndicator"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n SafeAreaView"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n ScrollView"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n StatusBar"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n Text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n TextInput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n Image"),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(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'react-native'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Button "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'../elements/Button'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" styles "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'../styles/styles'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" bitcoinLogo "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'../assets/bitcoin_logo.png'")]),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 keyword"}},[t._v("const")]),t._v(" bdkLogo "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'../assets/bdk_logo.png'")]),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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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 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("// BDK-RN method calls and state variables will be added here")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SafeAreaView")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StatusBar")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ScrollView")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("contentInsetAdjustmentBehavior")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("automatic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("contentContainerStyle")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("container"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Header */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("headerSection"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Image")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation 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 literal-property property"}},[t._v("resizeMode")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'stretch'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("height")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("36")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("width")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("36")]),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 attr-name"}},[t._v("source")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("bitcoinLogo"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Text")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("headerText"),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 plain-text"}},[t._v("BDK-RN Tutorial")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Image")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation 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 literal-property property"}},[t._v("resizeMode")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'center'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("height")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("40")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("width")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("25")]),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 attr-name"}},[t._v("source")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("bdkLogo"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Balance */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* method call result */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* buttons for method calls */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* input boxes and send transaction button */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[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 punctuation"}},[t._v(";")]),t._v("\n"),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("export")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v(" Home"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("We now have an app title section and a structure to hold the rest of our app components.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"33%"},attrs:{src:s(358)}}),t._v(" "),a("h2",{attrs:{id:"calling-bdk-rn-methods"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#calling-bdk-rn-methods"}},[t._v("#")]),t._v(" Calling "),a("code",[t._v("bdk-rn")]),t._v(" methods")]),t._v(" "),a("p",[t._v("All "),a("code",[t._v("bdk-rn")]),t._v(" methods return a JSON response with data and error properties. All methods return a response as follows:")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[t._v("Promise"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Response"),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 punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("error")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// success returns true else false.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("data")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" string "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" object "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" any"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// output data for the method call.")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The first step in creating a non-custodial bitcoin app is creating a mnemonic seed phrase for the wallet.")]),t._v(" "),a("p",[a("code",[t._v("bdk-rn")]),t._v(" provides "),a("code",[t._v("generateMnemonic()")]),t._v(" method to create a default 12 word length mnemonic.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" BdkRn "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-rn'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" response "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateMnemonic")]),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 keyword"}},[t._v("const")]),t._v(" mnemonic "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" response"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("We can specify a longer length or we can also specify the bits of entropy we need by passing the length or entropy arguments.")]),t._v(" "),a("p",[t._v("To create a mnemonic with an entropy of 256 bits, which will be a 24-word length mnemonic sentence, we can use "),a("code",[t._v("{ entropy: 256 }")]),t._v(".\nRefer to the readme file on "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#generatemnemomic",target:"_blank",rel:"noopener noreferrer"}},[t._v("GitHub"),a("OutboundLink")],1),t._v(" for more details.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("data")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateMnemonic")]),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 literal-property property"}},[t._v("entropy")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("256")]),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 comment"}},[t._v("// here data is destructured and saved as 'mnemonic'")]),t._v("\n")])])]),a("p",[t._v("In order to use this in our RN app let's create a state variable to store the mnemonic and internal "),a("code",[t._v("generateMnemonic")]),t._v(" method which we can invoke when a button is clicked. We will also need a button which will invoke generateMnemonic when clicked. Adding the following code achieves all of this.")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.js")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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 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("// BDK-RN method calls and state variables will be added here")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// state variable to store and set mnemonic")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setMnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// internal method to call bdk-rn to generate mnemonic")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("getMnemonic")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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 operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// call bdk-rn to generate mnemonic")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateMnemonic")]),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 literal-property property"}},[t._v("length")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),t._v("\n "),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 comment"}},[t._v("// save generated mnemonic to state variable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setMnemonic")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SafeAreaView")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StatusBar")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ScrollView")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("contentInsetAdjustmentBehavior")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("automatic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("contentContainerStyle")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("container"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Header */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("headerSection"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Image")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation 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 literal-property property"}},[t._v("resizeMode")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'stretch'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("height")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("36")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("width")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("36")]),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 attr-name"}},[t._v("source")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("bitcoinLogo"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Text")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("headerText"),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 plain-text"}},[t._v("BDK-RN Tutorial")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Image")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation 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 literal-property property"}},[t._v("resizeMode")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'center'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("height")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("40")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("width")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("25")]),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 attr-name"}},[t._v("source")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("bdkLogo"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Balance */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* method call result */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* buttons for method calls */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("methodSection"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Button")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("title")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Generate Mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("methodButton"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onPress")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("getMnemonic"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* input boxes and send transaction button */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[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 punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("Now we need to add a component to display the output of our method calls and this will also need a state variable to track our method call response. To achieve this add the following code.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.js")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// add this as another state variable under mnemonic")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("displayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setDisplayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// modify the generateMnenomic method to also set mnemonic as displayText")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("getMnemonic")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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 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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateMnemonic")]),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 literal-property property"}},[t._v("length")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("network")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'testnet'")]),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 punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setMnemonic")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 function"}},[t._v("setDisplayText")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("and finally, let's add the component to display the output under "),a("code",[t._v("{/* method call result */}")])]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// screens/home.js")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* method call result */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// display the component only if displayText has a value")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("displayText "),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 tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("responseSection"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Text")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("responseText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("selectable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n Response:\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Text")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("selectable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("displayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[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 punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v('We should now have a working" Generate Mnemonic" button which displays the new mnemonic')]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"50%"},attrs:{src:s(359)}}),t._v(" "),a("p",[t._v("A quick recap, we added a button to trigger a call to a method. We created a button click event handler to call bdk-rn. Set the display state variable to display the output of the call in the display section. We will follow this pattern for the remaining calls to bdk-rn.")]),t._v(" "),a("h2",{attrs:{id:"creating-a-wallet"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#creating-a-wallet"}},[t._v("#")]),t._v(" Creating a wallet")]),t._v(" "),a("p",[t._v("Before moving on to creating a wallet, let's add a section at the top to display the balance of the wallet.")]),t._v(" "),a("p",[t._v("To display the balance we will need a state variable to store the balance and a display section to display it.")]),t._v(" "),a("p",[t._v("Under the "),a("code",[t._v("mnemonic")]),t._v(" and "),a("code",[t._v("displayText")]),t._v(" variables, let's add one for "),a("code",[t._v("balance")]),t._v(" as well")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[t._v("\t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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 operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// BDK-RN method calls and state variables will be added here")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setMnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 punctuation"}},[t._v(";")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("displayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setDisplayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 punctuation"}},[t._v(";")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setBalance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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("p",[t._v("And we will shortly need a "),a("code",[t._v("wallet")]),t._v(" and "),a("code",[t._v("syncResponse")]),t._v(" as well so add these too.")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[t._v("\t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("Home")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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 operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// BDK-RN method calls and state variables will be added here")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setMnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 punctuation"}},[t._v(";")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("displayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setDisplayText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 punctuation"}},[t._v(";")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setBalance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setWallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 \t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("syncResponse"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setSyncResponse"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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("p",[t._v("Now we need some "),a("code",[t._v("jsx")]),t._v(" code to display the balance.")]),t._v(" "),a("p",[t._v("Just below "),a("code",[t._v("{/* Balance */}")]),t._v(" and above "),a("code",[t._v("{*/ method call result */}")]),t._v(" add the following UI components to display the balance. We only want to show the balance when it has a value so we will use a tertiary operator for a quick check.")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[t._v("\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* Balance */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("balanceSection"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Text")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("balanceText"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("selectable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Balance: '")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Text")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("selectable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'0'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v(" Sats")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* method call result */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("We will next add code to create a wallet.")]),t._v(" "),a("p",[t._v("To create a wallet the simple approach is to call "),a("code",[t._v("createWallet()")]),t._v(" method with "),a("code",[t._v("mnemonic")]),t._v(" , "),a("code",[t._v("password")]),t._v(" and "),a("code",[t._v("network")]),t._v(".\nLet's add another click event handler below where we have the "),a("code",[t._v("getMnemonic()")]),t._v(" method\nWe want to see the response to this call so let's use "),a("code",[t._v("setDisplayText()")]),t._v(" to see the output")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("createWallet")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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 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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" data "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),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 literal-property property"}},[t._v("mnemonic")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("password")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'password'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("network")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'testnet'")]),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 punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setWallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 function"}},[t._v("setDisplayText")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("A new button will be required to trigger "),a("code",[t._v("createWallet")])]),t._v(" "),a("p",[t._v("Let's add a new button just above "),a("code",[t._v("{/* input boxes and send transaction button */}")])]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[t._v("\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Button")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("title")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Create Wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("methodButton"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onPress")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("createWallet"),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 tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[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 comment"}},[t._v("/* input boxes and send transaction button */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The response returned by "),a("code",[t._v("createWallet")]),t._v(" is a new address for the created wallet.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string-property property"}},[t._v('"data"')]),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 string-property property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tb1qxg8g8cdzgs09cttu3y7lc33udqc4wsesunjnhe"')]),t._v("\n "),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 string-property property"}},[t._v('"error"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The App should now be creating a wallet when we click "),a("strong",[t._v("Create Mnemonic")]),t._v(" followed by "),a("strong",[t._v("Create Wallet")]),t._v(".")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"50%"},attrs:{src:s(360)}}),t._v(" "),a("p",[t._v("The wallet created is a HD wallet and the address displayed is the 0 index address for the wallet. The path used by default is 84'/1'/0'/0/* for addresses and 84'/1'/0'/1/* for change.")]),t._v(" "),a("p",[t._v("As we specified "),a("code",[t._v("testnet")]),t._v(" and did not specify "),a("code",[t._v("blockChainName")]),t._v(" and "),a("code",[t._v("blockChainConfigUrl")]),t._v(" a default testnet server will be used as the bitcoin node, "),a("code",[t._v("ssl://electrum.blockstream.info")]),t._v(" is the default url used for testnet.")]),t._v(" "),a("p",[t._v("Using "),a("code",[t._v("mnemonic")]),t._v(" is a quick way to create a new wallet with "),a("code",[t._v("bdk-rn")]),t._v(". The "),a("code",[t._v("createWallet()")]),t._v(" method in "),a("code",[t._v("bdk-rn")]),t._v(" has many optional arguments to configure the wallet. In addition to mnemonic, a wallet can also be created with a descriptor. If a descriptor is passed as an argument the wallet will be created using the descriptor. When using a descriptor, arguments for network, password and mnemonic are not required. "),a("code",[t._v("bdk-rn")]),t._v(" has a "),a("code",[t._v("createDescriptor()")]),t._v(" method to create a descriptor. More about output descriptors "),a("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(". Refer to the "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#createdescriptor",target:"_blank",rel:"noopener noreferrer"}},[t._v("readme"),a("OutboundLink")],1),t._v(" for all options available when creating output descriptors with "),a("code",[t._v("bdk-rn")])]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// using a descriptor to create wallet ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" response "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),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 literal-property property"}},[t._v("descriptor")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'tprv8ZgxMBicQKsPd3G66kPkZEuJZgUK9QXJRYCwnCtYLJjEZmw8xFjCxGoyx533AL83XFcSQeuVmVeJbZai5RTBxDp71Abd2FPSyQumRL79BKw'")]),t._v("\n"),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("p",[t._v("Other arguments for "),a("code",[t._v("createWallet()")]),t._v(" are:")]),t._v(" "),a("p",[a("strong",[t._v("blockChainName")]),t._v(": Blockchain backend to use, like "),a("a",{attrs:{href:"https://github.com/romanz/electrs",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("electrum")]),a("OutboundLink")],1),t._v(", "),a("a",{attrs:{href:"https://github.com/Blockstream/esplora",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("esplora")]),a("OutboundLink")],1),t._v(", "),a("code",[t._v("compact-filters")]),t._v(" ("),a("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP157"),a("OutboundLink")],1),t._v(") and Bitcoin Core. "),a("code",[t._v("bdk-rn")]),t._v(" at the moment doesn't support compact-filters and Bitcoin Core, this will be added shortly in a future release.")]),t._v(" "),a("p",[a("strong",[t._v("blockChainConfigUrl")]),t._v(": This is the url of the specified bitcoin node this should match the chain and the type of blockchain specified as "),a("strong",[t._v("blockChainName")])]),t._v(" "),a("p",[t._v("Refer to "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#createwallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("readme"),a("OutboundLink")],1),t._v(" for a complete list of options for "),a("code",[t._v("createWallet")])]),t._v(" "),a("h2",{attrs:{id:"utxos-and-balance"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#utxos-and-balance"}},[t._v("#")]),t._v(" UTXOs and balance")]),t._v(" "),a("p",[t._v("With the wallet created, we can now add methods to sync UTXOs compute balance.")]),t._v(" "),a("p",[a("code",[t._v("bdk-rn")]),t._v(" has a "),a("code",[t._v("syncWallet")]),t._v(" method to sync all UTXOs belonging to the wallet with the bitcoin network, the specified "),a("code",[t._v("blockChainName")]),t._v(" and "),a("code",[t._v("blockChainConfigUrl")]),t._v(" is used to sync. Once the wallet sync is complete balance is computed and "),a("code",[t._v("getBalance")]),t._v(" can fetch the balance.")]),t._v(" "),a("p",[t._v("Earlier we have aleady added state variables for"),a("code",[t._v("syncResponse")]),t._v("and "),a("code",[t._v("balance")]),t._v(". Now we will add buttons to call "),a("code",[t._v("syncWallet")]),t._v(" and "),a("code",[t._v("getBalance")]),t._v(". Just below the Create Wallet button lets add two buttons as follows:")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Button")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("title")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Sync Wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("methodButton"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onPress")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("syncWallet"),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 tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Button")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("title")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Get Balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("methodButton"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onPress")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("getBalance"),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 tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),a("p",[t._v("And two click handlers below createWallet:")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("syncWallet")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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 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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" data "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("syncWallet")]),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 function"}},[t._v("setSyncResponse")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 function"}},[t._v("setDisplayText")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("getBalance")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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 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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" data "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),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 function"}},[t._v("setBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 function"}},[t._v("setDisplayText")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 punctuation"}},[t._v(";")]),t._v("\n\n")])])]),a("p",[t._v("We should now be able to create a wallet, sync UTXOs and get balance")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"50%"},attrs:{src:s(361)}}),t._v(" "),a("p",[t._v("We can use a public testnet faucet to send testnet coins to the wallet and check that the UTXO sync and balance fetch are working correctly. Before we do that add one more method to generate a new address we can then use this address to get testnet coins from a faucet.")]),t._v(" "),a("p",[t._v("Let's add a state variable for "),a("code",[t._v("address")]),t._v(", a button for "),a("strong",[t._v("Get Address")]),t._v(" and a click event handler to call "),a("code",[t._v("bdk-rn")]),t._v(" and create a new address. Let's do the following")]),t._v(" "),a("p",[t._v("Add "),a("code",[t._v("address")]),t._v(" and "),a("code",[t._v("setAddress")]),t._v(" state variables below balance and "),a("code",[t._v("setBalance")]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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("p",[t._v("A new "),a("code",[t._v("getAddress")]),t._v(" click event handler below "),a("code",[t._v("getBalance")]),t._v(" click event handler:")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("getAddress")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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 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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" data "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getNewAddress")]),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 function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 function"}},[t._v("setDisplayText")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("And a Get Address button below the existing Get Balance button:")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Button")])]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("title")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Get Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("methodButton"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onPress")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("getAddress"),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("We should now have the following, and Get Address will be able to display a new address.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"50%"},attrs:{src:s(362)}}),t._v(" "),a("p",[t._v("Now that we are able to generate a receive address we can get some testnet bitcoin from one of the public "),a("a",{attrs:{href:"https://coinfaucet.eu/en/btc-testnet/",target:"_blank",rel:"noopener noreferrer"}},[t._v("testnet faucets"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("After we send and after the transaction is confirmed we will need to sync the wallet before we can see the new balance from the received transaction.")]),t._v(" "),a("h2",{attrs:{id:"restoring-wallet"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#restoring-wallet"}},[t._v("#")]),t._v(" Restoring wallet")]),t._v(" "),a("p",[t._v("The "),a("code",[t._v("createWallet")]),t._v(" method creates a wallet using a "),a("code",[t._v("mnemonic")]),t._v(", in order to restore we can use the same method, we won't need to call "),a("code",[t._v("generateMnemonic")]),t._v(" as we will already have a "),a("code",[t._v("mnemonic")]),t._v(" to restore with.")]),t._v(" "),a("p",[t._v("Let's add an input box to enter our own "),a("code",[t._v("mnemonic")]),t._v(", we will use the "),a("code",[t._v("mnemonic")]),t._v(" entered in the input box to create a wallet.")]),t._v(" "),a("p",[t._v("Let's add an input box for "),a("code",[t._v("mnemonic")]),t._v(" below the Generate Mnemonic button.")]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextInput")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("multiline")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("value")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("mnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onChangeText")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("setMnemonic"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("textAlignVertical")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("top"),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("This code will also display the mnemonic state variable in the input box, if we click Generate Mnemonic the generated mnemonic will show up in the input box. We can overwrite it with our own mnemonic and doing so will also overwrite the mnemonic state variable. This way the mnemonic displayed will be the one used to create the wallet.")]),t._v(" "),a("p",[t._v("we are already using the mnemonic state variable in the "),a("code",[t._v("createWallet")]),t._v(" Method so no other changes are required.")]),t._v(" "),a("p",[t._v("We can now use our own mnemonic and use it to restore a wallet. This will come in handy if we have a wallet with testnet bitcoin as these are hard to come by.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"50%"},attrs:{src:s(363)}}),t._v(" "),a("h2",{attrs:{id:"sending-bitcoin"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sending-bitcoin"}},[t._v("#")]),t._v(" Sending bitcoin")]),t._v(" "),a("p",[t._v("We are now able to receive bitcoin, time to add functionality to send as well.")]),t._v(" "),a("p",[a("code",[t._v("bdk-rn")]),t._v(" has a number of transaction-related methods to enable varied use cases. A new send transaction can be created and broadcast using "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#quicksend",target:"_blank",rel:"noopener noreferrer"}},[t._v("quickSend()"),a("OutboundLink")],1),t._v(". If required an unsigned transaction can be created using "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#createtransaction",target:"_blank",rel:"noopener noreferrer"}},[t._v("createTransaction()"),a("OutboundLink")],1),t._v(" , this can be signed later with "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#signtransaction",target:"_blank",rel:"noopener noreferrer"}},[t._v("signTransactioin()"),a("OutboundLink")],1),t._v(" method and broadcast using "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#broadcasttransaction",target:"_blank",rel:"noopener noreferrer"}},[t._v("broadcastTransaction()"),a("OutboundLink")],1),t._v(". There are also methods to query transactions by pending or confirmed status and all transactions. Please refer to "),a("code",[t._v("bdk-rn")]),t._v(" "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn/blob/main/README.md#gettransactions",target:"_blank",rel:"noopener noreferrer"}},[t._v("readme"),a("OutboundLink")],1),t._v(" for more details on all the methods.")]),t._v(" "),a("p",[t._v("We will need state variables for recipient address and amount as well as for transaction, these can be added below our existing variables for syncResponse and address")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("syncResponse"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setSyncResponse"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("transaction"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setTransaction"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("recipient"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setRecipient"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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 punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("amount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setAmount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),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("p",[t._v("A click event handler for send button, we will use the "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#quicksend",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("quickSend()")]),a("OutboundLink")],1),t._v(" method to send specified amount in sats to address.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[t._v("\t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("sendTx")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),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 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("const")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" data "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("quickSend")]),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 literal-property property"}},[t._v("address")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" recipient"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("amount")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" amount"),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 punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 function"}},[t._v("setDisplayText")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),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 punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("Add a new section for send transaction functionality. We will need an input box for the receiver address and an input box for the amount to send. We will also need a button to trigger the transaction.")]),t._v(" "),a("p",[t._v("Let's add the send transaction section and UI components below "),a("code",[t._v("{/* input boxes and send transaction button */}")])]),t._v(" "),a("div",{staticClass:"language-jsx extra-class"},[a("pre",{pre:!0,attrs:{class:"language-jsx"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* input boxes and send transaction button */")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sendSection"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Fragment")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextInput")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("placeholder")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Recipient Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onChangeText")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("setRecipient"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TextInput")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("placeholder")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Amount (in sats)"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onChangeText")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("e")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAmount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),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 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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Button")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("title")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Send Transaction"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("style")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("styles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("methodButton"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("onPress")]),a("span",{pre:!0,attrs:{class:"token script language-javascript"}},[a("span",{pre:!0,attrs:{class:"token script-punctuation punctuation"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("sendTx"),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 plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),a("span",{pre:!0,attrs:{class:"token plain-text"}},[t._v("\n ")]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),a("p",[t._v("We should now be able to send a transaction as long as there is sufficient balance.")]),t._v(" "),a("img",{staticStyle:{display:"block",margin:"0px auto",zoom:"50%"},attrs:{src:s(364)}}),t._v(" "),a("h2",{attrs:{id:"conclusion"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[t._v("#")]),t._v(" Conclusion")]),t._v(" "),a("p",[t._v("The App we created can be built and distributed for both iOS and Android thus sharing a code base and reducing development time. The development and coding focused on application-level code for use cases and we did not have to code intricate internal bitcoin protocol-level code or bitcoin node interactions, and transactions. UTXOs and sync-related functionalities were also not required. All this was managed by "),a("code",[t._v("bdk-rn")]),t._v(" allowing us to focus on the product, functionality and user journey. This is how "),a("code",[t._v("bdk")]),t._v(" and "),a("code",[t._v("bdk-rn")]),t._v(" intend to make Rapid Bitcoin Application Development possible by allowing product and application developers to focus on what they know best while "),a("code",[t._v("bdk")]),t._v(" handles bitcoin complexity.")]),t._v(" "),a("p",[a("code",[t._v("bdk-rn")]),t._v(" intends to expose functionality and APIs from "),a("code",[t._v("bdk")]),t._v(" which has a wide variety of API with granular details allowing for many interesting use cases to be implemented. "),a("code",[t._v("bdk-rn")]),t._v(" and "),a("code",[t._v("bdk")]),t._v(" are constantly updated and enhanced based on feedback from product teams and developers in the bitcoin community.")]),t._v(" "),a("p",[t._v("Stay tuned for more APIs and enhancements coming to "),a("code",[t._v("bdk-rn")]),t._v(" in the near future. Feature and API requests are most welcome. New blogs and tutorials will be published soon for a more in-depth exploration of bdk-rn.")]),t._v(" "),a("p",[t._v("In the meantime keep in touch with the project by following on "),a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn",target:"_blank",rel:"noopener noreferrer"}},[t._v("GitHub"),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://twitter.com/BitcoinZavior",target:"_blank",rel:"noopener noreferrer"}},[t._v("Twitter"),a("OutboundLink")],1)]),t._v(" "),a("h4",{attrs:{id:"references"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#references"}},[t._v("#")]),t._v(" References:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://github.com/bitcoindevkit",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-rn"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://www.youtube.com/watch?v=gMpWA875go4",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Developers YouTube"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/LtbLightning/BdkRnQuickStart",target:"_blank",rel:"noopener noreferrer"}},[t._v("BdkRnQuickStart App GitHub Repository"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://reactnative.dev/docs/environment-setup",target:"_blank",rel:"noopener noreferrer"}},[t._v("Setup React Native Development Environment"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch04.asciidoc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mastering Bitcoin(HD Wallet chapter)"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Output Descriptors from bitcoin GitHub"),a("OutboundLink")],1)]),t._v(" "),a("li",[t._v("Testnet Faucet: "),a("a",{attrs:{href:"https://coinfaucet.eu/en/btc-testnet/",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://coinfaucet.eu/en/btc-testnet/"),a("OutboundLink")],1),t._v(" or "),a("a",{attrs:{href:"https://bitcoinfaucet.uo1.net",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://bitcoinfaucet.uo1.net"),a("OutboundLink")],1)])])])}),[],!1,null,null,null);a.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/34.0866fba2.js b/assets/js/34.0cca050d.js similarity index 99% rename from assets/js/34.0866fba2.js rename to assets/js/34.0cca050d.js index 30f9edccbc..0b35df4d50 100644 --- a/assets/js/34.0866fba2.js +++ b/assets/js/34.0cca050d.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"},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("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.c77abd8d.js b/assets/js/35.114fe51f.js similarity index 99% rename from assets/js/35.c77abd8d.js rename to assets/js/35.114fe51f.js index d9b4823b6b..961324efb3 100644 --- a/assets/js/35.c77abd8d.js +++ b/assets/js/35.114fe51f.js @@ -1 +1 @@ -(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 +(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{317:function(t,a,s){},376:function(t,a,s){"use strict";s(317)},436: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.34830475.js b/assets/js/36.f5632206.js similarity index 93% rename from assets/js/36.34830475.js rename to assets/js/36.f5632206.js index cc2c8926f9..93c21ed1b0 100644 --- a/assets/js/36.34830475.js +++ b/assets/js/36.f5632206.js @@ -1 +1 @@ -(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 +(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{318:function(t,s,a){},377:function(t,s,a){"use strict";a(318)},437: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/37.6a4c3a55.js b/assets/js/37.4c491801.js similarity index 97% rename from assets/js/37.6a4c3a55.js rename to assets/js/37.4c491801.js index b2622e7643..e719b7f2b2 100644 --- a/assets/js/37.6a4c3a55.js +++ b/assets/js/37.4c491801.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{319:function(t,a,s){},378:function(t,a,s){"use strict";s(319)},437:function(t,a,s){"use strict";s.r(a);s(378);var i=s(7),r=Object(i.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"desktop"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#desktop"}},[t._v("#")]),t._v(" Desktop")]),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.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://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=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{319:function(t,a,s){},378:function(t,a,s){"use strict";s(319)},438:function(t,a,s){"use strict";s.r(a);s(378);var i=s(7),r=Object(i.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"desktop"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#desktop"}},[t._v("#")]),t._v(" Desktop")]),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.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://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=r.exports}}]); \ No newline at end of file diff --git a/assets/js/40.3dbbc631.js b/assets/js/40.1dca96ab.js similarity index 86% rename from assets/js/40.3dbbc631.js rename to assets/js/40.1dca96ab.js index 3994d3438e..5c25f4eb46 100644 --- a/assets/js/40.3dbbc631.js +++ b/assets/js/40.1dca96ab.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],{324:function(t,s,a){},383:function(t,s,a){"use strict";a(324)},444:function(t,s,a){"use strict";a.r(s);a(383);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.dd41fb56.js similarity index 97% rename from assets/js/41.802e975e.js rename to assets/js/41.dd41fb56.js index 910da5500f..7bd4f15fb6 100644 --- a/assets/js/41.802e975e.js +++ b/assets/js/41.dd41fb56.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],{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:"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/42.9910b687.js b/assets/js/42.78dc17a2.js similarity index 89% rename from assets/js/42.9910b687.js rename to assets/js/42.78dc17a2.js index 5f3eb0c47d..aed0026745 100644 --- a/assets/js/42.9910b687.js +++ b/assets/js/42.78dc17a2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{324:function(t,a,s){},383:function(t,a,s){"use strict";s(324)},445:function(t,a,s){"use strict";s.r(a);s(383);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:"web"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#web"}},[t._v("#")]),t._v(" Web")]),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://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.")])])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{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:"web"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#web"}},[t._v("#")]),t._v(" Web")]),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://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.")])])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/49.0ab13c0b.js b/assets/js/49.c37e1b0c.js similarity index 99% rename from assets/js/49.0ab13c0b.js rename to assets/js/49.c37e1b0c.js index 3bf3ae7025..8d69b09125 100644 --- a/assets/js/49.0ab13c0b.js +++ b/assets/js/49.c37e1b0c.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[49],{404: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],{405: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.db815b83.js b/assets/js/50.525b80bb.js similarity index 99% rename from assets/js/50.db815b83.js rename to assets/js/50.525b80bb.js index 4c7daaadeb..030a260572 100644 --- a/assets/js/50.db815b83.js +++ b/assets/js/50.525b80bb.js @@ -1 +1 @@ -(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 +(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 diff --git a/assets/js/54.e4524c5c.js b/assets/js/54.2642e758.js similarity index 99% rename from assets/js/54.e4524c5c.js rename to assets/js/54.2642e758.js index e983d51f75..6f1cadd98a 100644 --- a/assets/js/54.e4524c5c.js +++ b/assets/js/54.2642e758.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[54],{411:function(e,t,a){"use strict";a.r(t);var s=a(7),r=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("In this post, we will use the "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" tool to create a multi-owned descriptor-based paper wallet. We will use "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk"),t("OutboundLink")],1),e._v(" via the "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" tool to test our descriptor and to be able to sweep the funds from our paper wallet to a new address.")]),e._v(" "),t("h2",{attrs:{id:"about-paper-wallets"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#about-paper-wallets"}},[e._v("#")]),e._v(" About paper wallets")]),e._v(" "),t("p",[e._v("Paper wallets have a lot of drawbacks, as explained in the "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/Paper_wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("paper wallet Wiki article"),t("OutboundLink")],1),e._v(", as always, do your own research before deciding to use it with mainnet bitcoins. In this post we will\nonly be using testnet coins.")]),e._v(" "),t("h2",{attrs:{id:"descriptors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#descriptors"}},[e._v("#")]),e._v(" Descriptors")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet/tree/339fa4418d94f6fdd96f3d0301cab8a0bc09e8bd",target:"_blank",rel:"noopener noreferrer"}},[e._v("previous version"),t("OutboundLink")],1),e._v(" of the "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" followed the original paper wallet design: WIF"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v(" as secret part with the option to generate a different kind of addresses (legacy, nested segwit, and segwit).")]),e._v(" "),t("p",[e._v("There were plans to "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet/issues/5",target:"_blank",rel:"noopener noreferrer"}},[e._v("support mnemonic"),t("OutboundLink")],1),e._v(" instead of WIF keys because it may"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn2",id:"fnref2"}},[e._v("[2]")])]),e._v(" save the sweep transaction"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn3",id:"fnref3"}},[e._v("[3]")])]),e._v(" and there are more wallets capable of importing a mnemonic instead of a WIF.")]),e._v(" "),t("p",[e._v("However, choosing a single address type or having wallet support for a specific format is the kind of problem "),t("a",{attrs:{href:"/descriptors"}},[e._v("descriptors")]),e._v(" solve perfectly, so the latest "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" version now accepts a descriptor and the network as parameters.")]),e._v(" "),t("h2",{attrs:{id:"example-use-case"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#example-use-case"}},[e._v("#")]),e._v(" Example use case")]),e._v(" "),t("p",[e._v("So let's say your grandma wants to buy bitcoin and asked for your help.")]),e._v(" "),t("p",[e._v("You are a little afraid she may lose the private key. At the same time, you don't want to duplicate the keys and give those to her daughters Alice and Barbara, because both of them could spend and accuse the other of having done so.")]),e._v(" "),t("p",[e._v("Even though we trust everyone in the family it is better to play it safe and divide the responsibility of protecting Grandma's bitcoin.")]),e._v(" "),t("p",[e._v("This is a perfect case for a 2 of 3 multi-signature paper wallet. This way also protects the participants from having their copy of the wallet stolen. To compromise Grandma's wallet a thief would need to find and steal at least two of them.")]),e._v(" "),t("p",[e._v("Note that you as the wallet creator are still the single point of trust because you are going to generate the keys for everyone. Setups combining self generated keys from the participants is possible future work.")]),e._v(" "),t("h2",{attrs:{id:"creating-the-paper-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-the-paper-wallet"}},[e._v("#")]),e._v(" Creating the paper wallet")]),e._v(" "),t("p",[e._v("For this example the spending descriptor would be:")]),e._v(" "),t("p",[t("code",[e._v("wsh(multi(2,Grandma,Alice,Barbara))")])]),e._v(" "),t("p",[e._v("You need "),t("a",{attrs:{href:"https://www.rust-lang.org/tools/install",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust"),t("OutboundLink")],1),e._v(" installed to use "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(". The -n option below explicitly selects\ngenerating "),t("code",[e._v("testnet")]),e._v(" keys. Use "),t("code",[e._v("rusty-paper-wallet --help")]),e._v(" to see usage instructions and other\noptions.")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("cargo")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" rusty-paper-wallet\n$ rusty-paper-wallet "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"wsh(multi(2,Grandma,Alice,Barbara))"')]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-n")]),e._v(" testnet\ndata:text/html"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("base64,PCFET0N"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("..")]),e._v(".\n")])])]),t("p",[e._v("The "),t("a",{attrs:{href:"/descriptor-based-paper-wallets/data-url.txt"}},[e._v("output")]),e._v(" of the command is very long and has been shortened. The string is a "),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/Data_URI_scheme",target:"_blank",rel:"noopener noreferrer"}},[e._v("data URI scheme"),t("OutboundLink")],1),e._v(" paste-able in the address bar of a browser. By using a data URI no files are written on the hard disk, leaving less trace of secret material on the computer.\nIt's also a good idea to use incognito mode in the browser to prevent it from saving the page in the history.")]),e._v(" "),t("p",[e._v("The following is the result:")]),e._v(" "),t("iframe",{staticClass:"example",attrs:{src:"/descriptor-based-paper-wallets/Bitcoin_Paper_Wallet.html"}}),e._v(" "),t("p",[e._v("Under the hood, the command created a key pair randomly for every alias present in the descriptor, then replaced the aliases with the created keys and generated the corresponding address. This address is the same for every paper wallet and it is shown in the upper part of the paper wallet (the public part) along with the alias, linking the paper wallet to the owner.")]),e._v(" "),t("p",[e._v("The lower part is the secret part, the written part is the descriptor with the aliases, followed by a legend linking the aliases with the keys. In the legend, all the keys are public but the one of the owner which is a private WIF. The secret QR code instead contains the descriptor already with the keys.")]),e._v(" "),t("p",[e._v("The paper wallet must then be printed, and it is better to use a printer without wifi and also to be aware that some sensitive data may remain in the printer's cache.")]),e._v(" "),t("p",[e._v("Then the paper wallet must be cut along the dotted lines, the secret part should be folded twice over the black zone"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn4",id:"fnref4"}},[e._v("[4]")])]),e._v(". The black zone helps to avoid showing the secret parts in the presence of back-light. Once the folding is done the paper wallet should be plasticized to prevent being damaged by water.")]),e._v(" "),t("h2",{attrs:{id:"bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk"}},[e._v("#")]),e._v(" BDK")]),e._v(" "),t("p",[e._v("Any descriptor based wallet can be used to check the balance of and sweep the funds from\nGrandma's paper wallet. For this post we'll demonstrate using the "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" tool to do these steps.\nAnother area where "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk"),t("OutboundLink")],1),e._v(" could be used with "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" is to compile a more\ncomplicated miniscript spending policy into a descriptor, as we have done in the "),t("RouterLink",{attrs:{to:"/blog/2021/02/spending-policy-demo/#step-4-create-wallet-descriptors-for-each-participant"}},[e._v("spending policy demo")]),e._v(" post.")],1),e._v(" "),t("h2",{attrs:{id:"funding-tx"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#funding-tx"}},[e._v("#")]),e._v(" Funding tx")]),e._v(" "),t("p",[e._v("Since Grandma's wallet was created as a "),t("code",[e._v("wsh")]),e._v(" descriptor, bitcoin can be sent to it from any\nsegwit capable wallet, we'll use a public "),t("a",{attrs:{href:"https://bitcoinfaucet.uo1.net/",target:"_blank",rel:"noopener noreferrer"}},[e._v("bitcoin testnet faucet"),t("OutboundLink")],1),e._v(". Once the funds are sent the\ndeposit address "),t("code",[e._v("tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw")]),e._v(" we can also use this\naddress and a testnet explorer to "),t("a",{attrs:{href:"https://mempool.space/testnet/address/tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw",target:"_blank",rel:"noopener noreferrer"}},[e._v("confirm the funds were received"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"sweep-tx"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#sweep-tx"}},[e._v("#")]),e._v(" Sweep tx")]),e._v(" "),t("p",[e._v("Now that Grandma's paper wallet is funded it's time to demonstrate how to use "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" to sweep these\nfunds to a new address. Let's assume Grandma lost her original paper wallet and has asked\nher daughters to sweep them to a new single signature wallet so she can spend them.")]),e._v(" "),t("h3",{attrs:{id:"step-1-alice-creates-and-signs-a-psbt"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-1-alice-creates-and-signs-a-psbt"}},[e._v("#")]),e._v(" Step 1: Alice creates and signs a PSBT")]),e._v(" "),t("p",[e._v("Alice uses the private text or QR code from her paper wallet to find her private key and the\npublic keys for Grandma and Barbara. With this info she creates a PSBT to sweep Grandma's funds\nto a new address (in this example we'll send them back to our "),t("a",{attrs:{href:"https://bitcoinfaucet.uo1.net/",target:"_blank",rel:"noopener noreferrer"}},[e._v("bitcoin testnet faucet"),t("OutboundLink")],1),e._v("). Notice how Alice\nincludes her wallet's descriptor checksum '#em3q73l5', this "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md#checksums",target:"_blank",rel:"noopener noreferrer"}},[e._v("guarantees"),t("OutboundLink")],1),e._v(" she has entered her descriptor correctly.")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("SWEEP_TO_ADDR")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2\n\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_WIF")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("cSSKRHDmQEEutp5LD14tAcixu2ehSNPDTqNek1zMa9Pet98qxHq3\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("BARBARA_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("02a3f3f2658b9812ddeabfbde2fde03f8a65369e4ed621f29fa8ba0cc519b789fb\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("GRANDMA_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("03f1bd2bff8e9c61f58a8d46d18fd8f3149b1f2d76b3c423a7874a5d5811d67cee\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_DESCRIPTOR")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"wsh(multi(2,'),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$GRANDMA_PUBKEY")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_WIF")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_PUBKEY")]),e._v('))#em3q73l5"')]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# confirm descriptor creates the expected deposit address")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_DESCRIPTOR")]),e._v(" get_new_address\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"address"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw"')]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# sync the wallet and show the balance")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_DESCRIPTOR")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("sync")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_DESCRIPTOR")]),e._v(" get_balance\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"satoshi"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("10000")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# create and sign PSBT")]),e._v("\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("UNSIGNED_PSBT")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token variable"}},[t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$(")]),e._v("bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" $ALICE_DESCRIPTOR create_tx "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--send_all")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--to")]),e._v(" $SWEEP_TO_ADDR:0 "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("|")]),e._v(" jq "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-r")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('".psbt"')]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v(")")])]),e._v("\n\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_SIGNED_PSBT")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token variable"}},[t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$(")]),e._v("bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" $ALICE_DESCRIPTOR sign "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--psbt")]),e._v(" $UNSIGNED_PSBT "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("|")]),e._v(" jq "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-r")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('".psbt"')]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v(")")])]),e._v("\n")])])]),t("h3",{attrs:{id:"step-2-barbara-signs-alices-signed-psbt-and-broadcasts-the-tx"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-2-barbara-signs-alices-signed-psbt-and-broadcasts-the-tx"}},[e._v("#")]),e._v(" Step 2: Barbara signs Alice's signed PSBT and broadcasts the tx")]),e._v(" "),t("p",[e._v("Now it's Barbara's turn to use the private text or QR code from her paper wallet to get her private\nkey and the public keys for Grandma and Alice. With this info plus Alice's signed PSBT she can\ncreate a fully signed PSBT to broadcast and complete the sweep of Grandma's funds.")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("02e486e32f0f87136fa042cb53219ace8537ea1d036deb2f4293570b94325d11cb\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("BARBARA_WIF")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("cSfMLzSZ9NjWUTqL3sFpgWJssnu2qgmE2cm5N1jPDRRJuDcrsPEB\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("GRANDMA_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("03f1bd2bff8e9c61f58a8d46d18fd8f3149b1f2d76b3c423a7874a5d5811d67cee\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("BARBARA_DESCRIPTOR")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"wsh(multi(2,'),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$GRANDMA_PUBKEY")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_PUBKEY")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_WIF")]),e._v('))#nxfa5n0z"')]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# confirm descriptor creates the expected deposit address")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" get_new_address\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"address"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw"')]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# sync the wallet and show the balance")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("sync")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" get_balance\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"satoshi"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("10000")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("FINAL_PSBT")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token variable"}},[t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$(")]),e._v("bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" $BARBARA_DESCRIPTOR sign "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--psbt")]),e._v(" $ALICE_SIGNED_PSBT "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("|")]),e._v(" jq "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-r")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('".psbt"')]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v(")")])]),e._v("\n\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" broadcast "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--psbt")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$FINAL_PSBT")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"txid"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"9ecd8e6be92b7edd8bf1799f8f7090e58f813825f826bdb771b4cdb444cdeb59"')]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("And finally we verify that Alice and Barbara successfully created and broadcast Grandma's "),t("a",{attrs:{href:"https://mempool.space/testnet/tx/9ecd8e6be92b7edd8bf1799f8f7090e58f813825f826bdb771b4cdb444cdeb59",target:"_blank",rel:"noopener noreferrer"}},[e._v("sweep tx"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"conclusion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),t("p",[e._v("In this post we showed how to create a multi-sig descriptor based paper wallet using\n"),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" and then sweep the funds from our example paper wallet to a new address. If you\nfound this post interesting please comment below. Or give it a try yourself and if you run into any\nproblems or would like to suggest improvements leave an issue in the "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" or\n"),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" github repos. Thanks!")]),e._v(" "),t("hr",{staticClass:"footnotes-sep"}),e._v(" "),t("section",{staticClass:"footnotes"},[t("ol",{staticClass:"footnotes-list"},[t("li",{staticClass:"footnote-item",attrs:{id:"fn1"}},[t("p",[e._v("Wallet Input Format, a string encoding a ECDSA private key https://en.bitcoin.it/wiki/Wallet_import_format "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn2"}},[t("p",[e._v("Unless the user import the WIF directly into bitcoin core "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref2"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn3"}},[t("p",[e._v("Some wallets refers to sweep as the action to create a transaction taking all the funds from the paper wallet and sending those to the wallet itself. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref3"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn4"}},[t("p",[e._v("Ideally, the black zone should be twice as long as the secret part to cover it back and front, long descriptor may leave a shorter black zone, ensure to have you printer set with vertical layout for best results. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref4"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[54],{410:function(e,t,a){"use strict";a.r(t);var s=a(7),r=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("In this post, we will use the "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" tool to create a multi-owned descriptor-based paper wallet. We will use "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk"),t("OutboundLink")],1),e._v(" via the "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" tool to test our descriptor and to be able to sweep the funds from our paper wallet to a new address.")]),e._v(" "),t("h2",{attrs:{id:"about-paper-wallets"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#about-paper-wallets"}},[e._v("#")]),e._v(" About paper wallets")]),e._v(" "),t("p",[e._v("Paper wallets have a lot of drawbacks, as explained in the "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/Paper_wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("paper wallet Wiki article"),t("OutboundLink")],1),e._v(", as always, do your own research before deciding to use it with mainnet bitcoins. In this post we will\nonly be using testnet coins.")]),e._v(" "),t("h2",{attrs:{id:"descriptors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#descriptors"}},[e._v("#")]),e._v(" Descriptors")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet/tree/339fa4418d94f6fdd96f3d0301cab8a0bc09e8bd",target:"_blank",rel:"noopener noreferrer"}},[e._v("previous version"),t("OutboundLink")],1),e._v(" of the "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" followed the original paper wallet design: WIF"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v(" as secret part with the option to generate a different kind of addresses (legacy, nested segwit, and segwit).")]),e._v(" "),t("p",[e._v("There were plans to "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet/issues/5",target:"_blank",rel:"noopener noreferrer"}},[e._v("support mnemonic"),t("OutboundLink")],1),e._v(" instead of WIF keys because it may"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn2",id:"fnref2"}},[e._v("[2]")])]),e._v(" save the sweep transaction"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn3",id:"fnref3"}},[e._v("[3]")])]),e._v(" and there are more wallets capable of importing a mnemonic instead of a WIF.")]),e._v(" "),t("p",[e._v("However, choosing a single address type or having wallet support for a specific format is the kind of problem "),t("a",{attrs:{href:"/descriptors"}},[e._v("descriptors")]),e._v(" solve perfectly, so the latest "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" version now accepts a descriptor and the network as parameters.")]),e._v(" "),t("h2",{attrs:{id:"example-use-case"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#example-use-case"}},[e._v("#")]),e._v(" Example use case")]),e._v(" "),t("p",[e._v("So let's say your grandma wants to buy bitcoin and asked for your help.")]),e._v(" "),t("p",[e._v("You are a little afraid she may lose the private key. At the same time, you don't want to duplicate the keys and give those to her daughters Alice and Barbara, because both of them could spend and accuse the other of having done so.")]),e._v(" "),t("p",[e._v("Even though we trust everyone in the family it is better to play it safe and divide the responsibility of protecting Grandma's bitcoin.")]),e._v(" "),t("p",[e._v("This is a perfect case for a 2 of 3 multi-signature paper wallet. This way also protects the participants from having their copy of the wallet stolen. To compromise Grandma's wallet a thief would need to find and steal at least two of them.")]),e._v(" "),t("p",[e._v("Note that you as the wallet creator are still the single point of trust because you are going to generate the keys for everyone. Setups combining self generated keys from the participants is possible future work.")]),e._v(" "),t("h2",{attrs:{id:"creating-the-paper-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-the-paper-wallet"}},[e._v("#")]),e._v(" Creating the paper wallet")]),e._v(" "),t("p",[e._v("For this example the spending descriptor would be:")]),e._v(" "),t("p",[t("code",[e._v("wsh(multi(2,Grandma,Alice,Barbara))")])]),e._v(" "),t("p",[e._v("You need "),t("a",{attrs:{href:"https://www.rust-lang.org/tools/install",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust"),t("OutboundLink")],1),e._v(" installed to use "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(". The -n option below explicitly selects\ngenerating "),t("code",[e._v("testnet")]),e._v(" keys. Use "),t("code",[e._v("rusty-paper-wallet --help")]),e._v(" to see usage instructions and other\noptions.")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("cargo")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" rusty-paper-wallet\n$ rusty-paper-wallet "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"wsh(multi(2,Grandma,Alice,Barbara))"')]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-n")]),e._v(" testnet\ndata:text/html"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("base64,PCFET0N"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("..")]),e._v(".\n")])])]),t("p",[e._v("The "),t("a",{attrs:{href:"/descriptor-based-paper-wallets/data-url.txt"}},[e._v("output")]),e._v(" of the command is very long and has been shortened. The string is a "),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/Data_URI_scheme",target:"_blank",rel:"noopener noreferrer"}},[e._v("data URI scheme"),t("OutboundLink")],1),e._v(" paste-able in the address bar of a browser. By using a data URI no files are written on the hard disk, leaving less trace of secret material on the computer.\nIt's also a good idea to use incognito mode in the browser to prevent it from saving the page in the history.")]),e._v(" "),t("p",[e._v("The following is the result:")]),e._v(" "),t("iframe",{staticClass:"example",attrs:{src:"/descriptor-based-paper-wallets/Bitcoin_Paper_Wallet.html"}}),e._v(" "),t("p",[e._v("Under the hood, the command created a key pair randomly for every alias present in the descriptor, then replaced the aliases with the created keys and generated the corresponding address. This address is the same for every paper wallet and it is shown in the upper part of the paper wallet (the public part) along with the alias, linking the paper wallet to the owner.")]),e._v(" "),t("p",[e._v("The lower part is the secret part, the written part is the descriptor with the aliases, followed by a legend linking the aliases with the keys. In the legend, all the keys are public but the one of the owner which is a private WIF. The secret QR code instead contains the descriptor already with the keys.")]),e._v(" "),t("p",[e._v("The paper wallet must then be printed, and it is better to use a printer without wifi and also to be aware that some sensitive data may remain in the printer's cache.")]),e._v(" "),t("p",[e._v("Then the paper wallet must be cut along the dotted lines, the secret part should be folded twice over the black zone"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn4",id:"fnref4"}},[e._v("[4]")])]),e._v(". The black zone helps to avoid showing the secret parts in the presence of back-light. Once the folding is done the paper wallet should be plasticized to prevent being damaged by water.")]),e._v(" "),t("h2",{attrs:{id:"bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk"}},[e._v("#")]),e._v(" BDK")]),e._v(" "),t("p",[e._v("Any descriptor based wallet can be used to check the balance of and sweep the funds from\nGrandma's paper wallet. For this post we'll demonstrate using the "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" tool to do these steps.\nAnother area where "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk"),t("OutboundLink")],1),e._v(" could be used with "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" is to compile a more\ncomplicated miniscript spending policy into a descriptor, as we have done in the "),t("RouterLink",{attrs:{to:"/blog/2021/02/spending-policy-demo/#step-4-create-wallet-descriptors-for-each-participant"}},[e._v("spending policy demo")]),e._v(" post.")],1),e._v(" "),t("h2",{attrs:{id:"funding-tx"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#funding-tx"}},[e._v("#")]),e._v(" Funding tx")]),e._v(" "),t("p",[e._v("Since Grandma's wallet was created as a "),t("code",[e._v("wsh")]),e._v(" descriptor, bitcoin can be sent to it from any\nsegwit capable wallet, we'll use a public "),t("a",{attrs:{href:"https://bitcoinfaucet.uo1.net/",target:"_blank",rel:"noopener noreferrer"}},[e._v("bitcoin testnet faucet"),t("OutboundLink")],1),e._v(". Once the funds are sent the\ndeposit address "),t("code",[e._v("tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw")]),e._v(" we can also use this\naddress and a testnet explorer to "),t("a",{attrs:{href:"https://mempool.space/testnet/address/tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw",target:"_blank",rel:"noopener noreferrer"}},[e._v("confirm the funds were received"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"sweep-tx"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#sweep-tx"}},[e._v("#")]),e._v(" Sweep tx")]),e._v(" "),t("p",[e._v("Now that Grandma's paper wallet is funded it's time to demonstrate how to use "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" to sweep these\nfunds to a new address. Let's assume Grandma lost her original paper wallet and has asked\nher daughters to sweep them to a new single signature wallet so she can spend them.")]),e._v(" "),t("h3",{attrs:{id:"step-1-alice-creates-and-signs-a-psbt"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-1-alice-creates-and-signs-a-psbt"}},[e._v("#")]),e._v(" Step 1: Alice creates and signs a PSBT")]),e._v(" "),t("p",[e._v("Alice uses the private text or QR code from her paper wallet to find her private key and the\npublic keys for Grandma and Barbara. With this info she creates a PSBT to sweep Grandma's funds\nto a new address (in this example we'll send them back to our "),t("a",{attrs:{href:"https://bitcoinfaucet.uo1.net/",target:"_blank",rel:"noopener noreferrer"}},[e._v("bitcoin testnet faucet"),t("OutboundLink")],1),e._v("). Notice how Alice\nincludes her wallet's descriptor checksum '#em3q73l5', this "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md#checksums",target:"_blank",rel:"noopener noreferrer"}},[e._v("guarantees"),t("OutboundLink")],1),e._v(" she has entered her descriptor correctly.")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("SWEEP_TO_ADDR")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2\n\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_WIF")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("cSSKRHDmQEEutp5LD14tAcixu2ehSNPDTqNek1zMa9Pet98qxHq3\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("BARBARA_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("02a3f3f2658b9812ddeabfbde2fde03f8a65369e4ed621f29fa8ba0cc519b789fb\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("GRANDMA_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("03f1bd2bff8e9c61f58a8d46d18fd8f3149b1f2d76b3c423a7874a5d5811d67cee\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_DESCRIPTOR")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"wsh(multi(2,'),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$GRANDMA_PUBKEY")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_WIF")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_PUBKEY")]),e._v('))#em3q73l5"')]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# confirm descriptor creates the expected deposit address")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_DESCRIPTOR")]),e._v(" get_new_address\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"address"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw"')]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# sync the wallet and show the balance")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_DESCRIPTOR")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("sync")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_DESCRIPTOR")]),e._v(" get_balance\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"satoshi"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("10000")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# create and sign PSBT")]),e._v("\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("UNSIGNED_PSBT")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token variable"}},[t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$(")]),e._v("bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" $ALICE_DESCRIPTOR create_tx "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--send_all")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--to")]),e._v(" $SWEEP_TO_ADDR:0 "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("|")]),e._v(" jq "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-r")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('".psbt"')]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v(")")])]),e._v("\n\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_SIGNED_PSBT")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token variable"}},[t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$(")]),e._v("bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" alice "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" $ALICE_DESCRIPTOR sign "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--psbt")]),e._v(" $UNSIGNED_PSBT "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("|")]),e._v(" jq "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-r")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('".psbt"')]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v(")")])]),e._v("\n")])])]),t("h3",{attrs:{id:"step-2-barbara-signs-alices-signed-psbt-and-broadcasts-the-tx"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-2-barbara-signs-alices-signed-psbt-and-broadcasts-the-tx"}},[e._v("#")]),e._v(" Step 2: Barbara signs Alice's signed PSBT and broadcasts the tx")]),e._v(" "),t("p",[e._v("Now it's Barbara's turn to use the private text or QR code from her paper wallet to get her private\nkey and the public keys for Grandma and Alice. With this info plus Alice's signed PSBT she can\ncreate a fully signed PSBT to broadcast and complete the sweep of Grandma's funds.")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[e._v("$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("ALICE_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("02e486e32f0f87136fa042cb53219ace8537ea1d036deb2f4293570b94325d11cb\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("BARBARA_WIF")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("cSfMLzSZ9NjWUTqL3sFpgWJssnu2qgmE2cm5N1jPDRRJuDcrsPEB\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("GRANDMA_PUBKEY")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("03f1bd2bff8e9c61f58a8d46d18fd8f3149b1f2d76b3c423a7874a5d5811d67cee\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("BARBARA_DESCRIPTOR")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"wsh(multi(2,'),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$GRANDMA_PUBKEY")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$ALICE_PUBKEY")]),e._v(","),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_WIF")]),e._v('))#nxfa5n0z"')]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# confirm descriptor creates the expected deposit address")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" get_new_address\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"address"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"tb1qu6lcua9w2zkarjj5xwxh3l3qtcxh84hsra3jrvpszh69j2e54x7q3thycw"')]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# sync the wallet and show the balance")]),e._v("\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("sync")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" get_balance\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"satoshi"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("10000")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n$ "),t("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("FINAL_PSBT")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token variable"}},[t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$(")]),e._v("bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" $BARBARA_DESCRIPTOR sign "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--psbt")]),e._v(" $ALICE_SIGNED_PSBT "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("|")]),e._v(" jq "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-r")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('".psbt"')]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v(")")])]),e._v("\n\n$ bdk-cli wallet "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-w")]),e._v(" barbara "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-d")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$BARBARA_DESCRIPTOR")]),e._v(" broadcast "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--psbt")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$FINAL_PSBT")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"txid"')]),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[e._v(":")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[e._v('"9ecd8e6be92b7edd8bf1799f8f7090e58f813825f826bdb771b4cdb444cdeb59"')]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("And finally we verify that Alice and Barbara successfully created and broadcast Grandma's "),t("a",{attrs:{href:"https://mempool.space/testnet/tx/9ecd8e6be92b7edd8bf1799f8f7090e58f813825f826bdb771b4cdb444cdeb59",target:"_blank",rel:"noopener noreferrer"}},[e._v("sweep tx"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"conclusion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),t("p",[e._v("In this post we showed how to create a multi-sig descriptor based paper wallet using\n"),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" and then sweep the funds from our example paper wallet to a new address. If you\nfound this post interesting please comment below. Or give it a try yourself and if you run into any\nproblems or would like to suggest improvements leave an issue in the "),t("a",{attrs:{href:"https://github.com/RCasatta/rusty-paper-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("Rusty Paper Wallet"),t("OutboundLink")],1),e._v(" or\n"),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-cli"),t("OutboundLink")],1),e._v(" github repos. Thanks!")]),e._v(" "),t("hr",{staticClass:"footnotes-sep"}),e._v(" "),t("section",{staticClass:"footnotes"},[t("ol",{staticClass:"footnotes-list"},[t("li",{staticClass:"footnote-item",attrs:{id:"fn1"}},[t("p",[e._v("Wallet Input Format, a string encoding a ECDSA private key https://en.bitcoin.it/wiki/Wallet_import_format "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn2"}},[t("p",[e._v("Unless the user import the WIF directly into bitcoin core "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref2"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn3"}},[t("p",[e._v("Some wallets refers to sweep as the action to create a transaction taking all the funds from the paper wallet and sending those to the wallet itself. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref3"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn4"}},[t("p",[e._v("Ideally, the black zone should be twice as long as the secret part to cover it back and front, long descriptor may leave a shorter black zone, ensure to have you printer set with vertical layout for best results. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref4"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/55.9de99d10.js b/assets/js/55.7f46b555.js similarity index 99% rename from assets/js/55.9de99d10.js rename to assets/js/55.7f46b555.js index cd8e65fb97..da7aead320 100644 --- a/assets/js/55.9de99d10.js +++ b/assets/js/55.7f46b555.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[55],{410:function(e,t,r){"use strict";r.r(t);var a=r(7),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("I have tried to setup a 2 of 2 multi signature infrastructure with two\ndifferent wallets, which know nothing about each other, but are compliant with\ntwo very important protocols: "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("Partially Signed\nBitcoin Transactions"),t("OutboundLink")],1),e._v(" described in BIP 174.")]),e._v(" "),t("p",[e._v("Before these two protocols came into existence, making a multi signature setup\nand spending from it was possible only if the involved parties were using the\nsame wallet (eg. Electrum Desktop Wallet). This limitation was due to the fact\nthat the two parties had to agree:")]),e._v(" "),t("ul",[t("li",[e._v("on the particular type of script and address to use")]),e._v(" "),t("li",[e._v("on the way the transaction would be shared composed and signed with all the\ninvolved parties.")])]),e._v(" "),t("p",[t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(" are a way to express which kind scriptPubKey and\naddresses to produce with a key or a series of keys.")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("PSBT"),t("OutboundLink")],1),e._v(" is instead the standard protocol used to create a transaction and to enrich\nit with the necessary signatures and other components, to make it valid and complete.")]),e._v(" "),t("p",[e._v("Together they provide a common ground to create and use a multi signature\ninfrastructure in a heterogeneous environment, and this is what I have put\nto test.")]),e._v(" "),t("h2",{attrs:{id:"the-use-case"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-use-case"}},[e._v("#")]),e._v(" The use case")]),e._v(" "),t("p",[e._v("Imagine Alice and Bob owning a company and being willing to put the corporate cash\nin a 2of2 multi signature setup, so that each one of them have to agree and sign each\ntransaction.")]),e._v(" "),t("h2",{attrs:{id:"the-role-of-descriptors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-role-of-descriptors"}},[e._v("#")]),e._v(" The role of Descriptors")]),e._v(" "),t("p",[e._v("If Alice and Bob cannot agree on the software to use, to monitor the same financial\nsituation, the two software must control and produce exactly the same series\nof multisignature addresses.")]),e._v(" "),t("p",[e._v("To make two different software produce the same addresses in a deterministic way\nwe must ensure that they:")]),e._v(" "),t("ul",[t("li",[e._v("produce the same pair of public keys")]),e._v(" "),t("li",[e._v("combine them in the same order")]),e._v(" "),t("li",[e._v("put them inside the same scriptPubKey to produce the same address")])]),e._v(" "),t("p",[e._v("Here is where the "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(" come into play. They describe:")]),e._v(" "),t("ul",[t("li",[e._v("the sequence of public keys each extended key (xpub) will produce")]),e._v(" "),t("li",[e._v("the sequence in which the new public keys of various parties will enter into\nthe script")]),e._v(" "),t("li",[e._v("the type of script the wallet will prepare with that group keys and so the type\nof address the group of keys will produce.")])]),e._v(" "),t("p",[t("strong",[e._v("By sharing the same Descriptor, every compliant wallet will derive\ndeterministically the same series of multisig addresses")]),e._v(".")]),e._v(" "),t("p",[e._v("Imagine Alice using Bitcoin Core (from now on "),t("a",{attrs:{href:"https://bitcoincore.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v('"Core"'),t("OutboundLink")],1),e._v(') as a\nWallet and Bob using a "Last generation" wallet, Bitcoin Development Kit\n(from now on '),t("a",{attrs:{href:"https://bitcoindevkit.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v('"BDK"'),t("OutboundLink")],1),e._v("), which uses descriptors and miniscript natively.")]),e._v(" "),t("p",[e._v("Each of these two software wallets should be able to:")]),e._v(" "),t("ul",[t("li",[e._v("Create a new address which is seen as belonging to the multi signature\nwallet in both software")]),e._v(" "),t("li",[e._v("Express the consent of each party by partially signing the transaction in a way\nthe other wallet can understand and complete it with its own signature.")])]),e._v(" "),t("p",[e._v("The infrastructure of multiple Extended keys combined toghether to produce\nmultiple multisignature addresses is often referred as\n"),t("em",[t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[e._v("Hierarchical Deterministic"),t("OutboundLink")],1),e._v(" multi signature wallet or HDM")]),e._v(".")]),e._v(" "),t("p",[e._v("What follows are the steps to create the HDM usable both in Core and\nin BDK.")]),e._v(" "),t("p",[t("em",[e._v("Note: In Core, "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/pull/16528",target:"_blank",rel:"noopener noreferrer"}},[e._v("Descriptor wallets"),t("OutboundLink")],1),e._v(" are still experimental and in general,\nboth wallets should be tested for descriptor capabilities only in testnet.")])]),e._v(" "),t("h2",{attrs:{id:"our-playground"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#our-playground"}},[e._v("#")]),e._v(" Our playground")]),e._v(" "),t("p",[e._v("We will build a 2of2 key set up that will be used cooperatively by Bitcoin Core\nand Bitcoin Development Kit.\nThe steps Alice and Bob will do are:")]),e._v(" "),t("ol",[t("li",[e._v("creation of the seed and the derived Extended Master Public and send it to\nthe other party")]),e._v(" "),t("li",[e._v("Create the multi signature descriptor for each wallet")]),e._v(" "),t("li",[e._v("Use each other's software to receive testnet coins from a faucet")]),e._v(" "),t("li",[e._v("return part of the coins to the faucet signing the transaction with both\nwallets.")])]),e._v(" "),t("p",[e._v("We need:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://bitcoindevkit.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Dev Kit"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://bitcoincore.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Core"),t("OutboundLink")],1),e._v(" (v0.21.0 or later)")])]),e._v(" "),t("h3",{attrs:{id:"1-creating-the-seeds-and-the-derived-extended-public-keys"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#1-creating-the-seeds-and-the-derived-extended-public-keys"}},[e._v("#")]),e._v(" 1. Creating the seeds and the derived Extended Public keys")]),e._v(" "),t("h4",{attrs:{id:"seeds-and-extended-master-public"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#seeds-and-extended-master-public"}},[e._v("#")]),e._v(" Seeds and Extended Master Public")]),e._v(" "),t("p",[e._v("We build an Extended Private Master Key for both wallet and derive a BIP84\nExtended Master Public for Bitcoin Core and then for BDK.")]),e._v(" "),t("p",[e._v("For Bitcoin Core (Alice):")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("# new Extended wallet data\nexport core_key=$(bdk-cli key generate)\n\n# New Extended Master Private\n\nexport core_xprv=$(echo $core_key | jq -r '.xprv')\n\n# Now I derive the xpubs (one for receiving and one for the change)\n# together with informations about the derivation path to be communicated\n# to BDK wallet's owner (Bob).\n\nexport core_xpub_84_for_rec_desc=$(bdk-cli key derive --path m/84h/0h/0h/0 --xprv $core_xprv | jq -r '.xpub')\nexport core_xpub_84_for_chg_desc=$(bdk-cli key derive --path m/84h/0h/0h/1 --xprv $core_xprv | jq -r '.xpub')\n")])])]),t("p",[e._v("For BDK (Bob) we do the same:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("# new Extended wallet data\n\nexport BDK_key=$(bdk-cli key generate)\n\n# New Extended Master Private\n\nexport BDK_xprv=$(echo $BDK_key | jq -r '.xprv')\n\n# Now I build the derived xpubs to be communicated (to Alice).\n\nexport BDK_xpub_84_for_rec_desc=$(bdk-cli key derive --path m/84h/0h/0h/0 --xprv $BDK_xprv | jq -r '.xpub')\nexport BDK_xpub_84_for_chg_desc=$(bdk-cli key derive --path m/84h/0h/0h/1 --xprv $BDK_xprv | jq -r '.xpub')\n")])])]),t("h3",{attrs:{id:"2-creation-of-the-multi-signature-descriptor-for-each-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#2-creation-of-the-multi-signature-descriptor-for-each-wallet"}},[e._v("#")]),e._v(" 2. Creation of the multi signature descriptor for each wallet")]),e._v(" "),t("p",[e._v("To build a multisig wallet, each wallet owner must compose the descriptor\nadding:")]),e._v(" "),t("ul",[t("li",[e._v("his derived extended "),t("strong",[e._v("private")]),e._v(" key AND")]),e._v(" "),t("li",[e._v("all the extended "),t("strong",[e._v("public")]),e._v(" keys of the other wallets involved in the\nmulti signature setup")])]),e._v(" "),t("p",[t("em",[e._v("The different nature of the two keys (one is private and one is public) is\ndue to the fact that each wallet, to be able to partially sign the transaction,\n"),t("strong",[e._v("must manage the private key of the wallet's owner")])]),e._v(" AND have the other\nparty's public key. Otherwise, if we put both public keys, we would obtain\na watch-only wallet unable to sign the transactions. If we\nhad both extended private keys inside the descriptor, we would allow each party\nto finalize the transactions autonomously.")]),e._v(" "),t("h4",{attrs:{id:"in-bitcoin-core"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#in-bitcoin-core"}},[e._v("#")]),e._v(" In Bitcoin Core:")]),e._v(" "),t("p",[e._v("In our case, the multi signature descriptor for Bitcoin Core will be composed\nwith:")]),e._v(" "),t("ul",[t("li",[e._v("The BIP84 derived Extended "),t("strong",[e._v("Public")]),e._v(" Key from BDK")]),e._v(" "),t("li",[e._v("The BIP84 derived Extended "),t("strong",[e._v("Private")]),e._v(" Key from Core.")])]),e._v(" "),t("p",[e._v("BDK wallet's owner will send to Core's owner the derived xpub for this purpose.\nThis is how the Core's multisig descriptor will be created and put into an\nenvironment variable:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export core_rec_desc=\"wsh(multi(2,$BDK_xpub_84_for_rec_desc,$core_xprv/84'/0'/0'/0/*))\"\n")])])]),t("p",[e._v("Where of course "),t("code",[e._v("$BDK_xpub_84_for_rec_desc")]),e._v("is the derived master public created\nin BDK and received by Core's owner.")]),e._v(" "),t("p",[e._v("The meaning of what is before and after is illustrated in the doc that explain\nthe use of "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors in Bitcoin Core"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("We add the necessary checksum using the specific "),t("code",[e._v("bitcoin-cli")]),e._v(" call.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export core_rec_desc_chksum=$core_rec_desc#$(bitcoin-cli -testnet getdescriptorinfo $core_rec_desc | jq -r '.checksum')\n")])])]),t("p",[e._v("We repeat the same to build the descriptor to receive the change.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export core_chg_desc=\"wsh(multi(2,$BDK_xpub_84_for_chg_desc,$core_xprv/84'/0'/0'/1/*))\"\nexport core_chg_desc_chksum=$core_chg_desc#$(bitcoin-cli -testnet getdescriptorinfo $core_chg_desc|jq -r '.checksum')\n")])])]),t("h4",{attrs:{id:"in-bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#in-bdk"}},[e._v("#")]),e._v(" In BDK:")]),e._v(" "),t("p",[e._v("For BDK we set the derivation for receiving addresses and change addresses\nin the command line (maybe setting an alias)")]),e._v(" "),t("p",[e._v("Building the descriptor:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export BDK_rec_desc=\"wsh(multi(2,$BDK_xprv/84'/0'/0'/0/*,$core_xpub_84_for_rec_desc))\"`\n")])])]),t("p",[e._v("Please note that the order of the extended key in the descriptor MUST be the\nsame in the 2 wallets.")]),e._v(" "),t("p",[t("em",[e._v("We have chosen to put BDK first and in each software wallet, the public key\nderived from BDK will always come first. In alternative, we could have chosen to\nproduce the descriptor, "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/pull/17056?ref=tokendaily",target:"_blank",rel:"noopener noreferrer"}},[e._v("chosing a "),t("code",[e._v("soretedmulti")]),e._v(" multisignature setup"),t("OutboundLink")],1)]),e._v(".")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export BDK_rec_desc_chksum=$BDK_rec_desc#$(bitcoin-cli -testnet getdescriptorinfo $BDK_rec_desc | jq -r '.checksum')\nexport BDK_chg_desc=\"wsh(multi(2,$BDK_xprv/84'/0'/0'/1/*,$core_xpub_84_for_chg_desc))\"\nexport BDK_chg_desc_chksum=$BDK_chg_desc#$(bitcoin-cli -testnet getdescriptorinfo $BDK_chg_desc | jq -r '.checksum')\n")])])]),t("p",[e._v("To take a look at the variables we have produced so far:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("env | grep 'core_'\nenv | grep 'BDK_'\n")])])]),t("p",[e._v("Now we will use the multisig descriptor wallet to receive testnet coins with\nAlice and Bob's software")]),e._v(" "),t("h3",{attrs:{id:"3-use-each-others-software-to-receive-testnet-coins-from-a-faucet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#3-use-each-others-software-to-receive-testnet-coins-from-a-faucet"}},[e._v("#")]),e._v(" 3. Use each other's software to receive testnet coins from a faucet")]),e._v(" "),t("h4",{attrs:{id:"in-bitcoin-core-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#in-bitcoin-core-2"}},[e._v("#")]),e._v(" In Bitcoin Core")]),e._v(" "),t("p",[e._v('Alice must create an empty, experimental new "descriptors wallet" in Core and\nto import the multisig Output Descriptor.')]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('bitcoin-cli -testnet createwallet "multisig2of2withBDK" false true "" false true false\n')])])]),t("p",[e._v("The flag are to:")]),e._v(" "),t("ul",[t("li",[e._v("use the private keys")]),e._v(" "),t("li",[e._v("make it empty")]),e._v(" "),t("li",[e._v("no password provided to the wallet")]),e._v(" "),t("li",[e._v("reusing of addresses not allowed")]),e._v(" "),t("li",[e._v('"new experimental descriptors wallet"')]),e._v(" "),t("li",[e._v("don't load it on start up")])]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK importdescriptors "[{\\"desc\\":\\"$core_rec_desc_chksum\\",\\"timestamp\\":\\"now\\",\\"active\\":true,\\"internal\\":false},{\\"desc\\":\\"$core_chg_desc_chksum\\",\\"timestamp\\":\\"now\\",\\"active\\":true,\\"internal\\":true}]"\n')])])]),t("p",[e._v("Now Alice asks for her first receiving multisignature address.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export first_address=$(bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK getnewaddress)\necho $first_address\n")])])]),t("h4",{attrs:{id:"bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk"}},[e._v("#")]),e._v(" BDK")]),e._v(" "),t("p",[e._v("In BDK Bob can specify directly the descriptors on the command line to produce\nthe multisig address, because BDK is descriptors aware natively.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint get_new_address`\n')])])]),t("p",[e._v('Et voilà: if we have done everything correctly, the newly created address in\nCore is the same of the newly created address in BDK. this is part of the\n"miracle" of descriptors\' interoperability.')]),e._v(" "),t("h4",{attrs:{id:"we-ask-for-testnet-coins-giving-the-first-created-address"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#we-ask-for-testnet-coins-giving-the-first-created-address"}},[e._v("#")]),e._v(" We ask for testnet coins giving the first created address.")]),e._v(" "),t("p",[e._v('To find testnet coins for free, you can just google "testnet faucet" and you\nshould find some satoshis to play with. Just give to the site your first\ngenerated address and, in twenty minutes, you will find the satoshis in\nyour balance both in Core and in BDK.')]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('# to check it in Core:\n\nbitcoin-cli -testnet -rpcwallet=multisig2of2withBDK getbalance\n\n# In BDK:\n\n# Sync with the blockchain\nrepl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint sync\n# Get the balance\nrepl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint get_balance\n')])])]),t("p",[e._v("Some testnet faucets have an address to send back the unused satoshi after\nthe use. Take note of that because we will use it in the next step.")]),e._v(" "),t("h3",{attrs:{id:"4-we-return-part-of-the-satoshis-received-back-to-the-faucet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#4-we-return-part-of-the-satoshis-received-back-to-the-faucet"}},[e._v("#")]),e._v(" 4. we return part of the satoshis received back to the faucet")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('export psbt=$(bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK walletcreatefundedpsbt "[]" "[{\\"tb1qrcesfj9f2d7x40xs6ztnlrcgxhh6vsw8658hjdhdy6qgkf6nfrds9rp79a\\":0.000012}]" | jq -r \'.psbt\')\n\nexport psbt=$(bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK walletprocesspsbt $psbt | jq -r \'.psbt\')\n{\n "psbt": "cHNidP8BAIkCAAAAATj90EC+NAuXj7y6SseZJucoJM6sGnUcVm9koTveZECTAAAAAAD+////AmACAAAAAAAAIgAg98ol9j4AalD71E0mV5QV0uM6/vCT+pi2twxr/zrvLROwBAAAAAAAACIAIB4zBMipU3xqvNDQlz+PCDXvpkHH1Q95Nu0mgIsnU0jbAAAAAAABAIkCAAAAAQS+ObgGG6UwtvaO3KYph2E3/ws7Q83RbmR3rxC0fKYSAQAAAAD+////AtAHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNDAHQAAAAAAACIAIBQpiDTgPIMt0ld8cmuYqlY+EIPjvrmMqZruDhs61hQNAAAAAAEBK9AHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNAiAgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAAQEFR1IhArn3tec7n7318rnWqf0dIIwtLtfxo6Zt0HV70UvZYaWvIQNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfVKuIgYCufe15zufvfXyudap/R0gjC0u1/Gjpm3QdXvRS9lhpa8YNEw2cFQAAIAAAACAAAAAgAAAAAAAAAAAIgYDbdI+wHtIgO6pS6Ja7jai1pDwPeidKoDCytTO1jhjAH0YO/laXFQAAIAAAACAAAAAgAAAAAAAAAAAAAEBR1IhAqccvA3rL13D1K4GeWjcahDsO3P8oaVNBttk4MlCKXIcIQLHKhjmPuCQjyS77ZfaMN2tdgNKcf/+57VXGZhz/UWTl1KuIgICpxy8DesvXcPUrgZ5aNxqEOw7c/yhpU0G22TgyUIpchwYNEw2cFQAAIAAAACAAAAAgAEAAAADAAAAIgICxyoY5j7gkI8ku+2X2jDdrXYDSnH//ue1VxmYc/1Fk5cYO/laXFQAAIAAAACAAAAAgAEAAAADAAAAAAA=",\n "complete": false\n}\n')])])]),t("p",[e._v("Exactly! Note the "),t("code",[e._v('"complete": false')]),e._v(". We have processed the transaction with\nCore but we miss one of the necessary key of the multisig 2of2 setup (The one\ncontained inside BDK).")]),e._v(" "),t("p",[t("code",[e._v("tb1qrcesfj9f2d7x40xs6ztnlrcgxhh6vsw8658hjdhdy6qgkf6nfrds9rp79a")]),e._v(" is the address\nwe got from the faucet site to return the satoshis.")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("PSBT"),t("OutboundLink")],1),e._v(" is sent over to the BDK wallet owner who tries to sign the\ntransaction:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint sign --psbt $psbt\n{\n "is_finalized": true,\n "psbt": "cHNidP8BAIkCAAAAATj90EC+NAuXj7y6SseZJucoJM6sGnUcVm9koTveZECTAAAAAAD+////AmACAAAAAAAAIgAg98ol9j4AalD71E0mV5QV0uM6/vCT+pi2twxr/zrvLROwBAAAAAAAACIAIB4zBMipU3xqvNDQlz+PCDXvpkHH1Q95Nu0mgIsnU0jbAAAAAAABAIkCAAAAAQS+ObgGG6UwtvaO3KYph2E3/ws7Q83RbmR3rxC0fKYSAQAAAAD+////AtAHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNDAHQAAAAAAACIAIBQpiDTgPIMt0ld8cmuYqlY+EIPjvrmMqZruDhs61hQNAAAAAAEBK9AHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNAiAgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAASICArn3tec7n7318rnWqf0dIIwtLtfxo6Zt0HV70UvZYaWvRzBEAiBkVDLgVEwvENnLx+04o7gGpGjFDBwAXTJmf8Yvo35oygIgbuBkHsvPC9jmZcMZ9P+Pwp01yxSaWo+5feyPmd3ai1kBAQVHUiECufe15zufvfXyudap/R0gjC0u1/Gjpm3QdXvRS9lhpa8hA23SPsB7SIDuqUuiWu42otaQ8D3onSqAwsrUztY4YwB9Uq4iBgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfRg7+VpcVAAAgAAAAIAAAACAAAAAAAAAAAAiBgK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlrxg0TDZwVAAAgAAAAIAAAACAAAAAAAAAAAABBwABCNoEAEcwRAIgZFQy4FRMLxDZy8ftOKO4BqRoxQwcAF0yZn/GL6N+aMoCIG7gZB7LzwvY5mXDGfT/j8KdNcsUmlqPuX3sj5nd2otZAUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAAUdSIQK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlryEDbdI+wHtIgO6pS6Ja7jai1pDwPeidKoDCytTO1jhjAH1SrgABAUdSIQKnHLwN6y9dw9SuBnlo3GoQ7Dtz/KGlTQbbZODJQilyHCECxyoY5j7gkI8ku+2X2jDdrXYDSnH//ue1VxmYc/1Fk5dSriICAqccvA3rL13D1K4GeWjcahDsO3P8oaVNBttk4MlCKXIcGDRMNnBUAACAAAAAgAAAAIABAAAAAwAAACICAscqGOY+4JCPJLvtl9ow3a12A0px//7ntVcZmHP9RZOXGDv5WlxUAACAAAAAgAAAAIABAAAAAwAAAAAA"\n}\n')])])]),t("p",[e._v('The signature has succeded (note the "is_finalized": true,) and now we can\nbroadcast the transction.')]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint broadcast --psbt "cHNidP8BAIkCAAAAATj90EC+NAuXj7y6SseZJucoJM6sGnUcVm9koTveZECTAAAAAAD+////AmACAAAAAAAAIgAg98ol9j4AalD71E0mV5QV0uM6/vCT+pi2twxr/zrvLROwBAAAAAAAACIAIB4zBMipU3xqvNDQlz+PCDXvpkHH1Q95Nu0mgIsnU0jbAAAAAAABAIkCAAAAAQS+ObgGG6UwtvaO3KYph2E3/ws7Q83RbmR3rxC0fKYSAQAAAAD+////AtAHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNDAHQAAAAAAACIAIBQpiDTgPIMt0ld8cmuYqlY+EIPjvrmMqZruDhs61hQNAAAAAAEBK9AHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNAiAgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAASICArn3tec7n7318rnWqf0dIIwtLtfxo6Zt0HV70UvZYaWvRzBEAiBkVDLgVEwvENnLx+04o7gGpGjFDBwAXTJmf8Yvo35oygIgbuBkHsvPC9jmZcMZ9P+Pwp01yxSaWo+5feyPmd3ai1kBAQVHUiECufe15zufvfXyudap/R0gjC0u1/Gjpm3QdXvRS9lhpa8hA23SPsB7SIDuqUuiWu42otaQ8D3onSqAwsrUztY4YwB9Uq4iBgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfRg7+VpcVAAAgAAAAIAAAACAAAAAAAAAAAAiBgK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlrxg0TDZwVAAAgAAAAIAAAACAAAAAAAAAAAABBwABCNoEAEcwRAIgZFQy4FRMLxDZy8ftOKO4BqRoxQwcAF0yZn/GL6N+aMoCIG7gZB7LzwvY5mXDGfT/j8KdNcsUmlqPuX3sj5nd2otZAUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAAUdSIQK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlryEDbdI+wHtIgO6pS6Ja7jai1pDwPeidKoDCytTO1jhjAH1SrgABAUdSIQKnHLwN6y9dw9SuBnlo3GoQ7Dtz/KGlTQbbZODJQilyHCECxyoY5j7gkI8ku+2X2jDdrXYDSnH//ue1VxmYc/1Fk5dSriICAqccvA3rL13D1K4GeWjcahDsO3P8oaVNBttk4MlCKXIcGDRMNnBUAACAAAAAgAAAAIABAAAAAwAAACICAscqGOY+4JCPJLvtl9ow3a12A0px//7ntVcZmHP9RZOXGDv5WlxUAACAAAAAgAAAAIABAAAAAwAAAAAA"\n{\n "txid": "a0b082e3b0579822d4a0b0fa95a4c4662f6b128ffd43fdcfe53c37473ce85dee"\n}\n')])])]),t("h2",{attrs:{id:"conclusion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),t("p",[e._v("We have built an HDM and we have used it with two indipendent wallets, which\nare compatible with "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("BIP 174"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(". Hopefully we\nwill see many other compatible wallets beyound "),t("a",{attrs:{href:"https://bitcoincore.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Core"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://bitcoindevkit.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("BDK"),t("OutboundLink")],1),e._v(",\nwith which we will be able to easily set up multi signature schemes.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[55],{411:function(e,t,r){"use strict";r.r(t);var a=r(7),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("I have tried to setup a 2 of 2 multi signature infrastructure with two\ndifferent wallets, which know nothing about each other, but are compliant with\ntwo very important protocols: "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("Partially Signed\nBitcoin Transactions"),t("OutboundLink")],1),e._v(" described in BIP 174.")]),e._v(" "),t("p",[e._v("Before these two protocols came into existence, making a multi signature setup\nand spending from it was possible only if the involved parties were using the\nsame wallet (eg. Electrum Desktop Wallet). This limitation was due to the fact\nthat the two parties had to agree:")]),e._v(" "),t("ul",[t("li",[e._v("on the particular type of script and address to use")]),e._v(" "),t("li",[e._v("on the way the transaction would be shared composed and signed with all the\ninvolved parties.")])]),e._v(" "),t("p",[t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(" are a way to express which kind scriptPubKey and\naddresses to produce with a key or a series of keys.")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("PSBT"),t("OutboundLink")],1),e._v(" is instead the standard protocol used to create a transaction and to enrich\nit with the necessary signatures and other components, to make it valid and complete.")]),e._v(" "),t("p",[e._v("Together they provide a common ground to create and use a multi signature\ninfrastructure in a heterogeneous environment, and this is what I have put\nto test.")]),e._v(" "),t("h2",{attrs:{id:"the-use-case"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-use-case"}},[e._v("#")]),e._v(" The use case")]),e._v(" "),t("p",[e._v("Imagine Alice and Bob owning a company and being willing to put the corporate cash\nin a 2of2 multi signature setup, so that each one of them have to agree and sign each\ntransaction.")]),e._v(" "),t("h2",{attrs:{id:"the-role-of-descriptors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-role-of-descriptors"}},[e._v("#")]),e._v(" The role of Descriptors")]),e._v(" "),t("p",[e._v("If Alice and Bob cannot agree on the software to use, to monitor the same financial\nsituation, the two software must control and produce exactly the same series\nof multisignature addresses.")]),e._v(" "),t("p",[e._v("To make two different software produce the same addresses in a deterministic way\nwe must ensure that they:")]),e._v(" "),t("ul",[t("li",[e._v("produce the same pair of public keys")]),e._v(" "),t("li",[e._v("combine them in the same order")]),e._v(" "),t("li",[e._v("put them inside the same scriptPubKey to produce the same address")])]),e._v(" "),t("p",[e._v("Here is where the "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(" come into play. They describe:")]),e._v(" "),t("ul",[t("li",[e._v("the sequence of public keys each extended key (xpub) will produce")]),e._v(" "),t("li",[e._v("the sequence in which the new public keys of various parties will enter into\nthe script")]),e._v(" "),t("li",[e._v("the type of script the wallet will prepare with that group keys and so the type\nof address the group of keys will produce.")])]),e._v(" "),t("p",[t("strong",[e._v("By sharing the same Descriptor, every compliant wallet will derive\ndeterministically the same series of multisig addresses")]),e._v(".")]),e._v(" "),t("p",[e._v("Imagine Alice using Bitcoin Core (from now on "),t("a",{attrs:{href:"https://bitcoincore.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v('"Core"'),t("OutboundLink")],1),e._v(') as a\nWallet and Bob using a "Last generation" wallet, Bitcoin Development Kit\n(from now on '),t("a",{attrs:{href:"https://bitcoindevkit.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v('"BDK"'),t("OutboundLink")],1),e._v("), which uses descriptors and miniscript natively.")]),e._v(" "),t("p",[e._v("Each of these two software wallets should be able to:")]),e._v(" "),t("ul",[t("li",[e._v("Create a new address which is seen as belonging to the multi signature\nwallet in both software")]),e._v(" "),t("li",[e._v("Express the consent of each party by partially signing the transaction in a way\nthe other wallet can understand and complete it with its own signature.")])]),e._v(" "),t("p",[e._v("The infrastructure of multiple Extended keys combined toghether to produce\nmultiple multisignature addresses is often referred as\n"),t("em",[t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[e._v("Hierarchical Deterministic"),t("OutboundLink")],1),e._v(" multi signature wallet or HDM")]),e._v(".")]),e._v(" "),t("p",[e._v("What follows are the steps to create the HDM usable both in Core and\nin BDK.")]),e._v(" "),t("p",[t("em",[e._v("Note: In Core, "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/pull/16528",target:"_blank",rel:"noopener noreferrer"}},[e._v("Descriptor wallets"),t("OutboundLink")],1),e._v(" are still experimental and in general,\nboth wallets should be tested for descriptor capabilities only in testnet.")])]),e._v(" "),t("h2",{attrs:{id:"our-playground"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#our-playground"}},[e._v("#")]),e._v(" Our playground")]),e._v(" "),t("p",[e._v("We will build a 2of2 key set up that will be used cooperatively by Bitcoin Core\nand Bitcoin Development Kit.\nThe steps Alice and Bob will do are:")]),e._v(" "),t("ol",[t("li",[e._v("creation of the seed and the derived Extended Master Public and send it to\nthe other party")]),e._v(" "),t("li",[e._v("Create the multi signature descriptor for each wallet")]),e._v(" "),t("li",[e._v("Use each other's software to receive testnet coins from a faucet")]),e._v(" "),t("li",[e._v("return part of the coins to the faucet signing the transaction with both\nwallets.")])]),e._v(" "),t("p",[e._v("We need:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://bitcoindevkit.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Dev Kit"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://bitcoincore.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Core"),t("OutboundLink")],1),e._v(" (v0.21.0 or later)")])]),e._v(" "),t("h3",{attrs:{id:"1-creating-the-seeds-and-the-derived-extended-public-keys"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#1-creating-the-seeds-and-the-derived-extended-public-keys"}},[e._v("#")]),e._v(" 1. Creating the seeds and the derived Extended Public keys")]),e._v(" "),t("h4",{attrs:{id:"seeds-and-extended-master-public"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#seeds-and-extended-master-public"}},[e._v("#")]),e._v(" Seeds and Extended Master Public")]),e._v(" "),t("p",[e._v("We build an Extended Private Master Key for both wallet and derive a BIP84\nExtended Master Public for Bitcoin Core and then for BDK.")]),e._v(" "),t("p",[e._v("For Bitcoin Core (Alice):")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("# new Extended wallet data\nexport core_key=$(bdk-cli key generate)\n\n# New Extended Master Private\n\nexport core_xprv=$(echo $core_key | jq -r '.xprv')\n\n# Now I derive the xpubs (one for receiving and one for the change)\n# together with informations about the derivation path to be communicated\n# to BDK wallet's owner (Bob).\n\nexport core_xpub_84_for_rec_desc=$(bdk-cli key derive --path m/84h/0h/0h/0 --xprv $core_xprv | jq -r '.xpub')\nexport core_xpub_84_for_chg_desc=$(bdk-cli key derive --path m/84h/0h/0h/1 --xprv $core_xprv | jq -r '.xpub')\n")])])]),t("p",[e._v("For BDK (Bob) we do the same:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("# new Extended wallet data\n\nexport BDK_key=$(bdk-cli key generate)\n\n# New Extended Master Private\n\nexport BDK_xprv=$(echo $BDK_key | jq -r '.xprv')\n\n# Now I build the derived xpubs to be communicated (to Alice).\n\nexport BDK_xpub_84_for_rec_desc=$(bdk-cli key derive --path m/84h/0h/0h/0 --xprv $BDK_xprv | jq -r '.xpub')\nexport BDK_xpub_84_for_chg_desc=$(bdk-cli key derive --path m/84h/0h/0h/1 --xprv $BDK_xprv | jq -r '.xpub')\n")])])]),t("h3",{attrs:{id:"2-creation-of-the-multi-signature-descriptor-for-each-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#2-creation-of-the-multi-signature-descriptor-for-each-wallet"}},[e._v("#")]),e._v(" 2. Creation of the multi signature descriptor for each wallet")]),e._v(" "),t("p",[e._v("To build a multisig wallet, each wallet owner must compose the descriptor\nadding:")]),e._v(" "),t("ul",[t("li",[e._v("his derived extended "),t("strong",[e._v("private")]),e._v(" key AND")]),e._v(" "),t("li",[e._v("all the extended "),t("strong",[e._v("public")]),e._v(" keys of the other wallets involved in the\nmulti signature setup")])]),e._v(" "),t("p",[t("em",[e._v("The different nature of the two keys (one is private and one is public) is\ndue to the fact that each wallet, to be able to partially sign the transaction,\n"),t("strong",[e._v("must manage the private key of the wallet's owner")])]),e._v(" AND have the other\nparty's public key. Otherwise, if we put both public keys, we would obtain\na watch-only wallet unable to sign the transactions. If we\nhad both extended private keys inside the descriptor, we would allow each party\nto finalize the transactions autonomously.")]),e._v(" "),t("h4",{attrs:{id:"in-bitcoin-core"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#in-bitcoin-core"}},[e._v("#")]),e._v(" In Bitcoin Core:")]),e._v(" "),t("p",[e._v("In our case, the multi signature descriptor for Bitcoin Core will be composed\nwith:")]),e._v(" "),t("ul",[t("li",[e._v("The BIP84 derived Extended "),t("strong",[e._v("Public")]),e._v(" Key from BDK")]),e._v(" "),t("li",[e._v("The BIP84 derived Extended "),t("strong",[e._v("Private")]),e._v(" Key from Core.")])]),e._v(" "),t("p",[e._v("BDK wallet's owner will send to Core's owner the derived xpub for this purpose.\nThis is how the Core's multisig descriptor will be created and put into an\nenvironment variable:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export core_rec_desc=\"wsh(multi(2,$BDK_xpub_84_for_rec_desc,$core_xprv/84'/0'/0'/0/*))\"\n")])])]),t("p",[e._v("Where of course "),t("code",[e._v("$BDK_xpub_84_for_rec_desc")]),e._v("is the derived master public created\nin BDK and received by Core's owner.")]),e._v(" "),t("p",[e._v("The meaning of what is before and after is illustrated in the doc that explain\nthe use of "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors in Bitcoin Core"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("We add the necessary checksum using the specific "),t("code",[e._v("bitcoin-cli")]),e._v(" call.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export core_rec_desc_chksum=$core_rec_desc#$(bitcoin-cli -testnet getdescriptorinfo $core_rec_desc | jq -r '.checksum')\n")])])]),t("p",[e._v("We repeat the same to build the descriptor to receive the change.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export core_chg_desc=\"wsh(multi(2,$BDK_xpub_84_for_chg_desc,$core_xprv/84'/0'/0'/1/*))\"\nexport core_chg_desc_chksum=$core_chg_desc#$(bitcoin-cli -testnet getdescriptorinfo $core_chg_desc|jq -r '.checksum')\n")])])]),t("h4",{attrs:{id:"in-bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#in-bdk"}},[e._v("#")]),e._v(" In BDK:")]),e._v(" "),t("p",[e._v("For BDK we set the derivation for receiving addresses and change addresses\nin the command line (maybe setting an alias)")]),e._v(" "),t("p",[e._v("Building the descriptor:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export BDK_rec_desc=\"wsh(multi(2,$BDK_xprv/84'/0'/0'/0/*,$core_xpub_84_for_rec_desc))\"`\n")])])]),t("p",[e._v("Please note that the order of the extended key in the descriptor MUST be the\nsame in the 2 wallets.")]),e._v(" "),t("p",[t("em",[e._v("We have chosen to put BDK first and in each software wallet, the public key\nderived from BDK will always come first. In alternative, we could have chosen to\nproduce the descriptor, "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/pull/17056?ref=tokendaily",target:"_blank",rel:"noopener noreferrer"}},[e._v("chosing a "),t("code",[e._v("soretedmulti")]),e._v(" multisignature setup"),t("OutboundLink")],1)]),e._v(".")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export BDK_rec_desc_chksum=$BDK_rec_desc#$(bitcoin-cli -testnet getdescriptorinfo $BDK_rec_desc | jq -r '.checksum')\nexport BDK_chg_desc=\"wsh(multi(2,$BDK_xprv/84'/0'/0'/1/*,$core_xpub_84_for_chg_desc))\"\nexport BDK_chg_desc_chksum=$BDK_chg_desc#$(bitcoin-cli -testnet getdescriptorinfo $BDK_chg_desc | jq -r '.checksum')\n")])])]),t("p",[e._v("To take a look at the variables we have produced so far:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("env | grep 'core_'\nenv | grep 'BDK_'\n")])])]),t("p",[e._v("Now we will use the multisig descriptor wallet to receive testnet coins with\nAlice and Bob's software")]),e._v(" "),t("h3",{attrs:{id:"3-use-each-others-software-to-receive-testnet-coins-from-a-faucet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#3-use-each-others-software-to-receive-testnet-coins-from-a-faucet"}},[e._v("#")]),e._v(" 3. Use each other's software to receive testnet coins from a faucet")]),e._v(" "),t("h4",{attrs:{id:"in-bitcoin-core-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#in-bitcoin-core-2"}},[e._v("#")]),e._v(" In Bitcoin Core")]),e._v(" "),t("p",[e._v('Alice must create an empty, experimental new "descriptors wallet" in Core and\nto import the multisig Output Descriptor.')]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('bitcoin-cli -testnet createwallet "multisig2of2withBDK" false true "" false true false\n')])])]),t("p",[e._v("The flag are to:")]),e._v(" "),t("ul",[t("li",[e._v("use the private keys")]),e._v(" "),t("li",[e._v("make it empty")]),e._v(" "),t("li",[e._v("no password provided to the wallet")]),e._v(" "),t("li",[e._v("reusing of addresses not allowed")]),e._v(" "),t("li",[e._v('"new experimental descriptors wallet"')]),e._v(" "),t("li",[e._v("don't load it on start up")])]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK importdescriptors "[{\\"desc\\":\\"$core_rec_desc_chksum\\",\\"timestamp\\":\\"now\\",\\"active\\":true,\\"internal\\":false},{\\"desc\\":\\"$core_chg_desc_chksum\\",\\"timestamp\\":\\"now\\",\\"active\\":true,\\"internal\\":true}]"\n')])])]),t("p",[e._v("Now Alice asks for her first receiving multisignature address.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("export first_address=$(bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK getnewaddress)\necho $first_address\n")])])]),t("h4",{attrs:{id:"bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk"}},[e._v("#")]),e._v(" BDK")]),e._v(" "),t("p",[e._v("In BDK Bob can specify directly the descriptors on the command line to produce\nthe multisig address, because BDK is descriptors aware natively.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint get_new_address`\n')])])]),t("p",[e._v('Et voilà: if we have done everything correctly, the newly created address in\nCore is the same of the newly created address in BDK. this is part of the\n"miracle" of descriptors\' interoperability.')]),e._v(" "),t("h4",{attrs:{id:"we-ask-for-testnet-coins-giving-the-first-created-address"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#we-ask-for-testnet-coins-giving-the-first-created-address"}},[e._v("#")]),e._v(" We ask for testnet coins giving the first created address.")]),e._v(" "),t("p",[e._v('To find testnet coins for free, you can just google "testnet faucet" and you\nshould find some satoshis to play with. Just give to the site your first\ngenerated address and, in twenty minutes, you will find the satoshis in\nyour balance both in Core and in BDK.')]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('# to check it in Core:\n\nbitcoin-cli -testnet -rpcwallet=multisig2of2withBDK getbalance\n\n# In BDK:\n\n# Sync with the blockchain\nrepl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint sync\n# Get the balance\nrepl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint get_balance\n')])])]),t("p",[e._v("Some testnet faucets have an address to send back the unused satoshi after\nthe use. Take note of that because we will use it in the next step.")]),e._v(" "),t("h3",{attrs:{id:"4-we-return-part-of-the-satoshis-received-back-to-the-faucet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#4-we-return-part-of-the-satoshis-received-back-to-the-faucet"}},[e._v("#")]),e._v(" 4. we return part of the satoshis received back to the faucet")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('export psbt=$(bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK walletcreatefundedpsbt "[]" "[{\\"tb1qrcesfj9f2d7x40xs6ztnlrcgxhh6vsw8658hjdhdy6qgkf6nfrds9rp79a\\":0.000012}]" | jq -r \'.psbt\')\n\nexport psbt=$(bitcoin-cli -testnet -rpcwallet=multisig2of2withBDK walletprocesspsbt $psbt | jq -r \'.psbt\')\n{\n "psbt": "cHNidP8BAIkCAAAAATj90EC+NAuXj7y6SseZJucoJM6sGnUcVm9koTveZECTAAAAAAD+////AmACAAAAAAAAIgAg98ol9j4AalD71E0mV5QV0uM6/vCT+pi2twxr/zrvLROwBAAAAAAAACIAIB4zBMipU3xqvNDQlz+PCDXvpkHH1Q95Nu0mgIsnU0jbAAAAAAABAIkCAAAAAQS+ObgGG6UwtvaO3KYph2E3/ws7Q83RbmR3rxC0fKYSAQAAAAD+////AtAHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNDAHQAAAAAAACIAIBQpiDTgPIMt0ld8cmuYqlY+EIPjvrmMqZruDhs61hQNAAAAAAEBK9AHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNAiAgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAAQEFR1IhArn3tec7n7318rnWqf0dIIwtLtfxo6Zt0HV70UvZYaWvIQNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfVKuIgYCufe15zufvfXyudap/R0gjC0u1/Gjpm3QdXvRS9lhpa8YNEw2cFQAAIAAAACAAAAAgAAAAAAAAAAAIgYDbdI+wHtIgO6pS6Ja7jai1pDwPeidKoDCytTO1jhjAH0YO/laXFQAAIAAAACAAAAAgAAAAAAAAAAAAAEBR1IhAqccvA3rL13D1K4GeWjcahDsO3P8oaVNBttk4MlCKXIcIQLHKhjmPuCQjyS77ZfaMN2tdgNKcf/+57VXGZhz/UWTl1KuIgICpxy8DesvXcPUrgZ5aNxqEOw7c/yhpU0G22TgyUIpchwYNEw2cFQAAIAAAACAAAAAgAEAAAADAAAAIgICxyoY5j7gkI8ku+2X2jDdrXYDSnH//ue1VxmYc/1Fk5cYO/laXFQAAIAAAACAAAAAgAEAAAADAAAAAAA=",\n "complete": false\n}\n')])])]),t("p",[e._v("Exactly! Note the "),t("code",[e._v('"complete": false')]),e._v(". We have processed the transaction with\nCore but we miss one of the necessary key of the multisig 2of2 setup (The one\ncontained inside BDK).")]),e._v(" "),t("p",[t("code",[e._v("tb1qrcesfj9f2d7x40xs6ztnlrcgxhh6vsw8658hjdhdy6qgkf6nfrds9rp79a")]),e._v(" is the address\nwe got from the faucet site to return the satoshis.")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("PSBT"),t("OutboundLink")],1),e._v(" is sent over to the BDK wallet owner who tries to sign the\ntransaction:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint sign --psbt $psbt\n{\n "is_finalized": true,\n "psbt": "cHNidP8BAIkCAAAAATj90EC+NAuXj7y6SseZJucoJM6sGnUcVm9koTveZECTAAAAAAD+////AmACAAAAAAAAIgAg98ol9j4AalD71E0mV5QV0uM6/vCT+pi2twxr/zrvLROwBAAAAAAAACIAIB4zBMipU3xqvNDQlz+PCDXvpkHH1Q95Nu0mgIsnU0jbAAAAAAABAIkCAAAAAQS+ObgGG6UwtvaO3KYph2E3/ws7Q83RbmR3rxC0fKYSAQAAAAD+////AtAHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNDAHQAAAAAAACIAIBQpiDTgPIMt0ld8cmuYqlY+EIPjvrmMqZruDhs61hQNAAAAAAEBK9AHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNAiAgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAASICArn3tec7n7318rnWqf0dIIwtLtfxo6Zt0HV70UvZYaWvRzBEAiBkVDLgVEwvENnLx+04o7gGpGjFDBwAXTJmf8Yvo35oygIgbuBkHsvPC9jmZcMZ9P+Pwp01yxSaWo+5feyPmd3ai1kBAQVHUiECufe15zufvfXyudap/R0gjC0u1/Gjpm3QdXvRS9lhpa8hA23SPsB7SIDuqUuiWu42otaQ8D3onSqAwsrUztY4YwB9Uq4iBgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfRg7+VpcVAAAgAAAAIAAAACAAAAAAAAAAAAiBgK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlrxg0TDZwVAAAgAAAAIAAAACAAAAAAAAAAAABBwABCNoEAEcwRAIgZFQy4FRMLxDZy8ftOKO4BqRoxQwcAF0yZn/GL6N+aMoCIG7gZB7LzwvY5mXDGfT/j8KdNcsUmlqPuX3sj5nd2otZAUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAAUdSIQK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlryEDbdI+wHtIgO6pS6Ja7jai1pDwPeidKoDCytTO1jhjAH1SrgABAUdSIQKnHLwN6y9dw9SuBnlo3GoQ7Dtz/KGlTQbbZODJQilyHCECxyoY5j7gkI8ku+2X2jDdrXYDSnH//ue1VxmYc/1Fk5dSriICAqccvA3rL13D1K4GeWjcahDsO3P8oaVNBttk4MlCKXIcGDRMNnBUAACAAAAAgAAAAIABAAAAAwAAACICAscqGOY+4JCPJLvtl9ow3a12A0px//7ntVcZmHP9RZOXGDv5WlxUAACAAAAAgAAAAIABAAAAAwAAAAAA"\n}\n')])])]),t("p",[e._v('The signature has succeded (note the "is_finalized": true,) and now we can\nbroadcast the transction.')]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('repl -d "$BDK_rec_desc_chksum" -c "$BDK_chg_desc_chksum" -n testnet -w $BDK_fingerprint broadcast --psbt "cHNidP8BAIkCAAAAATj90EC+NAuXj7y6SseZJucoJM6sGnUcVm9koTveZECTAAAAAAD+////AmACAAAAAAAAIgAg98ol9j4AalD71E0mV5QV0uM6/vCT+pi2twxr/zrvLROwBAAAAAAAACIAIB4zBMipU3xqvNDQlz+PCDXvpkHH1Q95Nu0mgIsnU0jbAAAAAAABAIkCAAAAAQS+ObgGG6UwtvaO3KYph2E3/ws7Q83RbmR3rxC0fKYSAQAAAAD+////AtAHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNDAHQAAAAAAACIAIBQpiDTgPIMt0ld8cmuYqlY+EIPjvrmMqZruDhs61hQNAAAAAAEBK9AHAAAAAAAAIgAg6GXadcNj7k4yKUbnVlTLiedXQFXYdCBoNygop/PISNAiAgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAASICArn3tec7n7318rnWqf0dIIwtLtfxo6Zt0HV70UvZYaWvRzBEAiBkVDLgVEwvENnLx+04o7gGpGjFDBwAXTJmf8Yvo35oygIgbuBkHsvPC9jmZcMZ9P+Pwp01yxSaWo+5feyPmd3ai1kBAQVHUiECufe15zufvfXyudap/R0gjC0u1/Gjpm3QdXvRS9lhpa8hA23SPsB7SIDuqUuiWu42otaQ8D3onSqAwsrUztY4YwB9Uq4iBgNt0j7Ae0iA7qlLolruNqLWkPA96J0qgMLK1M7WOGMAfRg7+VpcVAAAgAAAAIAAAACAAAAAAAAAAAAiBgK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlrxg0TDZwVAAAgAAAAIAAAACAAAAAAAAAAAABBwABCNoEAEcwRAIgZFQy4FRMLxDZy8ftOKO4BqRoxQwcAF0yZn/GL6N+aMoCIG7gZB7LzwvY5mXDGfT/j8KdNcsUmlqPuX3sj5nd2otZAUcwRAIgS6x0i1J1HRzllIPf4WlFY+Dl8kCCLK81TL2djZxTFXMCICJVBKkKNxu1w1mRVor6iFTSVXiJjmWwBXVeJLISvBwAAUdSIQK597XnO5+99fK51qn9HSCMLS7X8aOmbdB1e9FL2WGlryEDbdI+wHtIgO6pS6Ja7jai1pDwPeidKoDCytTO1jhjAH1SrgABAUdSIQKnHLwN6y9dw9SuBnlo3GoQ7Dtz/KGlTQbbZODJQilyHCECxyoY5j7gkI8ku+2X2jDdrXYDSnH//ue1VxmYc/1Fk5dSriICAqccvA3rL13D1K4GeWjcahDsO3P8oaVNBttk4MlCKXIcGDRMNnBUAACAAAAAgAAAAIABAAAAAwAAACICAscqGOY+4JCPJLvtl9ow3a12A0px//7ntVcZmHP9RZOXGDv5WlxUAACAAAAAgAAAAIABAAAAAwAAAAAA"\n{\n "txid": "a0b082e3b0579822d4a0b0fa95a4c4662f6b128ffd43fdcfe53c37473ce85dee"\n}\n')])])]),t("h2",{attrs:{id:"conclusion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),t("p",[e._v("We have built an HDM and we have used it with two indipendent wallets, which\nare compatible with "),t("a",{attrs:{href:"https://en.bitcoin.it/wiki/BIP_0174",target:"_blank",rel:"noopener noreferrer"}},[e._v("BIP 174"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Output Descriptors"),t("OutboundLink")],1),e._v(". Hopefully we\nwill see many other compatible wallets beyound "),t("a",{attrs:{href:"https://bitcoincore.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Core"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://bitcoindevkit.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("BDK"),t("OutboundLink")],1),e._v(",\nwith which we will be able to easily set up multi signature schemes.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/57.3e290179.js b/assets/js/57.64bfd1b2.js similarity index 99% rename from assets/js/57.3e290179.js rename to assets/js/57.64bfd1b2.js index 65d1eeec9b..24a089371c 100644 --- a/assets/js/57.3e290179.js +++ b/assets/js/57.64bfd1b2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{418: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],{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 diff --git a/assets/js/58.e54b2b4e.js b/assets/js/58.de4ccb60.js similarity index 99% rename from assets/js/58.e54b2b4e.js rename to assets/js/58.de4ccb60.js index f09d479d65..9b7103f1c2 100644 --- a/assets/js/58.e54b2b4e.js +++ b/assets/js/58.de4ccb60.js @@ -1 +1 @@ -(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 +(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 diff --git a/assets/js/59.10a6a8e7.js b/assets/js/59.7e9a8d23.js similarity index 99% rename from assets/js/59.10a6a8e7.js rename to assets/js/59.7e9a8d23.js index e48d0d319a..4e9bb3d3ca 100644 --- a/assets/js/59.10a6a8e7.js +++ b/assets/js/59.7e9a8d23.js @@ -1 +1 @@ -(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 +(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 diff --git a/assets/js/60.1d0efc67.js b/assets/js/60.b17bda16.js similarity index 99% rename from assets/js/60.1d0efc67.js rename to assets/js/60.b17bda16.js index f259eebefa..0c2fcd1bc7 100644 --- a/assets/js/60.1d0efc67.js +++ b/assets/js/60.b17bda16.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[60],{417:function(t,s,e){"use strict";e.r(s);var a=e(7),n=Object(a.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("p",[t._v("This is the second part of a two-part blog series in which I talk through the changes made to BDK to make a Taproot transaction. If you haven't read it yet, check out "),s("a",{attrs:{href:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1"}},[t._v("Part 1")]),t._v(".")]),t._v(" "),s("p",[t._v("While in the first part I managed to show full raw commits, in this case I will only focus on the relevant changes, otherwise the post would get very long. You can always find the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/aa075f0...afilini:taproot-testing",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),s("OutboundLink")],1),t._v(" here, if you are interested\nin that.")]),t._v(" "),s("h2",{attrs:{id:"shortcuts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#shortcuts"}},[t._v("#")]),t._v(" Shortcuts")]),t._v(" "),s("p",[t._v("As mentioned previously, the main goal of this journey for me was to find out what it really takes to support Taproot in BDK. The code shown here wasn't written to be readable and/or maintainable, so\nsome shortcuts were taken, in particular:")]),t._v(" "),s("ul",[s("li",[t._v('No support for BIP32 extended keys: this is probably very quick to add, but in the first "proof of concept" I decided to only work with WIF keys for simplicity')]),t._v(" "),s("li",[t._v("No support for "),s("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("SIGHASH_DEFAULT")]),s("OutboundLink")],1),t._v(': this would require some minor changes to a few traits in BDK that still use the "legacy" '),s("code",[t._v("SigHashType")]),t._v(" enum from "),s("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-bitcoin",target:"_blank",rel:"noopener noreferrer"}},[t._v("rust-bitcoin"),s("OutboundLink")],1)])]),t._v(" "),s("h2",{attrs:{id:"utilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#utilities"}},[t._v("#")]),t._v(" Utilities")]),t._v(" "),s("p",[t._v("Let's start with some utilities:")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("ecdsa_to_schnorr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("pk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("ecdsa"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PublicKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("schnorr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PublicKey")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("schnorr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PublicKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_slice")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("pk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_bytes")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("expect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Key conversion failure"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("compute_merkle_root")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n leaf_hash"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("taproot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TapLeafHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n control_block"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("taproot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ControlBlock")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("taproot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TapBranchHash")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("taproot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TapBranchHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_inner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n control_block\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("merkle_branch\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("as_inner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fold")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("taproot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NodeInfo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new_hidden")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("sha256"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Hash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_slice")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("leaf_hash"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("as_inner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("expect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Invalid TapLeafHash"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token closure-params"}},[s("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[t._v("|")]),t._v("acc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" branch"),s("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[t._v("|")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("taproot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NodeInfo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("combine")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("acc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("taproot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NodeInfo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new_hidden")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("branch"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("expect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Invalid tree"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("hash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_inner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v('The first function "converts" an ECDSA key to a Schnorr key by dropping the first byte that encodes the key parity, since Schnorr keys are "x-only".')]),t._v(" "),s("p",[t._v("The second one constructs the merkle root of a taptree given a leaf hash and the corresponding control block.")]),t._v(" "),s("h2",{attrs:{id:"wrap-fallible-methods"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#wrap-fallible-methods"}},[t._v("#")]),t._v(" Wrap Fallible Methods")]),t._v(" "),s("p",[t._v("Many of the methods exposed by a "),s("code",[t._v("Descriptor")]),t._v(' struct used to be infallible: for instance, it was always possible to "encode" a descriptor into a Bitcoin script by calling the '),s("code",[t._v("script_pubkey()")]),t._v(" method.")]),t._v(" "),s("p",[t._v("Unfortunately, taproot descriptors need some extra metadata to do that: they can be computed by calling the "),s("code",[t._v("spend_info()")]),t._v(" method, and they will be cached inside the descriptor, but since it's not guaranteed by the\ncompiler that the method will be called before trying to encode it, the infallible methods had to be changed to return a "),s("code",[t._v("Result")]),t._v(", so that they can fail if the spend info is not present.")]),t._v(" "),s("p",[t._v("In BDK we call the "),s("code",[t._v("spend_info()")]),t._v(' method right after "deriving" the descriptor, so it\'s guaranteed that we will never encounter that error: for this reason, we wrap those methods and call '),s("code",[t._v("expect()")]),t._v(" on them, to keep\nthe original code mostly unchanged.")]),t._v(" "),s("p",[t._v("Here we call "),s("code",[t._v("spend_info()")]),t._v(" right after deriving the descriptor, if it's a "),s("code",[t._v("Tr")]),t._v(" variant:")]),t._v(" "),s("div",{staticClass:"language-diff extra-class"},[s("pre",{pre:!0,attrs:{class:"language-diff"}},[s("code",[t._v("@@ -136,10 +133,16 @@ impl AsDerived for Descriptor {\n"),s("span",{pre:!0,attrs:{class:"token unchanged"}},[s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" index: u32,\n")]),s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" secp: &'s SecpCtx,\n")]),s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" ) -> Descriptor> {\n")])]),s("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[s("span",{pre:!0,attrs:{class:"token prefix deleted"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" self.derive(index).translate_pk_infallible(\n")])]),s("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" let mut derived = self.derive(index).translate_pk_infallible(\n")])]),s("span",{pre:!0,attrs:{class:"token unchanged"}},[s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" |key| DerivedDescriptorKey::new(key.clone(), secp),\n")]),s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" |key| DerivedDescriptorKey::new(key.clone(), secp),\n")])]),s("span",{pre:!0,attrs:{class:"token deleted-sign deleted"}},[s("span",{pre:!0,attrs:{class:"token prefix deleted"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" )\n")])]),s("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" );\n")]),s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v("\n")]),s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" if let Descriptor::Tr(tr) = &mut derived {\n")]),s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" tr.spend_info(secp);\n")]),s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" }\n")]),s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v("\n")]),s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" derived\n")])]),s("span",{pre:!0,attrs:{class:"token unchanged"}},[s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" }\n")])])])])]),s("p",[t._v("And here we wrap the "),s("code",[t._v("script_pubkey()")]),t._v(" method and call "),s("code",[t._v("expect()")]),t._v(" on it. Note that we only implement it on "),s("code",[t._v("DerivedDescriptor")]),t._v(', because it\'s not guaranteed that "extended descriptors" will have the cached metadata inside.')]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("crate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("trait")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[t._v("DerivedDescriptorSafeOps")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/// The [`Descriptor::script_pubkey`] method can fail on `Tr` descriptors that don't have the")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/// `spend_info` inside. Since we generate those upon derivation, it's guaranteed that the")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/// method will not fail on `DerivedDescriptor`s.")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("script_pubkey_derived")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Script")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token lifetime-annotation symbol"}},[t._v("'s")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivedDescriptorSafeOps")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Descriptor")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivedDescriptorKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token lifetime-annotation symbol"}},[t._v("'s")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("script_pubkey_derived")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Script")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("expect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"`spend_info` is always present in `DerivedDescriptor`s"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"descriptor-metadata"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-metadata"}},[t._v("#")]),t._v(" Descriptor Metadata")]),t._v(" "),s("p",[t._v('In BDK we have a few traits that in a way "unify" the interface of a descriptor: things like the '),s("code",[t._v("redeem_script")]),t._v(" of an input has to be computed differently depending on the type of descriptor. The traits we define\nare implemented on the "),s("code",[t._v("DerivedDescriptor")]),t._v(" or "),s("code",[t._v("ExtendedDescriptor")]),t._v(" structs and allow us to quickly get what we need without having to check the descriptor type manually.")]),t._v(" "),s("p",[t._v("Internally, they are essentially large "),s("code",[t._v("match")]),t._v("es that return different things depending on the descriptor variant. Due to some renaming that had been done recently in "),s("code",[t._v("miniscript")]),t._v(" (not necessarily related to taproot)\nwe have to update them:")]),t._v(" "),s("div",{staticClass:"language-diff extra-class"},[s("pre",{pre:!0,attrs:{class:"language-diff"}},[s("code",[t._v("@@ -337,6 +339,7 @@ pub(crate) trait DerivedDescriptorMeta {\n\n"),s("span",{pre:!0,attrs:{class:"token unchanged"}},[s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v("pub(crate) trait DescriptorMeta {\n")]),s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" fn is_witness(&self) -> bool;\n")])]),s("span",{pre:!0,attrs:{class:"token inserted-sign inserted"}},[s("span",{pre:!0,attrs:{class:"token prefix inserted"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" fn is_tap(&self) -> bool;\n")])]),s("span",{pre:!0,attrs:{class:"token unchanged"}},[s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" fn get_extended_keys(&self) -> Result>, DescriptorError>;\n")]),s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" fn derive_from_hd_keypaths<'s>(\n")]),s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" &self,\n")])]),t._v("@@ -358,23 +361,29 @@ pub(crate) trait DescriptorScripts {\n\n"),s("span",{pre:!0,attrs:{class:"token unchanged"}},[s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v("impl<'s> DescriptorScripts for DerivedDescriptor<'s> {\n")]),s("span",{pre:!0,attrs:{class:"token prefix unchanged"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token line"}},[t._v(" fn psbt_redeem_script(&self) -> Option + diff --git a/bdk-cli/concept/index.html b/bdk-cli/concept/index.html index f57adbbc0f..206e5b382c 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!

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/bdk-cli/installation/index.html b/bdk-cli/installation/index.html index 2678bc78b7..bba3997379 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
    -
    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/bdk-cli/interface/index.html b/bdk-cli/interface/index.html index fe25c75773..42e99a0dba 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.

    Last Updated: 6/12/2024, 12:38:52 AM

    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 94bfda7e78..75283cb0c6 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.

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/bdk-cli/playground/index.html b/bdk-cli/playground/index.html index 7c36e4fe69..806a065467 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

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/bdk-cli/regtest/index.html b/bdk-cli/regtest/index.html index 23444ee03e..b447195033 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.

    Last Updated: 6/12/2024, 12:38:52 AM

    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 5f2cdb4c58..ddbaafa4e3 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!

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/2020/12/release-v0.2.0/index.html b/blog/2020/12/release-v0.2.0/index.html index 3e4aa60052..2d7bd71b4b 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:

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/2021/01/fee-estimation-for-light-clients-part-1/index.html b/blog/2021/01/fee-estimation-for-light-clients-part-1/index.html index 347e6525bb..c603ebb19f 100644 --- a/blog/2021/01/fee-estimation-for-light-clients-part-1/index.html +++ b/blog/2021/01/fee-estimation-for-light-clients-part-1/index.html @@ -30,7 +30,7 @@ - + @@ -74,7 +74,7 @@ fee rate paid by t was the exact value required to get confirmed within the next 6 blocks.

    So to build our model, we first need to gather these data, and machine learning needs a lot of data to work well.

    # The data logger

    The data logger (opens new window) is built with the purpose of collecting all the data we need, and it's MIT licensed open source software written in Rust.

    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 ZMQ (opens new window) events. Luckily, the just released bitcoin core 0.21.0 added a new ZMQ (opens new window) topic zmqpubsequence notifying mempool events (and block events). The logger is also listening to zmqpubrawtx and zmqpubrawblock topics, to make less RPC calls.

    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. In the final dataset this field is called confirms_in[4]; if confirms_in = 1 it means the transaction is confirmed in the first block created after it has been seen for the first time.

    Another critical piece of information logged by the data logger is the fee_rate 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.

    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[5], for example whenever we need to modify or add a new field.

    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. Raw 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 -when recreating the dataset.

    High level graph

    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.

    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.

    In the following Part 2 we are going to talk about the dataset.


    1. 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. ↩︎

    2. 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. ↩︎

    3. DISCLAIMER: I am not an expert data-scientist! ↩︎

    4. Conceptually similar to bitcoin core estimatesmartfee parameter called "blocks target", however, confirms_in is the real value not the desired target. ↩︎

    5. 16GB of compressed raw logs are processed and a compressed CSV produced in about 5 minutes. ↩︎

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/2021/01/fee-estimation-for-light-clients-part-2/index.html b/blog/2021/01/fee-estimation-for-light-clients-part-2/index.html index 422b1b3941..70d5731d6e 100644 --- a/blog/2021/01/fee-estimation-for-light-clients-part-2/index.html +++ b/blog/2021/01/fee-estimation-for-light-clients-part-2/index.html @@ -30,7 +30,7 @@ - + @@ -76,7 +76,7 @@ The 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 the mempool data in the dataset refers only to transactions having their inputs in the last 6 blocks. However the bitcoin-csv tool inside the data logger (opens new window) allows to configure this parameter.

    # The outliers

    The dataset also contains the block percentile fee rate q_k, considering r_i to be the rate of the ith transaction in a block, q_k is the fee rate value such that for each transaction in a block r_i < q_k returns the k% transactions in the block that are paying lower fees.

    Percentiles are not used to feed the model but to filter some outliers tx. Removing this observations is controversial at best and considered cheating at worse. However, it should be considered that Bitcoin Core estimatesmartfee 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 this one (opens new window) we found when we started logging data. These outliers are several for transactions confirming in the next block (confirms_in=1), less so for confirms_in=2, mostly disappeared for confirms_in=3 or more. It's counterintuitive that overestimation exists for confirms_in>1, 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:

    • network latency: my node saw the transaction but the miner didn't see that transaction yet,
    • 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.

    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. -Another reason to filter transactions is that the dataset is over-represented by transactions with low confirms_in: more than 50% of transactions get confirmed in the next block, so we think it's good to filter some of these transactions.

    The applied filters are the following:

    confirms_in lower higher
    1 q45 q55
    2 q30 q70
    3 q1 q99

    Not yet convinced by the removal of these outliers? The dataset (opens new window) contains all the observations, make your model 😃

    # Recap

    column used in the model description
    txid no Transaction hash, useful for debugging
    timestamp converted The time when the transaction has been added in the mempool, in the model is used in the form day_of_week and hour
    current_height no The blockchain height seen by the node in this moment
    confirms_in yes This transaction confirmed at block height current_height+confirms_in
    fee_rate target This transaction fee rate measured in [sat/vbytes]
    fee_rate_bytes no fee rate in satoshi / bytes, used to check Bitcoin Core estimatesmartfee predictions
    block_avg_fee no block average fee rate [sat/vbytes] of block current_height+confirms_in
    core_econ no bitcoin estimatesmartfee result for confirms_in block target and in economic mode. Could be not available ? when a block is connected more recently than the estimation has been requested, estimation are requested every 10 secs.
    core_cons no Same as above but with conservative mode
    mempool_len no Sum of the mempool transactions with fee rate available (sum of every a* field)
    parent_in_cpfp no 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).
    q1-q30-... no Transaction confirming fast could be outliers, usually paying a lot more than required, this percentiles are used to filter those transactions,
    a1-a2-... yes Contains the number of transaction in the mempool with known fee rate in the ith bucket.

    The good, the bad and the ugly

    My biological neural network fired this, I think it's because a lot of chapters start with "The"


    In the previous Part 1 we talked about the problem.

    In the following Part 3 we are going to talk about the model.


    1. In computer science temporal locality refers to the tendency to access recent data more often than older data. ↩︎

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/2021/01/fee-estimation-for-light-clients-part-3/index.html b/blog/2021/01/fee-estimation-for-light-clients-part-3/index.html index 26f9b65fbd..3c1c06f9ee 100644 --- a/blog/2021/01/fee-estimation-for-light-clients-part-3/index.html +++ b/blog/2021/01/fee-estimation-for-light-clients-part-3/index.html @@ -30,7 +30,7 @@ - + @@ -102,7 +102,7 @@ 7559/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

    Training is done in epochs, under every epoch all the training data is iterated and model parameters updated to minimize the loss function.

    The number 7559 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 1,934,999 observations in the training set and our batch size is 256, thus we have 1,437,841/256=7,558.58 which by excess result in 7559 steps.

    The ~31s is the time it takes to process the epoch on a threadripper CPU but GPU or TPU could do better.

    The value loss is the MSE on the training data while val_loss 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 loss continue to improve (almost indefinitely) while val_loss start improving with the loss but a certain point diverge, indicating the network is memorizing the training data to improve loss but in doing so losing generalizing capabilities.

    Our model doesn't look to suffer overfitting cause loss and val_loss doesn't diverge during training

    train history

    While we told the training to do 200 epochs, the training stopped at 158 because we added an early_stop call back with 20 as PATIENCE, meaning that after 20 epoch and no improvement in val_loss the training is halted, saving time and potentially avoiding overfitting.

    # The prediction phase

    A prediction test tool (opens new window) 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[4].

    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. We can see the model is doing quite well, the MAE is 8 which is way lower than estimatesmartfee. However, there are big errors some times, in particular for prediction for fast confirmation (confirms_in=1 or confirms_in=2) 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.

    prediction results

    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.

    error distribution

    # Conclusion and future development

    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.

    This is just a starting point, there are many future improvements such as:

    • 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.
    • 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 prediction test tool (opens new window) and the final integration in bdk (opens new window) should use it.
    • Explore other fields to improve model predictions such as: -
      • 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.
      • Transaction weight
      • Time from last block
    • Some fields are very important and could benefit from pre-processing expansion, for instance applying hashed feature columns (opens new window) to confirms_in.
    • Bitcoin logger could be improved by a merge command to unify raw logs files, reducing redundancy and consequently disk occupation.
    • The dataset could be created in multiple files to allow more parallelism and use less memory during training.
    • Saving the dataset in TFRecord format (opens new window) instead of CSV
    • 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.
    • The prediction test tool (opens new window) should estimate only using the p2p bitcoin network, without requiring a node. This work would be propedeutic for bdk (opens new window) integration
    • At the moment mempool buckets are multiple inputs a* as show in the model graph; since they are related, is it possible to merge them in one TensorArray?
    • Sometimes the model does not learn and gets stuck (opens new window). The reason is the clip 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 clip function apply penalties to the loss function for values lower than 1.
    • 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.
    • Tune hyper-parameters technique should be re-tested.
    • Predictions should be monotonic decreasing for growing confirms_in 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.
    • Since nodes with bloom filter disabled doesn't serve the mempool anymore, a model based only on last blocks should be evaluated.

    # Acknowledgements

    Thanks to Square crypto (opens new window) for sponsoring this work and thanks to the reviewers: Leonardo Comandini (opens new window), Domenico Gabriele (opens new window), Alekos Filini (opens new window), Ferdinando Ametrano (opens new window).

    And also this tweet that remembered me I (opens new window) had this work in my TODO list

    This is the final part of the series. In the previous Part 1 we talked about the problem and in Part 2 we talked about the dataset.


    1. MAE is Mean Absolute Error, which is the average of the series built by the absolute difference between the real value and the estimation. ↩︎

    2. drift like MAE, but without the absolute value ↩︎

    3. Most node won't relay transactions with fee lower than the min relay fee, which has a default of 1.0 ↩︎

    4. 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. ↩︎

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/2021/01/release-v0.3.0/index.html b/blog/2021/01/release-v0.3.0/index.html index a833936ee9..1b2243c16f 100644 --- a/blog/2021/01/release-v0.3.0/index.html +++ b/blog/2021/01/release-v0.3.0/index.html @@ -30,7 +30,7 @@ - + @@ -80,7 +80,7 @@ } }

    # A new repo for the CLI

    The cli module (and it's related cli-utils feature) have been removed from the main BDK repo and moved to their new home, the bdk-cli (opens new window) repo. The APIs exposed were mainly used internally, for the repl and the playground -in our website, but in case you were using one of those keep that in mind.

    # Contributors

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

    Since the v0.2.0 release around a month ago, we've had 24 new commits made by 6 different contributors for a total of 404 additions and 1243 deletions. Here's the full diff (opens new window).

    A special thanks to the new contributor for this release:

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/2021/02/release-v0.4.0/index.html b/blog/2021/02/release-v0.4.0/index.html index 04431c90e7..5133cb9bbd 100644 --- a/blog/2021/02/release-v0.4.0/index.html +++ b/blog/2021/02/release-v0.4.0/index.html @@ -30,7 +30,7 @@ - + @@ -102,7 +102,7 @@ info!("balance: {}", wallet.get_balance()?); Ok(()) } -

    # Contributors

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

    Since the v0.3.0 release around a month ago, we've had 59 new commits made by 8 different contributors for a total of 2463 additions and 1991 deletions. Here's the full diff (opens new window).

    A special thanks to the new contributor for this release:

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/2021/03/release-v0.5.0/index.html b/blog/2021/03/release-v0.5.0/index.html index 54900ca857..4449bf39f2 100644 --- a/blog/2021/03/release-v0.5.0/index.html +++ b/blog/2021/03/release-v0.5.0/index.html @@ -30,7 +30,7 @@ - + @@ -70,7 +70,7 @@ builder .add_recipient(addr.script_pubkey(), 60_000) .add_foreign_utxo(foreign_utxo.outpoint, foreign_utxo_psbt_input, foreign_utxo_satisfaction_weight)? -

    # Contributors

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

    Since the v0.4.0 release around a month ago, we've had 54 new commits made by 7 different contributors for a total of 1430 additions and 1212 deletions. Here's the full diff (opens new window).

    A special thanks to the new contributor for this release:

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/2021/04/release-v0.6.0/index.html b/blog/2021/04/release-v0.6.0/index.html index b9d204fcfb..642049a07f 100644 --- a/blog/2021/04/release-v0.6.0/index.html +++ b/blog/2021/04/release-v0.6.0/index.html @@ -30,7 +30,7 @@ - + @@ -81,7 +81,7 @@ .add_recipient(addr.script_pubkey(), 60_000) .add_foreign_utxo(alice_outpoint, alice_psbt_input, satisfaction_weight)? .... -

    # Renamed types

    To keep our coding style in line with the best practices defined by the Rust language, we've renamed some of our types and enum variants to avoid using upper case acronyms (opens new window).

    Some examples are:

    • UTXO -> Utxo
    • RBFValue -> RbfValue
    • BIP69Lexicographic -> Bip69Lexicographic
    • P2PKH -> P2Pkh
    • BIP44Public -> Bip44Public

    # New MSRV

    Due to some changes in one of our dependency, our MSRV has been bumped up from 1.45 to 1.46, which was released in August 2020. The last release fully supporting 1.45 is v0.5.1.

    # Contributors

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

    Since the v0.5.1 release around a month ago, we've had 37 new commits made by 7 different contributors for a total of 1092 additions and 548 deletions. Here's the full diff (opens new window).

    A special thanks to the new contributor for this release:

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/2021/05/release-v0.7.0/index.html b/blog/2021/05/release-v0.7.0/index.html index fe085e740f..25bc10fc41 100644 --- a/blog/2021/05/release-v0.7.0/index.html +++ b/blog/2021/05/release-v0.7.0/index.html @@ -30,7 +30,7 @@ - + @@ -85,7 +85,7 @@ tries to provide a summary for what a user's descriptor can contribute to a transaction. For instance, given a 2-of-2 multisig policy, a descriptor that contains only the two public keys can't contribute anything, while a descriptor that has one or both private keys can, respectively, contribute to and satisfy the policy by making signatures.

    In release v0.5.0 we added support for computing which parts of a policy are already satisfied by a given PSBT. This, combined with the contribution part, allow users to get a complete picture of what's already present and what's missing to fully satisfy a descriptor.

    In this release we are starting to take timelocks into consideration when computing the satisfaction component of a policy: this means that we can consider timelocks that are already expired as fully satisfied and also -exclude policy branches that require specific nLockTime or nSequence values, if those aren't correctly set in the transaction.

    Ultimately with those changes we are able to give our users a more complete picture of the completion stage of a PSBT, which also takes into account the expiration of timelocks.

    # Contributors

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

    Since the v0.6.0 release around a month ago, we've had 39 new commits made by 6 different contributors for a total of 698 additions and 309 deletions. Here's the full diff (opens new window).

    A special thanks to the new contributor for this release:

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/author/Rajarshi Maitra/index.html b/blog/author/Rajarshi Maitra/index.html index 6585c49bb2..fe1da19e96 100644 --- a/blog/author/Rajarshi Maitra/index.html +++ b/blog/author/Rajarshi Maitra/index.html @@ -25,7 +25,7 @@ - + @@ -103,6 +103,6 @@
    - + diff --git a/blog/author/Riccardo Casatta/index.html b/blog/author/Riccardo Casatta/index.html index 371c51ad2c..c928f5e7b9 100644 --- a/blog/author/Riccardo Casatta/index.html +++ b/blog/author/Riccardo Casatta/index.html @@ -25,7 +25,7 @@ - + @@ -71,7 +71,7 @@ - Tags: - Fee, Machine learning


    - + diff --git a/blog/author/Sandipan Dey/index.html b/blog/author/Sandipan Dey/index.html index efec1c219a..bc2fc4592c 100644 --- a/blog/author/Sandipan Dey/index.html +++ b/blog/author/Sandipan Dey/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/author/Steve Myers/index.html b/blog/author/Steve Myers/index.html index 90b3d0b928..32a815edb7 100644 --- a/blog/author/Steve Myers/index.html +++ b/blog/author/Steve Myers/index.html @@ -25,7 +25,7 @@ - + @@ -114,6 +114,6 @@
    - + diff --git a/blog/author/Wszdexdrf/index.html b/blog/author/Wszdexdrf/index.html index 5441e5bd79..71390bfce0 100644 --- a/blog/author/Wszdexdrf/index.html +++ b/blog/author/Wszdexdrf/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/author/index.html b/blog/author/index.html index 552f90920d..90f61471fe 100644 --- a/blog/author/index.html +++ b/blog/author/index.html @@ -25,7 +25,7 @@ - + @@ -49,7 +49,7 @@ Blog GitHub - (opens new window)
    - + diff --git a/blog/author/thunderbiscuit/index.html b/blog/author/thunderbiscuit/index.html index efb681cba7..afee385a4a 100644 --- a/blog/author/thunderbiscuit/index.html +++ b/blog/author/thunderbiscuit/index.html @@ -25,7 +25,7 @@ - + @@ -103,6 +103,6 @@
    - + diff --git a/blog/author/waterst0ne/index.html b/blog/author/waterst0ne/index.html index fbac8f7edd..b5d0d1ff66 100644 --- a/blog/author/waterst0ne/index.html +++ b/blog/author/waterst0ne/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    - + diff --git a/blog/bdk-cli-basics-multisig-2of3/index.html b/blog/bdk-cli-basics-multisig-2of3/index.html index 691c3de944..473a710a15 100644 --- a/blog/bdk-cli-basics-multisig-2of3/index.html +++ b/blog/bdk-cli-basics-multisig-2of3/index.html @@ -30,7 +30,7 @@ - + @@ -126,7 +126,7 @@

    # Step 12: Broadcast Transaction

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

    {
       "txid": "61da2451874a483aa8d1d0787c7680d157639f284840de8885098cac43f6cc2f"
     }
    -

    # Verify Transaction

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

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/bdk-cli-basics/index.html b/blog/bdk-cli-basics/index.html index fa87458ffb..d5286f7441 100644 --- a/blog/bdk-cli-basics/index.html +++ b/blog/bdk-cli-basics/index.html @@ -30,7 +30,7 @@ - + @@ -161,7 +161,7 @@ bdk-cli wallet --descriptor $env:my_descriptor broadcast --psbt $env:PSBTSIGNED

    👍 The output below confirms the command was successful.

    {
       "txid": "a0877b7ce91ea6d141ba63277673f5bdf0edfdd45f91a39ba1a1ace15f839b52"
     }
    -

    TIP

    Run sync one more time and see that the balance has decreased.


    # Resources

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/bdk-core-pt1/index.html b/blog/bdk-core-pt1/index.html index e00b52be68..a9598d58c3 100644 --- a/blog/bdk-core-pt1/index.html +++ b/blog/bdk-core-pt1/index.html @@ -30,7 +30,7 @@ - + @@ -245,7 +245,7 @@ } }

    # Feedback

    The best way to give feedback on this would be to comment on the pull request (opens new window) for this blog post. -Thanks in advance.

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/bdk-rn-making-of/index.html b/blog/bdk-rn-making-of/index.html index 40f6a3d2d1..65bd068a5f 100644 --- a/blog/bdk-rn-making-of/index.html +++ b/blog/bdk-rn-making-of/index.html @@ -30,7 +30,7 @@ - + @@ -164,7 +164,7 @@ console.log({ balance })

    The actual bdk-rn 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 user guide in the readme (opens new window) 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.

    The objective of bdk-rn is to enable React Native developers to quickly start developing applications without the need to package BDK as described above.

    Be on the lookout for user guides and tutorials on how to build bitcoin applications using bdk-rn and bdk-flutter.

    # References

    Creating native modules for Android and iOS: https://reactnative.dev/docs/native-modules-intro (opens new window)

    React Native Architecture: https://www.reactnative.guide/3-react-native-internals/3.1-react-native-internals.html (opens new window)

    BDK-Android API: https://bitcoindevkit.org/bdk-jvm/bdk-jvm/org.bitcoindevkit/index.html (opens new window)

    BDK-RN: https://github.com/LtbLightning/bdk-rn (opens new window)

    # Feedback

    The best way to give feedback on this would be to comment on the pull request (opens new window) for this blog post. -Thanks in advance.

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/bdk-with-tor/index.html b/blog/bdk-with-tor/index.html index 63f8c94c71..432158e808 100644 --- a/blog/bdk-with-tor/index.html +++ b/blog/bdk-with-tor/index.html @@ -30,7 +30,7 @@ - + @@ -306,7 +306,7 @@ }

    In this example we start Tor first, then use the address returned by start_tor() function as proxy address.

    We omitted find_string_in_log() and truncate_log() for brevity. You -can find their implementations in esplora_backend_with_tor.rs (opens new window)

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/bindings-scope/index.html b/blog/bindings-scope/index.html index 2447cee808..996cfceb33 100644 --- a/blog/bindings-scope/index.html +++ b/blog/bindings-scope/index.html @@ -30,7 +30,7 @@ - + @@ -65,7 +65,7 @@ - Tags: - BDK, Bindings


    tldr; 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.


    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 Uniffi (opens new window).

    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:

    1. Features that are part of crates "upstream" of BDK (rust-bitcoin, rust-miniscript)
    2. Features that are not but that have Rust crates and would be useful on mobile (payjoin, coinjoin implementations, silent payments, BIP-47)

    # Current architecture

    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.

    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 bdk-android 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).

    # Moving forward: building a family of libraries

    At the same time, other Rust-based libraries started using the uniffi approach (a good example is ldk-node (opens new window)) 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.

    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 crates.io (opens new window) so as to make it available to others who wish to build Rust bindings using uniffi.

    # Why can't we just build one big BDK library with everything in it?

    1. 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.
    2. 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.
    3. 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.

    # Are you looking to build Rust bindings yourself?

    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:

    1. Uniffi library template (opens new window). 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.
    2. Uniffi examples (opens new window). This repository provides boiled-down examples of APIs exposed using uniffi, with an accompanying documentation website (opens new window). Functions, enums, objects, callbacks, multi-libraries, a lot of information and examples to get you started.
    3. Sandbox library bitcoin-frontier (opens new window). 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.
    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/bitcoin-core-rpc-demo/index.html b/blog/bitcoin-core-rpc-demo/index.html index cafae53f55..0542840a49 100644 --- a/blog/bitcoin-core-rpc-demo/index.html +++ b/blog/bitcoin-core-rpc-demo/index.html @@ -30,7 +30,7 @@ - + @@ -524,7 +524,7 @@ // Return the keys as a tupple (keys[0].clone(), keys[1].clone()) } -

    # Conclusion

    In this tutorial we saw some very basic BDK wallet functionality with a bitcoin core backend as the source and sync of blockchain data. This is just tip of the iceberg of BDK capabilities. BDK allows flexibility in all the dimensions of a bitcoin wallet, that is key chain, blockchain backend and database management. With all that power, we just implemented a trustless, non-custodial, private bitcoin wallet, backed by a bitcoin full node, with less than 200 lines of code (including lots of comments).

    BDK thus allows wallet devs, to only focus on stuff that they care about, writing wallet logic. All the backend stuff like blockchain, key management, and databases are abstracted away under the hood.

    To find and explore more about the BDK capabilities and how it can fit your development need refer the following resources.

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/compact-filters-demo/index.html b/blog/compact-filters-demo/index.html index 7ab20a48fa..02b2e08237 100644 --- a/blog/compact-filters-demo/index.html +++ b/blog/compact-filters-demo/index.html @@ -30,7 +30,7 @@ - + @@ -186,7 +186,7 @@ "satoshi": 299999859 }

    If you see the balance updated, voila!

    What happened here is:

    • core created a new block containing the transaction.
    • bdk-cli fetched the corresponding filter data.
    • It noticed it got a concerning transaction.
    • It asked for the details of that transaction from the core node.
    • It updated its wallet details with this new information.
    • The update is reflected in the wallet balance.

    # Shutdown Docker

    You may now shutdown the regtest docker container.

    Note: This will also clean up any data in the bitcoin core, including the wallet.

    $ docker kill bdk-box
    -

    # End Words

    In this tutorial we went through the process of receiving, creating, signing and broadcasting transaction using the BDK wallet with compact_filters feature. This demonstrates how BDK capabilities can be used to create SPV light wallets with integrated BIP157 type compact_filters node.

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/tags/Flutter/index.html b/blog/tags/Flutter/index.html index 51bee8d700..b44235575b 100644 --- a/blog/tags/Flutter/index.html +++ b/blog/tags/Flutter/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/Hardware Wallets/index.html b/blog/tags/Hardware Wallets/index.html index 48a10df45c..ae387ce43b 100644 --- a/blog/tags/Hardware Wallets/index.html +++ b/blog/tags/Hardware Wallets/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    - + diff --git a/blog/tags/Neutrino/index.html b/blog/tags/Neutrino/index.html index 077e06be76..836921762c 100644 --- a/blog/tags/Neutrino/index.html +++ b/blog/tags/Neutrino/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/RPC/index.html b/blog/tags/RPC/index.html index d9200146f1..de23eabb27 100644 --- a/blog/tags/RPC/index.html +++ b/blog/tags/RPC/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/React Native/index.html b/blog/tags/React Native/index.html index 502c744e87..34827f8b48 100644 --- a/blog/tags/React Native/index.html +++ b/blog/tags/React Native/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    - + diff --git a/blog/tags/Wallet/index.html b/blog/tags/Wallet/index.html index eeef127cda..4ea3edc553 100644 --- a/blog/tags/Wallet/index.html +++ b/blog/tags/Wallet/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/architecture/index.html b/blog/tags/architecture/index.html index cb20e96884..1a704da734 100644 --- a/blog/tags/architecture/index.html +++ b/blog/tags/architecture/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    - + diff --git a/blog/tags/basics/index.html b/blog/tags/basics/index.html index 9901613709..9bda5275b4 100644 --- a/blog/tags/basics/index.html +++ b/blog/tags/basics/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/bdk-cli/index.html b/blog/tags/bdk-cli/index.html index 5312488eff..bbfcb38683 100644 --- a/blog/tags/bdk-cli/index.html +++ b/blog/tags/bdk-cli/index.html @@ -25,7 +25,7 @@ - + @@ -114,6 +114,6 @@
    - + diff --git a/blog/tags/bdk-rn/index.html b/blog/tags/bdk-rn/index.html index afd6550865..76540763f3 100644 --- a/blog/tags/bdk-rn/index.html +++ b/blog/tags/bdk-rn/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/bdk/index.html b/blog/tags/bdk/index.html index fb0f90b204..f2764af3b6 100644 --- a/blog/tags/bdk/index.html +++ b/blog/tags/bdk/index.html @@ -25,7 +25,7 @@ - + @@ -180,6 +180,6 @@
    - + diff --git a/blog/tags/bindings/index.html b/blog/tags/bindings/index.html index 89357d3c8b..305ac280f2 100644 --- a/blog/tags/bindings/index.html +++ b/blog/tags/bindings/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    - + diff --git a/blog/tags/bitcoin-cli/index.html b/blog/tags/bitcoin-cli/index.html index 139faf1d6e..d09e60ec7b 100644 --- a/blog/tags/bitcoin-cli/index.html +++ b/blog/tags/bitcoin-cli/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/bitcoin/index.html b/blog/tags/bitcoin/index.html index 122e06b22b..720bbda7c5 100644 --- a/blog/tags/bitcoin/index.html +++ b/blog/tags/bitcoin/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    - + diff --git a/blog/tags/blockchain/index.html b/blog/tags/blockchain/index.html index d42e174ee4..e81b051029 100644 --- a/blog/tags/blockchain/index.html +++ b/blog/tags/blockchain/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/coin selection/index.html b/blog/tags/coin selection/index.html index b4481301c4..902ae5c048 100644 --- a/blog/tags/coin selection/index.html +++ b/blog/tags/coin selection/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/compact_filters/index.html b/blog/tags/compact_filters/index.html index b04c44ed57..e96fea7903 100644 --- a/blog/tags/compact_filters/index.html +++ b/blog/tags/compact_filters/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/descriptor/index.html b/blog/tags/descriptor/index.html index f7fbccc61b..ccc6671c59 100644 --- a/blog/tags/descriptor/index.html +++ b/blog/tags/descriptor/index.html @@ -25,7 +25,7 @@ - + @@ -114,6 +114,6 @@
    - + diff --git a/blog/tags/development/index.html b/blog/tags/development/index.html index dca9465b65..bb890148e8 100644 --- a/blog/tags/development/index.html +++ b/blog/tags/development/index.html @@ -25,7 +25,7 @@ - + @@ -103,6 +103,6 @@
    - + diff --git a/blog/tags/fee/index.html b/blog/tags/fee/index.html index bc09045bfc..5d32cad715 100644 --- a/blog/tags/fee/index.html +++ b/blog/tags/fee/index.html @@ -25,7 +25,7 @@ - + @@ -60,7 +60,7 @@ - Tags: - Fee, Machine learning


    - + diff --git a/blog/tags/getting started/index.html b/blog/tags/getting started/index.html index 0c4b3732ff..0f1a158797 100644 --- a/blog/tags/getting started/index.html +++ b/blog/tags/getting started/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/guide/index.html b/blog/tags/guide/index.html index 3b53c09f50..2cf24a1840 100644 --- a/blog/tags/guide/index.html +++ b/blog/tags/guide/index.html @@ -25,7 +25,7 @@ - + @@ -125,6 +125,6 @@
    - + diff --git a/blog/tags/iOS/index.html b/blog/tags/iOS/index.html index 076aec5f32..5134504181 100644 --- a/blog/tags/iOS/index.html +++ b/blog/tags/iOS/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    - + diff --git a/blog/tags/index.html b/blog/tags/index.html index cbd2eabd56..c91ce29690 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 3182083507..d27f8a47db 100644 --- a/blog/tags/miniscript/index.html +++ b/blog/tags/miniscript/index.html @@ -25,7 +25,7 @@ - + @@ -114,6 +114,6 @@
    - + diff --git a/blog/tags/mobile/index.html b/blog/tags/mobile/index.html index 191c62b9d3..c6d1d24a6e 100644 --- a/blog/tags/mobile/index.html +++ b/blog/tags/mobile/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    - + diff --git a/blog/tags/multi-sig/index.html b/blog/tags/multi-sig/index.html index 2484f3b9b1..fd46fcb59f 100644 --- a/blog/tags/multi-sig/index.html +++ b/blog/tags/multi-sig/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/novice/index.html b/blog/tags/novice/index.html index 7212b0d0e6..2f89e6fd2b 100644 --- a/blog/tags/novice/index.html +++ b/blog/tags/novice/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/paper wallets/index.html b/blog/tags/paper wallets/index.html index 4df28d87e1..5c321f0147 100644 --- a/blog/tags/paper wallets/index.html +++ b/blog/tags/paper wallets/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/project/index.html b/blog/tags/project/index.html index 7d363ad9a3..92d28a6bf7 100644 --- a/blog/tags/project/index.html +++ b/blog/tags/project/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    - + diff --git a/blog/tags/release/index.html b/blog/tags/release/index.html index 98d2439106..17b934e7ab 100644 --- a/blog/tags/release/index.html +++ b/blog/tags/release/index.html @@ -25,7 +25,7 @@ - + @@ -158,6 +158,6 @@
    - + diff --git a/blog/tags/rust/index.html b/blog/tags/rust/index.html index cd0fd09c94..5989156f42 100644 --- a/blog/tags/rust/index.html +++ b/blog/tags/rust/index.html @@ -25,7 +25,7 @@ - + @@ -169,6 +169,6 @@
    - + diff --git a/blog/tags/security/index.html b/blog/tags/security/index.html index 300ae9ab9c..bddff942a5 100644 --- a/blog/tags/security/index.html +++ b/blog/tags/security/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/summer of bitcoin/index.html b/blog/tags/summer of bitcoin/index.html index 27a06411d0..fec0578108 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 @@
    - + diff --git a/blog/tags/taproot/index.html b/blog/tags/taproot/index.html index f2d3e76fcd..3567072341 100644 --- a/blog/tags/taproot/index.html +++ b/blog/tags/taproot/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    - + diff --git a/blog/tags/tor/index.html b/blog/tags/tor/index.html index 82657874a9..45ddcc6566 100644 --- a/blog/tags/tor/index.html +++ b/blog/tags/tor/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/tags/tutorial/index.html b/blog/tags/tutorial/index.html index b40d84d953..77218025dd 100644 --- a/blog/tags/tutorial/index.html +++ b/blog/tags/tutorial/index.html @@ -25,7 +25,7 @@ - + @@ -147,6 +147,6 @@
    - + diff --git a/blog/tags/wallet/index.html b/blog/tags/wallet/index.html index 20c56ee2cd..89590085c6 100644 --- a/blog/tags/wallet/index.html +++ b/blog/tags/wallet/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    - + diff --git a/blog/using-bdk-with-hardware-wallets/index.html b/blog/using-bdk-with-hardware-wallets/index.html index d453f5988a..9e090cd035 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!

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/blog/why-bindings/index.html b/blog/why-bindings/index.html index 13818e618c..836c8d9f5e 100644 --- a/blog/why-bindings/index.html +++ b/blog/why-bindings/index.html @@ -30,7 +30,7 @@ - + @@ -66,7 +66,7 @@ - Tags: Bindings


    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.

    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.

    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:

    1. 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).
    2. 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.

    # Awesome! Producing Bindings Must Be Easy Right?

    Along the way, actually producing language bindings for a variety of languages is no easy feat. Here are some of the challenges we face:

    1. We create bindings for many languages in one fell swoop with a Rust tool called uniffi (opens new window). 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.
    2. 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.
    3. 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.
    4. A few caveats give us interesting puzzles we need to juggle with as we design and develop the language bindings libraries: -
      • 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".
      • 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.

    Note: The bdk-rn (opens new window) and bdk-flutter (opens new window) 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 rust-flutter-bridge, and is not a direct descendant of the uniffi-based libraries, although it follows a similar API.

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/descriptors/index.html b/descriptors/index.html index 1d7450f40e..ab1920f363 100644 --- a/descriptors/index.html +++ b/descriptors/index.html @@ -33,7 +33,7 @@ - + @@ -63,7 +63,7 @@ aims to produce the first "Native Descriptor" Bitcoin library that can be used by developers to build their own "Native Descriptor Wallets" (opens new window).

    # Compatibility Matrix

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

    # Key Types

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

    # Script Types (top level)

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

    # Operators

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

    # Modifiers

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

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

    # Examples

    Some examples of valid BDK descriptors are:

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

    # Implementation Details

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

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

    [d34db33f/44'/0'/0']xpub6ERApfZwUNrhL.......rBGRjaDMzQLcgJvLJuZZvRcEL/0/*
    -
    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/struct.ChangeSet.html b/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/struct.ChangeSet.html index 4bb4336279..e8e51cce73 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/struct.ChangeSet.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/struct.ChangeSet.html @@ -7,7 +7,7 @@

    Trait Implementations§

    source§

    impl<A: Anchor, IA: Append> Append for ChangeSet<A, IA>

    source§

    fn append(&mut self, other: Self)

    Append another object of the same type onto self.
    source§

    fn is_empty(&self) -> bool

    Returns whether the structure is considered empty.
    source§

    impl<A: Clone, IA: Clone> Clone for ChangeSet<A, IA>

    source§

    fn clone(&self) -> ChangeSet<A, IA>

    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, IA: Debug> Debug for ChangeSet<A, IA>

    source§

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

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

    impl<A, IA: Default> Default for ChangeSet<A, IA>

    source§

    fn default() -> Self

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

    impl<'de, A, IA> Deserialize<'de> for ChangeSet<A, IA>
    where A: Ord + Deserialize<'de>, IA: Deserialize<'de>,

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl<A, IA: Default> From<ChangeSet<A>> for ChangeSet<A, IA>

    source§

    fn from(graph: ChangeSet<A>) -> Self

    Converts to this type from the input type.
    source§

    impl<A, K> From<ChangeSet<K>> for ChangeSet<A, ChangeSet<K>>

    source§

    fn from(indexer: ChangeSet<K>) -> Self

    Converts to this type from the input type.
    source§

    impl<A: PartialEq, IA: PartialEq> PartialEq for ChangeSet<A, IA>

    source§

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

    This method tests for self and other values to be equal, and is used + __D: Deserializer<'de>,
    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl<A, IA: Default> From<ChangeSet<A>> for ChangeSet<A, IA>

    source§

    fn from(graph: ChangeSet<A>) -> Self

    Converts to this type from the input type.
    source§

    impl<A, K> From<ChangeSet<K>> for ChangeSet<A, ChangeSet<K>>

    source§

    fn from(indexer: ChangeSet<K>) -> Self

    Converts to this type from the input type.
    source§

    impl<A: PartialEq, IA: PartialEq> PartialEq for ChangeSet<A, IA>

    source§

    fn eq(&self, other: &ChangeSet<A, IA>) -> 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, IA> Serialize for ChangeSet<A, IA>
    where A: Ord + Serialize, diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.Balance.html b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.Balance.html index 39f4451a81..add9b35350 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.Balance.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.Balance.html @@ -12,8 +12,8 @@

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

    source

    pub fn total(&self) -> Amount

    Get the whole balance visible to the wallet.

    -

    Trait Implementations§

    source§

    impl Add for Balance

    §

    type Output = Balance

    The resulting type after applying the + operator.
    source§

    fn add(self, other: Self) -> Self

    Performs the + operation. Read more
    source§

    impl Clone for Balance

    source§

    fn clone(&self) -> Balance

    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 Debug for Balance

    source§

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

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

    impl Default for Balance

    source§

    fn default() -> Balance

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

    impl<'de> Deserialize<'de> for Balance

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for Balance

    source§

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

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

    impl PartialEq for Balance

    source§

    fn eq(&self, other: &Balance) -> bool

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

    Trait Implementations§

    source§

    impl Add for Balance

    §

    type Output = Balance

    The resulting type after applying the + operator.
    source§

    fn add(self, other: Self) -> Self

    Performs the + operation. Read more
    source§

    impl Clone for Balance

    source§

    fn clone(&self) -> Balance

    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 Debug for Balance

    source§

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

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

    impl Default for Balance

    source§

    fn default() -> Balance

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

    impl<'de> Deserialize<'de> for Balance

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where + __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for Balance

    source§

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

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

    impl PartialEq for Balance

    source§

    fn eq(&self, other: &Balance) -> 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 Serialize for Balance

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl Eq for Balance

    source§

    impl StructuralPartialEq for Balance

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/local_chain/enum.ApplyHeaderError.html b/docs-rs/bdk/nightly/latest/bdk_chain/local_chain/enum.ApplyHeaderError.html index e78d53935f..910d3f491b 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/local_chain/enum.ApplyHeaderError.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/local_chain/enum.ApplyHeaderError.html @@ -4,7 +4,7 @@ }
    Expand description

    Variants§

    §

    InconsistentBlocks

    Occurs when connected_to block conflicts with either the current block or previous block.

    §

    CannotConnect(CannotConnectError)

    Occurs when the update cannot connect with the original chain.

    -

    Trait Implementations§

    source§

    impl Clone for ApplyHeaderError

    source§

    fn clone(&self) -> ApplyHeaderError

    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 Debug for ApplyHeaderError

    source§

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

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

    impl Display for ApplyHeaderError

    source§

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

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

    impl Error for ApplyHeaderError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl PartialEq for ApplyHeaderError

    source§

    fn eq(&self, other: &ApplyHeaderError) -> bool

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

    Trait Implementations§

    source§

    impl Clone for ApplyHeaderError

    source§

    fn clone(&self) -> ApplyHeaderError

    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 Debug for ApplyHeaderError

    source§

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

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

    impl Display for ApplyHeaderError

    source§

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

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

    impl Error for ApplyHeaderError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl PartialEq for ApplyHeaderError

    source§

    fn eq(&self, other: &ApplyHeaderError) -> 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 StructuralPartialEq for ApplyHeaderError

    Auto Trait Implementations§

    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 diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/local_chain/struct.AlterCheckPointError.html b/docs-rs/bdk/nightly/latest/bdk_chain/local_chain/struct.AlterCheckPointError.html index 21db62a527..741cdcd4e0 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/local_chain/struct.AlterCheckPointError.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/local_chain/struct.AlterCheckPointError.html @@ -6,7 +6,7 @@

    Fields§

    §height: u32

    The checkpoint’s height.

    §original_hash: BlockHash

    The original checkpoint’s block hash which cannot be replaced/removed.

    §update_hash: Option<BlockHash>

    The attempted update to the original_block hash.

    -

    Trait Implementations§

    source§

    impl Clone for AlterCheckPointError

    source§

    fn clone(&self) -> AlterCheckPointError

    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 Debug for AlterCheckPointError

    source§

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

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

    impl Display for AlterCheckPointError

    source§

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

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

    impl Error for AlterCheckPointError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl PartialEq for AlterCheckPointError

    source§

    fn eq(&self, other: &AlterCheckPointError) -> bool

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

    Trait Implementations§

    source§

    impl Clone for AlterCheckPointError

    source§

    fn clone(&self) -> AlterCheckPointError

    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 Debug for AlterCheckPointError

    source§

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

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

    impl Display for AlterCheckPointError

    source§

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

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

    impl Error for AlterCheckPointError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl PartialEq for AlterCheckPointError

    source§

    fn eq(&self, other: &AlterCheckPointError) -> 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 StructuralPartialEq for AlterCheckPointError

    Auto Trait Implementations§

    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 diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/local_chain/struct.MissingGenesisError.html b/docs-rs/bdk/nightly/latest/bdk_chain/local_chain/struct.MissingGenesisError.html index 64fad54071..76faa1b893 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/local_chain/struct.MissingGenesisError.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/local_chain/struct.MissingGenesisError.html @@ -1,5 +1,5 @@ MissingGenesisError in bdk_chain::local_chain - Rust

    Struct bdk_chain::local_chain::MissingGenesisError

    source ·
    pub struct MissingGenesisError;
    Expand description

    An error which occurs when a LocalChain is constructed without a genesis checkpoint.

    -

    Trait Implementations§

    source§

    impl Clone for MissingGenesisError

    source§

    fn clone(&self) -> MissingGenesisError

    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 Debug for MissingGenesisError

    source§

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

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

    impl Display for MissingGenesisError

    source§

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

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

    impl Error for MissingGenesisError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl PartialEq for MissingGenesisError

    source§

    fn eq(&self, other: &MissingGenesisError) -> bool

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

    Trait Implementations§

    source§

    impl Clone for MissingGenesisError

    source§

    fn clone(&self) -> MissingGenesisError

    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 Debug for MissingGenesisError

    source§

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

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

    impl Display for MissingGenesisError

    source§

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

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

    impl Error for MissingGenesisError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl PartialEq for MissingGenesisError

    source§

    fn eq(&self, other: &MissingGenesisError) -> 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 StructuralPartialEq for MissingGenesisError

    Auto Trait Implementations§

    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 diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/struct.BlockId.html b/docs-rs/bdk/nightly/latest/bdk_chain/struct.BlockId.html index f191b705fd..3b969faf77 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/struct.BlockId.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/struct.BlockId.html @@ -11,7 +11,7 @@ block_id: BlockId, _tx_pos: usize ) -> Self

    Construct the anchor from a given block, block height and tx_pos within the block.
    source§

    impl Clone for BlockId

    source§

    fn clone(&self) -> BlockId

    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 Debug for BlockId

    source§

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

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

    impl Default for BlockId

    source§

    fn default() -> Self

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

    impl<'de> Deserialize<'de> for BlockId

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl From<(&u32, &BlockHash)> for BlockId

    source§

    fn from((height, hash): (&u32, &BlockHash)) -> Self

    Converts to this type from the input type.
    source§

    impl From<(u32, BlockHash)> for BlockId

    source§

    fn from((height, hash): (u32, BlockHash)) -> Self

    Converts to this type from the input type.
    source§

    impl From<BlockId> for (u32, BlockHash)

    source§

    fn from(block_id: BlockId) -> Self

    Converts to this type from the input type.
    source§

    impl Hash for BlockId

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where + __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl From<(&u32, &BlockHash)> for BlockId

    source§

    fn from((height, hash): (&u32, &BlockHash)) -> Self

    Converts to this type from the input type.
    source§

    impl From<(u32, BlockHash)> for BlockId

    source§

    fn from((height, hash): (u32, BlockHash)) -> Self

    Converts to this type from the input type.
    source§

    impl From<BlockId> for (u32, BlockHash)

    source§

    fn from(block_id: BlockId) -> Self

    Converts to this type from the input type.
    source§

    impl Hash for BlockId

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where H: Hasher, Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    source§

    impl Ord for BlockId

    source§

    fn cmp(&self, other: &BlockId) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · source§

    fn min(self, other: Self) -> Self
    where diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/struct.DescriptorId.html b/docs-rs/bdk/nightly/latest/bdk_chain/struct.DescriptorId.html index 466f25027e..b732690622 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/struct.DescriptorId.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/struct.DescriptorId.html @@ -6,25 +6,27 @@

    Tuple Fields§

    §0: Hash

    Implementations§

    source§

    impl DescriptorId

    source

    pub fn from_raw_hash(inner: Hash) -> DescriptorId

    Creates this wrapper type from the inner hash type.

    source

    pub fn to_raw_hash(self) -> Hash

    Returns the inner hash (sha256, sh256d etc.).

    source

    pub fn as_raw_hash(&self) -> &Hash

    Returns a reference to the inner hash (sha256, sh256d etc.).

    -

    Trait Implementations§

    source§

    impl AsRef<[u8]> for DescriptorId

    source§

    fn as_ref(&self) -> &[u8]

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

    impl AsRef<[u8; 32]> for DescriptorId

    source§

    fn as_ref(&self) -> &[u8; 32]

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

    impl Borrow<[u8]> for DescriptorId

    source§

    fn borrow(&self) -> &[u8]

    Immutably borrows from an owned value. Read more
    source§

    impl Clone for DescriptorId

    source§

    fn clone(&self) -> DescriptorId

    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 Debug for DescriptorId

    source§

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

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

    impl<'de> Deserialize<'de> for DescriptorId

    source§

    fn deserialize<D: Deserializer<'de>>(d: D) -> Result<DescriptorId, D::Error>

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for DescriptorId

    source§

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

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

    impl From<DescriptorId> for Hash

    source§

    fn from(hashtype: DescriptorId) -> Hash

    Converts to this type from the input type.
    source§

    impl From<Hash> for DescriptorId

    source§

    fn from(inner: Hash) -> DescriptorId

    Converts to this type from the input type.
    source§

    impl FromStr for DescriptorId

    §

    type Err = HexToArrayError

    The associated error which can be returned from parsing.
    source§

    fn from_str(s: &str) -> Result<DescriptorId, Self::Err>

    Parses a string s to return a value of this type. Read more
    source§

    impl Hash for DescriptorId

    §

    type Engine = <Hash as Hash>::Engine

    A hashing engine which bytes can be serialized into. It is expected +

    Trait Implementations§

    source§

    impl AsRef<[u8]> for DescriptorId

    source§

    fn as_ref(&self) -> &[u8]

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

    impl AsRef<[u8; 32]> for DescriptorId

    source§

    fn as_ref(&self) -> &[u8; 32]

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

    impl Borrow<[u8]> for DescriptorId

    source§

    fn borrow(&self) -> &[u8]

    Immutably borrows from an owned value. Read more
    source§

    impl Clone for DescriptorId

    source§

    fn clone(&self) -> DescriptorId

    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 Debug for DescriptorId

    source§

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

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

    impl<'de> Deserialize<'de> for DescriptorId

    source§

    fn deserialize<D: Deserializer<'de>>(d: D) -> Result<DescriptorId, D::Error>

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for DescriptorId

    source§

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

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

    impl From<DescriptorId> for Hash

    source§

    fn from(hashtype: DescriptorId) -> Hash

    Converts to this type from the input type.
    source§

    impl From<Hash> for DescriptorId

    source§

    fn from(inner: Hash) -> DescriptorId

    Converts to this type from the input type.
    source§

    impl FromStr for DescriptorId

    §

    type Err = HexToArrayError

    The associated error which can be returned from parsing.
    source§

    fn from_str(s: &str) -> Result<DescriptorId, Self::Err>

    Parses a string s to return a value of this type. Read more
    source§

    impl Hash for DescriptorId

    §

    type Engine = <Hash as Hash>::Engine

    A hashing engine which bytes can be serialized into. It is expected to implement the io::Write trait, and to never return errors under any conditions.
    §

    type Bytes = <Hash as Hash>::Bytes

    The byte array that represents the hash internally.
    source§

    const LEN: usize = 32usize

    Length of the hash, in bytes.
    source§

    const DISPLAY_BACKWARD: bool = false

    Flag indicating whether user-visible serializations of this hash should be backward. For some reason Satoshi decided this should be -true for Sha256dHash, so here we are.
    source§

    fn engine() -> Self::Engine

    Constructs a new engine.
    source§

    fn from_engine(e: Self::Engine) -> Self

    Produces a hash from the current state of a given engine.
    source§

    fn from_slice(sl: &[u8]) -> Result<DescriptorId, FromSliceError>

    Copies a byte slice into a hash object.
    source§

    fn from_byte_array(bytes: Self::Bytes) -> Self

    Constructs a hash from the underlying byte array.
    source§

    fn to_byte_array(self) -> Self::Bytes

    Returns the underlying byte array.
    source§

    fn as_byte_array(&self) -> &Self::Bytes

    Returns a reference to the underlying byte array.
    source§

    fn all_zeros() -> Self

    Returns an all zero hash. Read more
    §

    fn hash(data: &[u8]) -> Self

    Hashes some bytes.
    source§

    impl Hash for DescriptorId

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where +true for Sha256dHash, so here we are.

    source§

    fn engine() -> Self::Engine

    Constructs a new engine.
    source§

    fn from_engine(e: Self::Engine) -> Self

    Produces a hash from the current state of a given engine.
    source§

    fn from_slice(sl: &[u8]) -> Result<DescriptorId, FromSliceError>

    Copies a byte slice into a hash object.
    source§

    fn from_byte_array(bytes: Self::Bytes) -> Self

    Constructs a hash from the underlying byte array.
    source§

    fn to_byte_array(self) -> Self::Bytes

    Returns the underlying byte array.
    source§

    fn as_byte_array(&self) -> &Self::Bytes

    Returns a reference to the underlying byte array.
    source§

    fn all_zeros() -> Self

    Returns an all zero hash. Read more
    §

    fn hash(data: &[u8]) -> Self

    Hashes some bytes.
    §

    fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
    where + B: AsRef<[u8]>, + I: IntoIterator<Item = B>,

    Hashes all the byte slices retrieved from the iterator together.
    source§

    impl Hash for DescriptorId

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where H: Hasher, - Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    source§

    impl<I: SliceIndex<[u8]>> Index<I> for DescriptorId

    §

    type Output = <I as SliceIndex<[u8]>>::Output

    The returned type after indexing.
    source§

    fn index(&self, index: I) -> &Self::Output

    Performs the indexing (container[index]) operation. Read more
    source§

    impl LowerHex for DescriptorId

    source§

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

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

    impl Ord for DescriptorId

    source§

    fn cmp(&self, other: &DescriptorId) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Self
    where + Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    source§

    impl<I: SliceIndex<[u8]>> Index<I> for DescriptorId

    §

    type Output = <I as SliceIndex<[u8]>>::Output

    The returned type after indexing.
    source§

    fn index(&self, index: I) -> &Self::Output

    Performs the indexing (container[index]) operation. Read more
    source§

    impl LowerHex for DescriptorId

    source§

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

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

    impl Ord for DescriptorId

    source§

    fn cmp(&self, other: &DescriptorId) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · source§

    fn min(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · source§

    fn clamp(self, min: Self, max: Self) -> Self
    where Self: Sized + PartialOrd,

    Restrict a value to a certain interval. Read more
    source§

    impl PartialEq for DescriptorId

    source§

    fn eq(&self, other: &DescriptorId) -> 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 PartialOrd for DescriptorId

    source§

    fn partial_cmp(&self, other: &DescriptorId) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

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

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

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

    This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
    1.0.0 · source§

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

    This method tests greater than (for self and other) and is used by the > operator. Read more
    1.0.0 · source§

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

    This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
    source§

    impl SerdeHash for DescriptorId

    source§

    const N: usize = 32usize

    Size, in bits, of the hash.
    source§

    fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>

    Helper function to turn a deserialized slice into the correct hash type.
    §

    fn serialize<S>( +operator. Read more

    source§

    impl SerdeHash for DescriptorId

    source§

    const N: usize = 32usize

    Size, in bits, of the hash.
    source§

    fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>

    Helper function to turn a deserialized slice into the correct hash type.
    §

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

    Do serde serialization.
    §

    fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>
    where - D: Deserializer<'de>,

    Do serde deserialization.
    source§

    impl Serialize for DescriptorId

    source§

    fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>

    Serialize this value into the given Serde serializer. Read more
    source§

    impl UpperHex for DescriptorId

    source§

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

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

    impl Copy for DescriptorId

    source§

    impl Eq for DescriptorId

    source§

    impl StructuralPartialEq for DescriptorId

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where + S: Serializer,

    Do serde serialization.
    §

    fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>
    where + D: Deserializer<'de>,

    Do serde deserialization.

    source§

    impl Serialize for DescriptorId

    source§

    fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>

    Serialize this value into the given Serde serializer. Read more
    source§

    impl UpperHex for DescriptorId

    source§

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

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

    impl Copy for DescriptorId

    source§

    impl Eq for DescriptorId

    source§

    impl StructuralPartialEq for DescriptorId

    Auto Trait Implementations§

    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/bdk_chain/trait.Anchor.html b/docs-rs/bdk/nightly/latest/bdk_chain/trait.Anchor.html index 5c51697b98..6d1c6848cb 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/trait.Anchor.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/trait.Anchor.html @@ -34,7 +34,7 @@ let mut graph_a = TxGraph::<BlockId>::default(); let _ = graph_a.insert_tx(tx.clone()); graph_a.insert_anchor( - tx.txid(), + tx.compute_txid(), BlockId { height: 1, hash: Hash::hash("first".as_bytes()), @@ -49,7 +49,7 @@ let mut graph_b = TxGraph::<ConfirmationHeightAnchor>::default(); let _ = graph_b.insert_tx(tx.clone()); graph_b.insert_anchor( - tx.txid(), + tx.compute_txid(), ConfirmationHeightAnchor { anchor_block: BlockId { height: 2, @@ -67,7 +67,7 @@ let mut graph_c = TxGraph::<ConfirmationTimeHeightAnchor>::default(); let _ = graph_c.insert_tx(tx.clone()); graph_c.insert_anchor( - tx.txid(), + tx.compute_txid(), ConfirmationTimeHeightAnchor { anchor_block: BlockId { height: 2, diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/trait.Append.html b/docs-rs/bdk/nightly/latest/bdk_chain/trait.Append.html index 343d8f9e78..a66af4af0b 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/trait.Append.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/trait.Append.html @@ -71,4 +71,4 @@ T7: Append, T8: Append, T9: Append, - T10: Append,

    source§

    fn append(&mut self, _other: Self)

    source§

    fn is_empty(&self) -> bool

    source§

    impl<T> Append for Vec<T>

    source§

    fn append(&mut self, other: Self)

    source§

    fn is_empty(&self) -> bool

    source§

    impl<T: Ord> Append for BTreeSet<T>

    source§

    fn append(&mut self, other: Self)

    source§

    fn is_empty(&self) -> bool

    Implementors§

    source§

    impl<A: Ord> Append for bdk_chain::tx_graph::ChangeSet<A>

    source§

    impl<A: Anchor, IA: Append> Append for bdk_chain::indexed_tx_graph::ChangeSet<A, IA>

    source§

    impl<K: Ord> Append for bdk_chain::keychain::ChangeSet<K>

    \ No newline at end of file + T10: Append,
    source§

    fn append(&mut self, _other: Self)

    source§

    fn is_empty(&self) -> bool

    source§

    impl<T> Append for Vec<T>

    source§

    fn append(&mut self, other: Self)

    source§

    fn is_empty(&self) -> bool

    source§

    impl<T: Ord> Append for BTreeSet<T>

    source§

    fn append(&mut self, other: Self)

    source§

    fn is_empty(&self) -> bool

    Implementors§

    source§

    impl<A: Ord> Append for bdk_chain::tx_graph::ChangeSet<A>

    source§

    impl<A: Anchor, IA: Append> Append for bdk_chain::indexed_tx_graph::ChangeSet<A, IA>

    source§

    impl<K: Ord> Append for bdk_chain::keychain::ChangeSet<K>

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/enum.CalculateFeeError.html b/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/enum.CalculateFeeError.html index cb7704e57d..29d85f7461 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/enum.CalculateFeeError.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/enum.CalculateFeeError.html @@ -4,7 +4,7 @@ }
    Expand description

    Errors returned by TxGraph::calculate_fee.

    Variants§

    §

    MissingTxOut(Vec<OutPoint>)

    Missing TxOut for one or more of the inputs of the tx

    §

    NegativeFee(SignedAmount)

    When the transaction is invalid according to the graph it has a negative fee

    -

    Trait Implementations§

    source§

    impl Debug for CalculateFeeError

    source§

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

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

    impl Display for CalculateFeeError

    source§

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

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

    impl Error for CalculateFeeError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl PartialEq for CalculateFeeError

    source§

    fn eq(&self, other: &CalculateFeeError) -> bool

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

    Trait Implementations§

    source§

    impl Debug for CalculateFeeError

    source§

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

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

    impl Display for CalculateFeeError

    source§

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

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

    impl Error for CalculateFeeError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl PartialEq for CalculateFeeError

    source§

    fn eq(&self, other: &CalculateFeeError) -> 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 Eq for CalculateFeeError

    source§

    impl StructuralPartialEq for CalculateFeeError

    Auto Trait Implementations§

    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 diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/index.html b/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/index.html index 7bb0eb5ae1..eaf777517d 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/index.html @@ -1,4 +1,4 @@ -bdk_chain::tx_graph - Rust

    Module bdk_chain::tx_graph

    source ·
    Expand description

    Module for structures that store and traverse transactions.

    +bdk_chain::tx_graph - Rust

    Module bdk_chain::tx_graph

    source ·
    Expand description

    Module for structures that store and traverse transactions.

    TxGraph contains transactions and indexes them so you can easily traverse the graph of those transactions. TxGraph is monotone in that you can always insert a transaction – it does not care whether that transaction is in the current best chain or whether it conflicts with diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.ChangeSet.html b/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.ChangeSet.html index 45a2747487..96546830d7 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.ChangeSet.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.ChangeSet.html @@ -1,4 +1,4 @@ -ChangeSet in bdk_chain::tx_graph - Rust

    Struct bdk_chain::tx_graph::ChangeSet

    source ·
    pub struct ChangeSet<A = ()> {
    +ChangeSet in bdk_chain::tx_graph - Rust

    Struct bdk_chain::tx_graph::ChangeSet

    source ·
    pub struct ChangeSet<A = ()> {
         pub txs: BTreeSet<Arc<Transaction>>,
         pub txouts: BTreeMap<OutPoint, TxOut>,
         pub anchors: BTreeSet<(A, Txid)>,
    @@ -11,22 +11,22 @@
     
    §txouts: BTreeMap<OutPoint, TxOut>

    Added txouts.

    §anchors: BTreeSet<(A, Txid)>

    Added anchors.

    §last_seen: BTreeMap<Txid, u64>

    Added last-seen unix timestamps of transactions.

    -

    Implementations§

    source§

    impl<A> ChangeSet<A>

    source

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

    Iterates over all outpoints contained within ChangeSet.

    -
    source

    pub fn anchor_heights(&self) -> impl Iterator<Item = u32> + '_
    where +

    Implementations§

    source§

    impl<A> ChangeSet<A>

    source

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

    Iterates over all outpoints contained within ChangeSet.

    +
    source

    pub fn anchor_heights(&self) -> impl Iterator<Item = u32> + '_
    where A: Anchor,

    Iterates over the heights of that the new transaction anchors in this changeset.

    This is useful if you want to find which heights you need to fetch data about in order to confirm or exclude these anchors.

    -
    source§

    impl<A: Ord> ChangeSet<A>

    source

    pub fn map_anchors<A2: Ord, F>(self, f: F) -> ChangeSet<A2>
    where +

    source§

    impl<A: Ord> ChangeSet<A>

    source

    pub fn map_anchors<A2: Ord, F>(self, f: F) -> ChangeSet<A2>
    where F: FnMut(A) -> A2,

    Transform the ChangeSet to have Anchors of another type.

    This takes in a closure of signature FnMut(A) -> A2 which is called for each Anchor to transform it.

    -

    Trait Implementations§

    source§

    impl<A: Ord> Append for ChangeSet<A>

    source§

    fn append(&mut self, other: Self)

    Append another object of the same type onto self.
    source§

    fn is_empty(&self) -> bool

    Returns whether the structure is considered empty.
    source§

    impl<A: Clone> Clone for ChangeSet<A>

    source§

    fn clone(&self) -> ChangeSet<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 ChangeSet<A>

    source§

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

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

    impl<A> Default for ChangeSet<A>

    source§

    fn default() -> Self

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

    impl<'de, A> Deserialize<'de> for ChangeSet<A>
    where - A: Ord + Deserialize<'de>,

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl<A, IA: Default> From<ChangeSet<A>> for ChangeSet<A, IA>

    source§

    fn from(graph: ChangeSet<A>) -> Self

    Converts to this type from the input type.
    source§

    impl<A: PartialEq> PartialEq for ChangeSet<A>

    source§

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

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

    Trait Implementations§

    source§

    impl<A: Ord> Append for ChangeSet<A>

    source§

    fn append(&mut self, other: Self)

    Append another object of the same type onto self.
    source§

    fn is_empty(&self) -> bool

    Returns whether the structure is considered empty.
    source§

    impl<A: Clone> Clone for ChangeSet<A>

    source§

    fn clone(&self) -> ChangeSet<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 ChangeSet<A>

    source§

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

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

    impl<A> Default for ChangeSet<A>

    source§

    fn default() -> Self

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

    impl<'de, A> Deserialize<'de> for ChangeSet<A>
    where + A: Ord + Deserialize<'de>,

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where + __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl<A, IA: Default> From<ChangeSet<A>> for ChangeSet<A, IA>

    source§

    fn from(graph: ChangeSet<A>) -> Self

    Converts to this type from the input type.
    source§

    impl<A: PartialEq> PartialEq for ChangeSet<A>

    source§

    fn eq(&self, other: &ChangeSet<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> Serialize for ChangeSet<A>
    where - A: Ord + Serialize,

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where - __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl<A> StructuralPartialEq for ChangeSet<A>

    Auto Trait Implementations§

    §

    impl<A> Freeze for ChangeSet<A>

    §

    impl<A> RefUnwindSafe for ChangeSet<A>
    where +sufficient, and should not be overridden without very good reason.

    source§

    impl<A> Serialize for ChangeSet<A>
    where + A: Ord + Serialize,

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where + __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl<A> StructuralPartialEq for ChangeSet<A>

    Auto Trait Implementations§

    §

    impl<A> Freeze for ChangeSet<A>

    §

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

    §

    impl<A> Send for ChangeSet<A>
    where A: Send,

    §

    impl<A> Sync for ChangeSet<A>
    where A: Sync,

    §

    impl<A> Unpin for ChangeSet<A>

    §

    impl<A> UnwindSafe for ChangeSet<A>
    where diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.TxAncestors.html b/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.TxAncestors.html index ff730bc8fc..a224e1969c 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.TxAncestors.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.TxAncestors.html @@ -1,8 +1,8 @@ -TxAncestors in bdk_chain::tx_graph - Rust

    Struct bdk_chain::tx_graph::TxAncestors

    source ·
    pub struct TxAncestors<'g, A, F> { /* private fields */ }
    Expand description

    An iterator that traverses ancestors of a given root transaction.

    +TxAncestors in bdk_chain::tx_graph - Rust

    Struct bdk_chain::tx_graph::TxAncestors

    source ·
    pub struct TxAncestors<'g, A, F> { /* private fields */ }
    Expand description

    An iterator that traverses ancestors of a given root transaction.

    The iterator excludes partial transactions.

    Returned by the walk_ancestors method of TxGraph.

    -

    Trait Implementations§

    source§

    impl<'g, A, F, O> Iterator for TxAncestors<'g, A, F>
    where - F: FnMut(usize, Arc<Transaction>) -> Option<O>,

    §

    type Item = O

    The type of the elements being iterated over.
    source§

    fn next(&mut self) -> Option<Self::Item>

    Advances the iterator and returns the next value. Read more
    source§

    fn next_chunk<const N: usize>( +

    Trait Implementations§

    source§

    impl<'g, A, F, O> Iterator for TxAncestors<'g, A, F>
    where + F: FnMut(usize, Arc<Transaction>) -> Option<O>,

    §

    type Item = O

    The type of the elements being iterated over.
    source§

    fn next(&mut self) -> Option<Self::Item>

    Advances the iterator and returns the next value. Read more
    source§

    fn next_chunk<const N: usize>( &mut self ) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
    where Self: Sized,

    🔬This is a nightly-only experimental API. (iter_next_chunk)
    Advances the iterator and returns an array containing the next N values. Read more
    1.0.0 · source§

    fn size_hint(&self) -> (usize, Option<usize>)

    Returns the bounds on the remaining length of the iterator. Read more
    1.0.0 · source§

    fn count(self) -> usize
    where diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.TxDescendants.html b/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.TxDescendants.html index 88b0597ff7..6810c533f7 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.TxDescendants.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/tx_graph/struct.TxDescendants.html @@ -1,7 +1,7 @@ -TxDescendants in bdk_chain::tx_graph - Rust

    Struct bdk_chain::tx_graph::TxDescendants

    source ·
    pub struct TxDescendants<'g, A, F> { /* private fields */ }
    Expand description

    An iterator that traverses transaction descendants.

    +TxDescendants in bdk_chain::tx_graph - Rust

    Struct bdk_chain::tx_graph::TxDescendants

    source ·
    pub struct TxDescendants<'g, A, F> { /* private fields */ }
    Expand description

    An iterator that traverses transaction descendants.

    Returned by the walk_descendants method of TxGraph.

    -

    Trait Implementations§

    source§

    impl<'g, A, F, O> Iterator for TxDescendants<'g, A, F>
    where - F: FnMut(usize, Txid) -> Option<O>,

    §

    type Item = O

    The type of the elements being iterated over.
    source§

    fn next(&mut self) -> Option<Self::Item>

    Advances the iterator and returns the next value. Read more
    source§

    fn next_chunk<const N: usize>( +

    Trait Implementations§

    source§

    impl<'g, A, F, O> Iterator for TxDescendants<'g, A, F>
    where + F: FnMut(usize, Txid) -> Option<O>,

    §

    type Item = O

    The type of the elements being iterated over.
    source§

    fn next(&mut self) -> Option<Self::Item>

    Advances the iterator and returns the next value. Read more
    source§

    fn next_chunk<const N: usize>( &mut self ) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
    where Self: Sized,

    🔬This is a nightly-only experimental API. (iter_next_chunk)
    Advances the iterator and returns an array containing the next N values. Read more
    1.0.0 · source§

    fn size_hint(&self) -> (usize, Option<usize>)

    Returns the bounds on the remaining length of the iterator. Read more
    1.0.0 · source§

    fn count(self) -> usize
    where 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 78b72bb01b..8070fb9908 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 @@ -86,7 +86,7 @@

    source

    pub fn all_anchors(&self) -> &BTreeSet<(A, Txid)>

    Get all transaction anchors known by TxGraph.

    source

    pub fn is_empty(&self) -> bool

    Whether the graph has any transactions or outputs in it.

    -
    source§

    impl<A: Clone + Ord> TxGraph<A>

    source

    pub fn map_anchors<A2: Clone + Ord, F>(self, f: F) -> TxGraph<A2>
    where +

    source§

    impl<A: Clone + Ord> TxGraph<A>

    source

    pub fn map_anchors<A2: Clone + Ord, F>(self, f: F) -> TxGraph<A2>
    where F: FnMut(A) -> A2,

    Transform the TxGraph to have Anchors of another type.

    This takes in a closure of signature FnMut(A) -> A2 which is called for each Anchor to transform it.

    @@ -96,23 +96,23 @@ about.

    The ChangeSet result will be empty if the outpoint (or a full transaction containing the outpoint) already existed in self.

    -
    source

    pub fn insert_tx<T: Into<Arc<Transaction>>>(&mut self, tx: T) -> ChangeSet<A>

    Inserts the given transaction into TxGraph.

    +
    source

    pub fn insert_tx<T: Into<Arc<Transaction>>>(&mut self, tx: T) -> ChangeSet<A>

    Inserts the given transaction into TxGraph.

    The ChangeSet returned will be empty if tx already exists.

    -
    source

    pub fn batch_insert_unconfirmed( +

    source

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

    Batch insert unconfirmed transactions.

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

    -
    source

    pub fn insert_anchor(&mut self, txid: Txid, anchor: A) -> ChangeSet<A>

    Inserts the given anchor into TxGraph.

    +
    source

    pub fn insert_anchor(&mut self, txid: Txid, anchor: A) -> ChangeSet<A>

    Inserts the given anchor into TxGraph.

    The ChangeSet returned will be empty if graph already knows that txid exists in anchor.

    -
    source

    pub fn insert_seen_at(&mut self, txid: Txid, seen_at: u64) -> ChangeSet<A>

    Inserts the given seen_at for txid into TxGraph.

    +
    source

    pub fn insert_seen_at(&mut self, txid: Txid, seen_at: u64) -> ChangeSet<A>

    Inserts the given seen_at for txid into TxGraph.

    Note that TxGraph only keeps track of the latest seen_at. To batch update all unconfirmed transactions with the latest seen_at, see update_last_seen_unconfirmed.

    -
    source

    pub fn update_last_seen_unconfirmed(&mut self, seen_at: u64) -> ChangeSet<A>

    Update the last seen time for all unconfirmed transactions.

    +
    source

    pub fn update_last_seen_unconfirmed(&mut self, seen_at: u64) -> ChangeSet<A>

    Update the last seen time for all unconfirmed transactions.

    This method updates the last seen unconfirmed time for this TxGraph by inserting the given seen_at for every transaction not yet anchored to a confirmed block, and returns the ChangeSet after applying all updates to self.

    @@ -134,13 +134,13 @@
    §Example

    Note that TxGraph only keeps track of the latest seen_at, so the given time must by strictly greater than what is currently stored for a transaction to have an effect. To insert a last seen time for a single txid, see insert_seen_at.

    -
    source

    pub fn apply_update(&mut self, update: TxGraph<A>) -> ChangeSet<A>

    Extends this graph with another so that self becomes the union of the two sets of +

    source

    pub fn apply_update(&mut self, update: TxGraph<A>) -> ChangeSet<A>

    Extends this graph with another so that self becomes the union of the two sets of transactions.

    The returned ChangeSet is the set difference between update and self (transactions that exist in update but not in self).

    -
    source

    pub fn initial_changeset(&self) -> ChangeSet<A>

    Determines the ChangeSet between self and an empty TxGraph.

    -
    source

    pub fn apply_changeset(&mut self, changeset: ChangeSet<A>)

    Applies ChangeSet to TxGraph.

    -
    source§

    impl<A: Anchor> TxGraph<A>

    source

    pub fn initial_changeset(&self) -> ChangeSet<A>

    Determines the ChangeSet between self and an empty TxGraph.

    +
    source

    pub fn apply_changeset(&mut self, changeset: ChangeSet<A>)

    Applies ChangeSet to TxGraph.

    +

    source§

    impl<A: Anchor> TxGraph<A>

    source

    pub fn try_get_chain_position<C: ChainOracle>( &self, chain: &C, chain_tip: BlockId, @@ -163,14 +163,14 @@

    §Example
    §Error

    An error will occur if the ChainOracle implementation (chain) fails. If the ChainOracle is infallible, get_chain_position can be used instead.

    -
    source

    pub fn get_chain_position<C: ChainOracle<Error = Infallible>>( +

    source

    pub fn get_chain_position<C: ChainOracle<Error = Infallible>>( &self, chain: &C, chain_tip: BlockId, txid: Txid ) -> Option<ChainPosition<&A>>

    Get the position of the transaction in chain with tip chain_tip.

    This is the infallible version of try_get_chain_position.

    -
    source

    pub fn try_get_chain_spend<C: ChainOracle>( +

    source

    pub fn try_get_chain_spend<C: ChainOracle>( &self, chain: &C, chain_tip: BlockId, @@ -181,7 +181,7 @@

    §Error
    §Error

    An error will occur only if the ChainOracle implementation (chain) fails.

    If the ChainOracle is infallible, get_chain_spend can be used instead.

    -

    source

    pub fn get_chain_spend<C: ChainOracle<Error = Infallible>>( +

    source

    pub fn get_chain_spend<C: ChainOracle<Error = Infallible>>( &self, chain: &C, static_block: BlockId, @@ -189,7 +189,7 @@

    §Error
    ) -> Option<(ChainPosition<&A>, Txid)>

    Get the txid of the spending transaction and where the spending transaction is observed in the chain of chain_tip.

    This is the infallible version of try_get_chain_spend

    -
    source

    pub fn try_list_chain_txs<'a, C: ChainOracle + 'a>( +

    source

    pub fn try_list_chain_txs<'a, C: ChainOracle + 'a>( &'a self, chain: &'a C, chain_tip: BlockId @@ -200,13 +200,13 @@

    §Error

    If the ChainOracle implementation (chain) fails, an error will be returned with the returned item.

    If the ChainOracle is infallible, list_chain_txs can be used instead.

    -
    source

    pub fn list_chain_txs<'a, C: ChainOracle + 'a>( +

    source

    pub fn list_chain_txs<'a, C: ChainOracle + 'a>( &'a self, chain: &'a C, chain_tip: BlockId ) -> impl Iterator<Item = CanonicalTx<'a, Arc<Transaction>, A>>

    List graph transactions that are in chain with chain_tip.

    This is the infallible version of try_list_chain_txs.

    -
    source

    pub fn try_filter_chain_txouts<'a, C: ChainOracle + 'a, OI: Clone + 'a>( +

    source

    pub fn try_filter_chain_txouts<'a, C: ChainOracle + 'a, OI: Clone + 'a>( &'a self, chain: &'a C, chain_tip: BlockId, @@ -223,7 +223,7 @@

    §Error
    fails.

    If the ChainOracle implementation is infallible, filter_chain_txouts can be used instead.

    -
    source

    pub fn filter_chain_txouts<'a, C: ChainOracle<Error = Infallible> + 'a, OI: Clone + 'a>( +

    source

    pub fn filter_chain_txouts<'a, C: ChainOracle<Error = Infallible> + 'a, OI: Clone + 'a>( &'a self, chain: &'a C, chain_tip: BlockId, @@ -231,7 +231,7 @@

    §Error
    ) -> impl Iterator<Item = (OI, FullTxOut<A>)> + 'a

    Get a filtered list of outputs from the given outpoints that are in chain with chain_tip.

    This is the infallible version of try_filter_chain_txouts.

    -
    source

    pub fn try_filter_chain_unspents<'a, C: ChainOracle + 'a, OI: Clone + 'a>( +

    source

    pub fn try_filter_chain_unspents<'a, C: ChainOracle + 'a, OI: Clone + 'a>( &'a self, chain: &'a C, chain_tip: BlockId, @@ -247,7 +247,7 @@

    §Error
    fails.

    If the ChainOracle implementation is infallible, filter_chain_unspents can be used instead.

    -
    source

    pub fn filter_chain_unspents<'a, C: ChainOracle<Error = Infallible> + 'a, OI: Clone + 'a>( +

    source

    pub fn filter_chain_unspents<'a, C: ChainOracle<Error = Infallible> + 'a, OI: Clone + 'a>( &'a self, chain: &'a C, chain_tip: BlockId, @@ -255,7 +255,7 @@

    §Error
    ) -> impl Iterator<Item = (OI, FullTxOut<A>)> + 'a

    Get a filtered list of unspent outputs (UTXOs) from the given outpoints that are in chain with chain_tip.

    This is the infallible version of try_filter_chain_unspents.

    -
    source

    pub fn try_balance<C: ChainOracle, OI: Clone>( +

    source

    pub fn try_balance<C: ChainOracle, OI: Clone>( &self, chain: &C, chain_tip: BlockId, @@ -268,7 +268,7 @@

    §Error
    Iterator::enumerate over a list of [OutPoint]s.

    If the provided ChainOracle implementation (chain) is infallible, balance can be used instead.

    -
    source

    pub fn balance<C: ChainOracle<Error = Infallible>, OI: Clone>( +

    source

    pub fn balance<C: ChainOracle<Error = Infallible>, OI: Clone>( &self, chain: &C, chain_tip: BlockId, @@ -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, 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 +

    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_coin_select/struct.SelectionError.html b/docs-rs/bdk/nightly/latest/bdk_coin_select/struct.SelectionError.html index 8858f44b2f..888e52bff1 100644 --- a/docs-rs/bdk/nightly/latest/bdk_coin_select/struct.SelectionError.html +++ b/docs-rs/bdk/nightly/latest/bdk_coin_select/struct.SelectionError.html @@ -1,4 +1,4 @@ -SelectionError in bdk_coin_select - Rust

    Struct bdk_coin_select::SelectionError

    source ·
    pub struct SelectionError { /* private fields */ }

    Trait Implementations§

    source§

    impl Clone for SelectionError

    source§

    fn clone(&self) -> SelectionError

    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 Debug for SelectionError

    source§

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

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

    impl Display for SelectionError

    source§

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

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

    impl Error for SelectionError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +SelectionError in bdk_coin_select - Rust

    Struct bdk_coin_select::SelectionError

    source ·
    pub struct SelectionError { /* private fields */ }

    Trait Implementations§

    source§

    impl Clone for SelectionError

    source§

    fn clone(&self) -> SelectionError

    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 Debug for SelectionError

    source§

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

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

    impl Display for SelectionError

    source§

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

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

    impl Error for SelectionError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    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/bdk_electrum/index.html b/docs-rs/bdk/nightly/latest/bdk_electrum/index.html index e4ccf81971..08d8a29824 100644 --- a/docs-rs/bdk/nightly/latest/bdk_electrum/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_electrum/index.html @@ -1,4 +1,4 @@ -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.

    +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 @@ -6,7 +6,7 @@ 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].

    +bdk_chain.

    Refer to example_electrum for a complete example.

    -

    Re-exports§

    • pub use bdk_chain;
    • pub use electrum_client;

    Structs§

    • Wrapper around an [electrum_client::ElectrumApi] which includes an internal in-memory +

    Re-exports§

    Structs§

    \ 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 index ee4d7ba251..0c6ffa1a46 100644 --- a/docs-rs/bdk/nightly/latest/bdk_electrum/struct.BdkElectrumClient.html +++ b/docs-rs/bdk/nightly/latest/bdk_electrum/struct.BdkElectrumClient.html @@ -5,7 +5,7 @@ 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 +

    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.

    @@ -13,15 +13,15 @@

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

    source

    pub fn full_scan<K: Ord + Clone>( &self, - request: FullScanRequest<K>, + 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.

    +returns updates for bdk_chain data structures.

    • request: struct with data required to perform a spk-based blockchain client full scan, -see [FullScanRequest]
    • +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 @@ -30,14 +30,14 @@
    source

    pub fn sync( &self, - request: SyncRequest, + 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.

    +and returns updates for bdk_chain data structures.

    source

    pub fn with_confirmation_time_height_anchor( self, client: &BdkElectrumClient<impl ElectrumApi> -) -> Result<FullScanResult<K, ConfirmationTimeHeightAnchor>, Error>

    Return [FullScanResult] with [ConfirmationTimeHeightAnchor].

    +) -> Result<FullScanResult<K, ConfirmationTimeHeightAnchor>, Error>

    Return FullScanResult with ConfirmationTimeHeightAnchor.

    This requires additional calls to the Electrum server.

    Auto Trait Implementations§

    §

    impl<K> Freeze for ElectrumFullScanResult<K>

    §

    impl<K> RefUnwindSafe for ElectrumFullScanResult<K>
    where K: RefUnwindSafe,

    §

    impl<K> Send 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 0234f7f460..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,13 +1,13 @@ 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.

    +

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

    Implementations§

    source§

    impl ElectrumSyncResult

    source

    pub fn with_confirmation_height_anchor( self -) -> SyncResult<ConfirmationHeightAnchor>

    Return [SyncResult] with [ConfirmationHeightAnchor].

    +) -> SyncResult<ConfirmationHeightAnchor>

    source

    pub fn with_confirmation_time_height_anchor( self, client: &BdkElectrumClient<impl ElectrumApi> -) -> Result<SyncResult<ConfirmationTimeHeightAnchor>, Error>

    Return [SyncResult] with [ConfirmationTimeHeightAnchor].

    +) -> Result<SyncResult<ConfirmationTimeHeightAnchor>, Error>

    Return SyncResult with ConfirmationTimeHeightAnchor.

    This requires additional calls to the Electrum server.

    Auto Trait Implementations§

    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 diff --git a/docs-rs/bdk/nightly/latest/bdk_file_store/enum.IterError.html b/docs-rs/bdk/nightly/latest/bdk_file_store/enum.IterError.html index 7e0a7981c3..2b630453f6 100644 --- a/docs-rs/bdk/nightly/latest/bdk_file_store/enum.IterError.html +++ b/docs-rs/bdk/nightly/latest/bdk_file_store/enum.IterError.html @@ -4,7 +4,7 @@ }
    Expand description

    Error type for EntryIter.

    Variants§

    §

    Io(Error)

    Failure to read from the file.

    §

    Bincode(ErrorKind)

    Failure to decode data from the file.

    -

    Trait Implementations§

    source§

    impl Debug for IterError

    source§

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

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

    impl Display for IterError

    source§

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

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

    impl Error for IterError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<Error> for IterError

    source§

    fn from(value: Error) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Debug for IterError

    source§

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

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

    impl Display for IterError

    source§

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

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

    impl Error for IterError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<Error> for IterError

    source§

    fn from(value: Error) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    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/bdk_hwi/struct.HWISigner.html b/docs-rs/bdk/nightly/latest/bdk_hwi/struct.HWISigner.html index fa80e34aca..9e331e28a5 100644 --- a/docs-rs/bdk/nightly/latest/bdk_hwi/struct.HWISigner.html +++ b/docs-rs/bdk/nightly/latest/bdk_hwi/struct.HWISigner.html @@ -1,4 +1,4 @@ -HWISigner in bdk_hwi - Rust

    Struct bdk_hwi::HWISigner

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

    Custom signer for Hardware Wallets

    +HWISigner in bdk_hwi - Rust

    Struct bdk_hwi::HWISigner

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

    Custom signer for Hardware Wallets

    This ignores sign_options and leaves the decisions up to the hardware wallet.

    Implementations§

    source§

    impl HWISigner

    source

    pub fn from_device( device: &HWIDevice, @@ -20,4 +20,5 @@

    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 + V: MultiLane<T>,
    §

    fn vzip(self) -> V

    §

    impl<T> Ungil for T
    where + T: Send,

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_persist/struct.CombinedChangeSet.html b/docs-rs/bdk/nightly/latest/bdk_persist/struct.CombinedChangeSet.html index 5e0172c4a9..e752303242 100644 --- a/docs-rs/bdk/nightly/latest/bdk_persist/struct.CombinedChangeSet.html +++ b/docs-rs/bdk/nightly/latest/bdk_persist/struct.CombinedChangeSet.html @@ -9,7 +9,7 @@

    Trait Implementations§

    source§

    impl<K: Ord, A: Anchor> Append for CombinedChangeSet<K, A>

    source§

    fn append(&mut self, other: Self)

    Append another object of the same type onto self.
    source§

    fn is_empty(&self) -> bool

    Returns whether the structure is considered empty.
    source§

    impl<K: Clone, A: Clone> Clone for CombinedChangeSet<K, A>

    source§

    fn clone(&self) -> CombinedChangeSet<K, 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<K: Debug, A: Debug> Debug for CombinedChangeSet<K, A>

    source§

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

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

    impl<K, A> Default for CombinedChangeSet<K, A>

    source§

    fn default() -> Self

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

    impl<'de, K, A> Deserialize<'de> for CombinedChangeSet<K, A>
    where A: Ord + Deserialize<'de>, K: Ord + Deserialize<'de>,

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl<K, A> From<BTreeMap<u32, Option<BlockHash>>> for CombinedChangeSet<K, A>

    source§

    fn from(chain: ChangeSet) -> Self

    Converts to this type from the input type.
    source§

    impl<K, A> From<ChangeSet<A, ChangeSet<K>>> for CombinedChangeSet<K, A>

    source§

    fn from(indexed_tx_graph: ChangeSet<A, ChangeSet<K>>) -> Self

    Converts to this type from the input type.
    source§

    impl<K: PartialEq, A: PartialEq> PartialEq for CombinedChangeSet<K, A>

    source§

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

    This method tests for self and other values to be equal, and is used + __D: Deserializer<'de>,
    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl<K, A> From<BTreeMap<u32, Option<BlockHash>>> for CombinedChangeSet<K, A>

    source§

    fn from(chain: ChangeSet) -> Self

    Converts to this type from the input type.
    source§

    impl<K, A> From<ChangeSet<A, ChangeSet<K>>> for CombinedChangeSet<K, A>

    source§

    fn from(indexed_tx_graph: ChangeSet<A, ChangeSet<K>>) -> Self

    Converts to this type from the input type.
    source§

    impl<K: PartialEq, A: PartialEq> PartialEq for CombinedChangeSet<K, A>

    source§

    fn eq(&self, other: &CombinedChangeSet<K, 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<K, A> Serialize for CombinedChangeSet<K, A>
    where A: Ord + Serialize, diff --git a/docs-rs/bdk/nightly/latest/bdk_sqlite/index.html b/docs-rs/bdk/nightly/latest/bdk_sqlite/index.html index 0b6ed25248..9309c88a10 100644 --- a/docs-rs/bdk/nightly/latest/bdk_sqlite/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_sqlite/index.html @@ -1,4 +1,4 @@ bdk_sqlite - Rust

    Crate bdk_sqlite

    source ·
    Expand description

    §BDK SQLite

    -

    This is a simple SQLite relational database schema backed implementation of PersistBackend.

    +

    This is a simple SQLite relational database schema backed implementation of PersistBackend.

    The main structure is Store which persists bdk_persist CombinedChangeSet data into a SQLite database file.

    Re-exports§

    • pub use rusqlite;

    Structs§

    • Persists data in to a relational schema based SQLite database file.

    Enums§

    • Error that occurs while reading or writing change sets with the SQLite database.
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_sqlite/struct.Store.html b/docs-rs/bdk/nightly/latest/bdk_sqlite/struct.Store.html index 7139392caa..aa0e58d7ee 100644 --- a/docs-rs/bdk/nightly/latest/bdk_sqlite/struct.Store.html +++ b/docs-rs/bdk/nightly/latest/bdk_sqlite/struct.Store.html @@ -3,10 +3,10 @@

    Implementations§

    source§

    impl<K, A> Store<K, A>
    where K: Ord + for<'de> Deserialize<'de> + Serialize + Send, A: Anchor + for<'de> Deserialize<'de> + Serialize + Send,

    source

    pub fn new(conn: Connection) -> Result<Self, Error>

    Creates a new store from a [Connection].

    -

    Trait Implementations§

    source§

    impl<K, A> Debug for Store<K, A>

    source§

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

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

    impl<K, A, C> PersistBackend<C> for Store<K, A>
    where +

    Trait Implementations§

    source§

    impl<K, A> Debug for Store<K, A>

    source§

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

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

    impl<K, A, C> PersistBackend<C> for Store<K, A>
    where K: Ord + for<'de> Deserialize<'de> + Serialize + Send, A: Anchor + for<'de> Deserialize<'de> + Serialize + Send, - C: Clone + From<CombinedChangeSet<K, A>> + Into<CombinedChangeSet<K, A>>,

    source§

    fn write_changes(&mut self, changeset: &C) -> Result<()>

    Writes a changeset to the persistence backend. Read more
    source§

    fn load_from_persistence(&mut self) -> Result<Option<C>>

    Return the aggregate changeset C from persistence.

    Auto Trait Implementations§

    §

    impl<K, A> !Freeze for Store<K, A>

    §

    impl<K, A> RefUnwindSafe for Store<K, A>
    where + C: Clone + From<CombinedChangeSet<K, A>> + Into<CombinedChangeSet<K, A>>,

    source§

    fn write_changes(&mut self, changeset: &C) -> Result<()>

    Writes a changeset to the persistence backend. Read more
    source§

    fn load_from_persistence(&mut self) -> Result<Option<C>>

    Return the aggregate changeset C from persistence.

    Auto Trait Implementations§

    §

    impl<K, A> !Freeze for Store<K, A>

    §

    impl<K, A> RefUnwindSafe for Store<K, A>

    §

    impl<K, A> Send for Store<K, A>
    where K: Send, diff --git a/docs-rs/bdk/nightly/latest/bdk_tmp_plan/enum.RequiredSignatures.html b/docs-rs/bdk/nightly/latest/bdk_tmp_plan/enum.RequiredSignatures.html index 70cbb58340..e1ca05d49e 100644 --- a/docs-rs/bdk/nightly/latest/bdk_tmp_plan/enum.RequiredSignatures.html +++ b/docs-rs/bdk/nightly/latest/bdk_tmp_plan/enum.RequiredSignatures.html @@ -22,7 +22,7 @@

    §

    TapScript

    Taproot script path signatures are required

    Fields

    §leaf_hash: TapLeafHash

    The leaf hash of the script being used

    §plan_keys: Vec<PlanKey<Ak>>

    The keys in the script that require signatures

    -

    Implementations§

    source§

    impl RequiredSignatures<DescriptorPublicKey>

    source

    pub fn sign_with_keymap<T: Borrow<Transaction>>( +

    Implementations§

    source§

    impl RequiredSignatures<DescriptorPublicKey>

    source

    pub fn sign_with_keymap<T: Borrow<Transaction>>( &self, input_index: usize, keymap: &KeyMap, diff --git a/docs-rs/bdk/nightly/latest/bdk_tmp_plan/enum.SigningError.html b/docs-rs/bdk/nightly/latest/bdk_tmp_plan/enum.SigningError.html index aed64d7e1a..c3a4667dfd 100644 --- a/docs-rs/bdk/nightly/latest/bdk_tmp_plan/enum.SigningError.html +++ b/docs-rs/bdk/nightly/latest/bdk_tmp_plan/enum.SigningError.html @@ -1,10 +1,11 @@ -SigningError in bdk_tmp_plan - Rust

    Enum bdk_tmp_plan::SigningError

    source ·
    pub enum SigningError {
    -    SigHashError(Error),
    +SigningError in bdk_tmp_plan - Rust

    Enum bdk_tmp_plan::SigningError

    source ·
    pub enum SigningError {
    +    SigHashP2wpkh(P2wpkhError),
    +    SigHashTaproot(TaprootError),
         DerivationError(Error),
    -}

    Variants§

    §

    SigHashError(Error)

    §

    DerivationError(Error)

    Trait Implementations§

    source§

    impl Clone for SigningError

    source§

    fn clone(&self) -> SigningError

    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 Debug for SigningError

    source§

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

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

    impl Display for SigningError

    source§

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

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

    impl Error for SigningError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<Error> for SigningError

    source§

    fn from(e: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<Error> for SigningError

    source§

    fn from(e: Error) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +}

    Variants§

    §

    SigHashP2wpkh(P2wpkhError)

    §

    SigHashTaproot(TaprootError)

    §

    DerivationError(Error)

    Trait Implementations§

    source§

    impl Clone for SigningError

    source§

    fn clone(&self) -> SigningError

    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 Debug for SigningError

    source§

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

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

    impl Display for SigningError

    source§

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

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

    impl Error for SigningError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<Error> for SigningError

    source§

    fn from(e: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<P2wpkhError> for SigningError

    source§

    fn from(v: P2wpkhError) -> Self

    Converts to this type from the input type.
    source§

    impl From<TaprootError> for SigningError

    source§

    fn from(v: TaprootError) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    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.

    + 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 diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Descriptor.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Descriptor.html index 81b79848be..0057b90bff 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Descriptor.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Descriptor.html @@ -64,7 +64,7 @@ whether the script is malleable.

    In general, all the guarantees of miniscript hold only for safe scripts. The signer may not be able to find satisfactions even if one exists.

    -

    pub fn max_weight_to_satisfy(&self) -> Result<usize, Error>

    Computes an upper bound on the difference between a non-satisfied +

    pub fn max_weight_to_satisfy(&self) -> Result<Weight, Error>

    Computes an upper bound on the difference between a non-satisfied TxIn’s segwit_weight and a satisfied TxIn’s segwit_weight

    Since this method uses segwit_weight instead of legacy_weight, if you want to include only legacy inputs in your transaction, @@ -95,7 +95,7 @@ sighash suffix.

    §Errors

    When the descriptor is impossible to safisfy (ex: sh(OP_FALSE)).

    -

    pub fn max_satisfaction_weight(&self) -> Result<usize, Error>

    👎Deprecated: use max_weight_to_satisfy instead

    Computes an upper bound on the weight of a satisfying witness to the +

    pub fn max_satisfaction_weight(&self) -> Result<usize, Error>

    👎Deprecated since 10.0.0: Use max_weight_to_satisfy instead. The method to count bytes was redesigned and the results will differ from max_weight_to_satisfy. For more details check rust-bitcoin/rust-miniscript#476.

    Computes an upper bound on the weight of a satisfying witness to the transaction.

    Assumes all ec-signatures are 73 bytes, including push opcode and sighash suffix. Includes the weight of the VarInts encoding the @@ -239,20 +239,11 @@

    §Errors
    Pk: MiniscriptKey,
    §

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

    Formats the value using the given formatter. Read more
    §

    impl DescriptorExt for Descriptor<DescriptorPublicKey>

    §

    fn dust_value(&self) -> u64

    Returns the minimum value (in satoshis) at which an output is broadcastable. Panics if the descriptor wildcard is hardened.
    §

    fn descriptor_id(&self) -> DescriptorId

    Returns the descriptor id, calculated as the sha256 of the descriptor, checksum not included.
    §

    impl<'de, Pk> Deserialize<'de> for Descriptor<Pk>
    where - Pk: MiniscriptKey + FromStr, - <Pk as MiniscriptKey>::Sha256: FromStr, - <Pk as MiniscriptKey>::Hash256: FromStr, - <Pk as MiniscriptKey>::Ripemd160: FromStr, - <Pk as MiniscriptKey>::Hash160: FromStr, - <Pk as FromStr>::Err: Display, - <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: Display, - <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: Display, - <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: Display, - <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: Display,

    §

    fn deserialize<D>( + Pk: FromStrKey,

    §

    fn deserialize<D>( deserializer: D ) -> Result<Descriptor<Pk>, <D as Deserializer<'de>>::Error>
    where D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    §

    impl<Pk> Display for Descriptor<Pk>
    where - Pk: MiniscriptKey,

    §

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

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

    impl ExtractPolicy for Descriptor<DescriptorPublicKey>

    source§

    fn extract_policy( + Pk: MiniscriptKey,

    §

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

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

    impl ExtractPolicy for Descriptor<DescriptorPublicKey>

    source§

    fn extract_policy( &self, signers: &SignersContainer, build_sat: BuildSatisfaction<'_>, @@ -264,32 +255,14 @@

    §Errors
    F: FnMut(&'a Pk) -> bool, Pk: 'a,
    Run a predicate on every key in the descriptor, returning whether the predicate returned true for any key
    §

    impl<Pk> From<Bare<Pk>> for Descriptor<Pk>
    where - Pk: MiniscriptKey,

    §

    fn from(inner: Bare<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    §

    impl<Pk> From<Pkh<Pk>> for Descriptor<Pk>
    where + Pk: MiniscriptKey,

    §

    fn from(inner: Bare<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    §

    impl<Pk> From<Pkh<Pk>> for Descriptor<Pk>
    where Pk: MiniscriptKey,

    §

    fn from(inner: Pkh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    §

    impl<Pk> From<Sh<Pk>> for Descriptor<Pk>
    where - Pk: MiniscriptKey,

    §

    fn from(inner: Sh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    §

    impl<Pk> From<Tr<Pk>> for Descriptor<Pk>
    where - Pk: MiniscriptKey,

    §

    fn from(inner: Tr<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    §

    impl<Pk> From<Wpkh<Pk>> for Descriptor<Pk>
    where - Pk: MiniscriptKey,

    §

    fn from(inner: Wpkh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    §

    impl<Pk> From<Wsh<Pk>> for Descriptor<Pk>
    where - Pk: MiniscriptKey,

    §

    fn from(inner: Wsh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    §

    impl<Pk> FromStr for Descriptor<Pk>
    where - Pk: MiniscriptKey + FromStr, - <Pk as MiniscriptKey>::Sha256: FromStr, - <Pk as MiniscriptKey>::Hash256: FromStr, - <Pk as MiniscriptKey>::Ripemd160: FromStr, - <Pk as MiniscriptKey>::Hash160: FromStr, - <Pk as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,

    §

    type Err = Error

    The associated error which can be returned from parsing.
    §

    fn from_str(s: &str) -> Result<Descriptor<Pk>, Error>

    Parses a string s to return a value of this type. Read more
    §

    impl<Pk> FromTree for Descriptor<Pk>
    where - Pk: MiniscriptKey + FromStr, - <Pk as MiniscriptKey>::Sha256: FromStr, - <Pk as MiniscriptKey>::Hash256: FromStr, - <Pk as MiniscriptKey>::Ripemd160: FromStr, - <Pk as MiniscriptKey>::Hash160: FromStr, - <Pk as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,

    §

    fn from_tree(top: &Tree<'_>) -> Result<Descriptor<Pk>, Error>

    Parse an expression tree into a descriptor.

    + Pk: MiniscriptKey,
    §

    fn from(inner: Sh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    §

    impl<Pk> From<Tr<Pk>> for Descriptor<Pk>
    where + Pk: MiniscriptKey,

    §

    fn from(inner: Tr<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    §

    impl<Pk> From<Wpkh<Pk>> for Descriptor<Pk>
    where + Pk: MiniscriptKey,

    §

    fn from(inner: Wpkh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    §

    impl<Pk> From<Wsh<Pk>> for Descriptor<Pk>
    where + Pk: MiniscriptKey,

    §

    fn from(inner: Wsh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    §

    impl<Pk> FromStr for Descriptor<Pk>
    where + Pk: FromStrKey,

    §

    type Err = Error

    The associated error which can be returned from parsing.
    §

    fn from_str(s: &str) -> Result<Descriptor<Pk>, Error>

    Parses a string s to return a value of this type. Read more
    §

    impl<Pk> FromTree for Descriptor<Pk>
    where + Pk: FromStrKey,

    §

    fn from_tree(top: &Tree<'_>) -> Result<Descriptor<Pk>, Error>

    Parse an expression tree into a descriptor.

    §

    impl<Pk> Hash for Descriptor<Pk>
    where Pk: Hash + MiniscriptKey,

    §

    fn hash<__H>(&self, state: &mut __H)
    where __H: Hasher,

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.DescriptorPublicKey.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.DescriptorPublicKey.html index b94ca78409..5ad1b85e3b 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.DescriptorPublicKey.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.DescriptorPublicKey.html @@ -1,4 +1,4 @@ -DescriptorPublicKey in bdk_wallet::descriptor - Rust

    Enum bdk_wallet::descriptor::DescriptorPublicKey

    pub enum DescriptorPublicKey {
    +DescriptorPublicKey in bdk_wallet::descriptor - Rust

    Enum bdk_wallet::descriptor::DescriptorPublicKey

    pub enum DescriptorPublicKey {
         Single(SinglePub),
         XPub(DescriptorXKey<Xpub>),
         MultiXPub(DescriptorMultiXKey<Xpub>),
    @@ -52,7 +52,7 @@ 
    §Errors
    ) -> Result<DescriptorPublicKey, <DescriptorPublicKey as FromStr>::Err>

    Parses a string s to return a value of this type. Read more
    §

    impl Hash for DescriptorPublicKey

    §

    fn hash<__H>(&self, state: &mut __H)
    where __H: Hasher,

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where H: Hasher, - Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    §

    impl IntoAssets for DescriptorPublicKey

    §

    fn into_assets(self) -> Assets

    Convert self into a Assets struct
    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorPublicKey

    source§

    fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError>

    Turn the key into a DescriptorKey within the requested ScriptContext
    §

    impl MiniscriptKey for DescriptorPublicKey

    §

    type Sha256 = Hash

    The associated [bitcoin::hashes::sha256::Hash] for this [MiniscriptKey], used in the + Self: Sized,
    Feeds a slice of this type into the given Hasher. Read more
    §

    impl IntoAssets for DescriptorPublicKey

    §

    fn into_assets(self) -> Assets

    Convert self into a Assets struct
    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorPublicKey

    source§

    fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError>

    Turn the key into a DescriptorKey within the requested ScriptContext
    §

    impl MiniscriptKey for DescriptorPublicKey

    §

    type Sha256 = Hash

    The associated [bitcoin::hashes::sha256::Hash] for this [MiniscriptKey], used in the sha256 fragment.
    §

    type Hash256 = Hash

    The associated [miniscript::hash256::Hash] for this [MiniscriptKey], used in the hash256 fragment.
    §

    type Ripemd160 = Hash

    The associated [bitcoin::hashes::ripemd160::Hash] for this [MiniscriptKey] type, used in the ripemd160 fragment.
    §

    type Hash160 = Hash

    The associated [bitcoin::hashes::hash160::Hash] for this [MiniscriptKey] type, used in @@ -72,7 +72,17 @@
    §Errors
    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 +

    §

    impl<T> FromStrKey for T
    where + T: MiniscriptKey + FromStr, + <T as MiniscriptKey>::Sha256: FromStr, + <T as MiniscriptKey>::Hash256: FromStr, + <T as MiniscriptKey>::Ripemd160: FromStr, + <T as MiniscriptKey>::Hash160: FromStr, + <T as FromStr>::Err: Debug + Display, + <<T as MiniscriptKey>::Sha256 as FromStr>::Err: Debug + Display, + <<T as MiniscriptKey>::Hash256 as FromStr>::Err: Debug + Display, + <<T as MiniscriptKey>::Ripemd160 as FromStr>::Err: Debug + Display, + <<T as MiniscriptKey>::Hash160 as FromStr>::Err: Debug + Display,

    §

    type _Sha256 = <T as MiniscriptKey>::Sha256

    Dummy type. Do not use.
    §

    type _Sha256FromStrErr = <<T as MiniscriptKey>::Sha256 as FromStr>::Err

    Dummy type. Do not use.
    §

    type _Hash256 = <T as MiniscriptKey>::Hash256

    Dummy type. Do not use.
    §

    type _Hash256FromStrErr = <<T as MiniscriptKey>::Hash256 as FromStr>::Err

    Dummy type. Do not use.
    §

    type _Ripemd160 = <T as MiniscriptKey>::Ripemd160

    Dummy type. Do not use.
    §

    type _Ripemd160FromStrErr = <<T as MiniscriptKey>::Ripemd160 as FromStr>::Err

    Dummy type. Do not use.
    §

    type _Hash160 = <T as MiniscriptKey>::Hash160

    Dummy type. Do not use.
    §

    type _Hash160FromStrErr = <<T as MiniscriptKey>::Hash160 as FromStr>::Err

    Dummy type. Do not use.
    §

    type _FromStrErr = <T as FromStr>::Err

    Dummy type. Do not use.
    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.

    diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Legacy.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Legacy.html index 18aa04ba4c..1c0d54dfac 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Legacy.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Legacy.html @@ -26,8 +26,7 @@ Pk: MiniscriptKey,
    Each context has slightly different rules on what Pks are allowed in descriptors Legacy/Bare does not allow x_only keys Segwit does not allow uncompressed keys and x_only keys -Tapscript does not allow uncompressed keys
    §

    fn check_witness<Pk>(witness: &[Vec<u8>]) -> Result<(), ScriptContextError>
    where - Pk: MiniscriptKey,

    Check whether the given satisfaction is valid under the ScriptContext +Tapscript does not allow uncompressed keys
    §

    fn check_witness(witness: &[Vec<u8>]) -> Result<(), ScriptContextError>

    Check whether the given satisfaction is valid under the ScriptContext For example, segwit satisfactions may fail if the witness len is more 3600 or number of stack elements are more than 100.
    §

    fn check_global_consensus_validity<Pk>( ms: &Miniscript<Pk, Legacy> diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Segwitv0.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Segwitv0.html index f968c4ca07..0af89f76d4 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Segwitv0.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Segwitv0.html @@ -23,8 +23,7 @@ Pk: MiniscriptKey,

    Each context has slightly different rules on what Pks are allowed in descriptors Legacy/Bare does not allow x_only keys Segwit does not allow uncompressed keys and x_only keys -Tapscript does not allow uncompressed keys
    §

    fn check_witness<Pk>(witness: &[Vec<u8>]) -> Result<(), ScriptContextError>
    where - Pk: MiniscriptKey,

    Check whether the given satisfaction is valid under the ScriptContext +Tapscript does not allow uncompressed keys
    §

    fn check_witness(witness: &[Vec<u8>]) -> Result<(), ScriptContextError>

    Check whether the given satisfaction is valid under the ScriptContext For example, segwit satisfactions may fail if the witness len is more 3600 or number of stack elements are more than 100.
    §

    fn check_global_consensus_validity<Pk>( ms: &Miniscript<Pk, Segwitv0> diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/error/enum.Error.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/error/enum.Error.html index cac965e3ff..d1d09c9ff6 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/error/enum.Error.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/error/enum.Error.html @@ -1,4 +1,4 @@ -Error in bdk_wallet::descriptor::error - Rust

    Enum bdk_wallet::descriptor::error::Error

    source ·
    pub enum Error {
    +Error in bdk_wallet::descriptor::error - Rust

    Enum bdk_wallet::descriptor::error::Error

    source ·
    pub enum Error {
     
    Show 13 variants InvalidHdKeyPath, InvalidDescriptorChecksum, HardenedDerivationXpub, @@ -8,7 +8,7 @@ InvalidDescriptorCharacter(u8), Bip32(Error), Base58(Error), - Pk(Error), + Pk(ParsePublicKeyError), Miniscript(Error), Hex(HexToBytesError), ExternalAndInternalAreTheSame, @@ -22,11 +22,11 @@
    §

    InvalidDescriptorCharacter(u8)

    Invalid byte found in the descriptor checksum

    §

    Bip32(Error)

    BIP32 error

    §

    Base58(Error)

    Error during base58 decoding

    -
    §

    Pk(Error)

    Key-related error

    +
    §

    Pk(ParsePublicKeyError)

    Key-related error

    §

    Miniscript(Error)

    Miniscript error

    §

    Hex(HexToBytesError)

    Hex decoding error

    §

    ExternalAndInternalAreTheSame

    The provided wallet descriptors are identical

    -

    Trait Implementations§

    source§

    impl Debug for Error

    source§

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

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

    impl Display for Error

    source§

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

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

    impl Error for Error

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<Error> for CreateTxError

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<Error> for Error

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<Error> for Error

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<Error> for Error

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<Error> for Error

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<HexToBytesError> for Error

    source§

    fn from(err: HexToBytesError) -> Self

    Converts to this type from the input type.
    source§

    impl From<KeyError> for Error

    source§

    fn from(key_error: KeyError) -> Error

    Converts to this type from the input type.
    source§

    impl From<PolicyError> for Error

    source§

    fn from(err: PolicyError) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    §

    impl Freeze for Error

    §

    impl RefUnwindSafe for Error

    §

    impl Send for Error

    §

    impl Sync for Error

    §

    impl Unpin for Error

    §

    impl UnwindSafe for Error

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Debug for Error

    source§

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

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

    impl Display for Error

    source§

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

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

    impl Error for Error

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<Error> for CreateTxError

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<Error> for Error

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<Error> for Error

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<Error> for Error

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<HexToBytesError> for Error

    source§

    fn from(err: HexToBytesError) -> Self

    Converts to this type from the input type.
    source§

    impl From<KeyError> for Error

    source§

    fn from(key_error: KeyError) -> Error

    Converts to this type from the input type.
    source§

    impl From<ParsePublicKeyError> for Error

    source§

    fn from(err: ParsePublicKeyError) -> Self

    Converts to this type from the input type.
    source§

    impl From<PolicyError> for Error

    source§

    fn from(err: PolicyError) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    §

    impl Freeze for Error

    §

    impl RefUnwindSafe for Error

    §

    impl Send for Error

    §

    impl Sync for Error

    §

    impl Unpin for Error

    §

    impl UnwindSafe for Error

    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/bdk_wallet/descriptor/policy/enum.BuildSatisfaction.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.BuildSatisfaction.html index f6b3135551..a636114cfc 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.BuildSatisfaction.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.BuildSatisfaction.html @@ -1,4 +1,4 @@ -BuildSatisfaction in bdk_wallet::descriptor::policy - Rust

    Enum bdk_wallet::descriptor::policy::BuildSatisfaction

    source ·
    pub enum BuildSatisfaction<'a> {
    +BuildSatisfaction in bdk_wallet::descriptor::policy - Rust

    Enum bdk_wallet::descriptor::policy::BuildSatisfaction

    source ·
    pub enum BuildSatisfaction<'a> {
         None,
         Psbt(&'a Psbt),
         PsbtTimelocks {
    @@ -14,7 +14,7 @@
     
    §current_height: u32

    Current blockchain height

    §input_max_height: u32

    The highest confirmation height between the inputs CSV should consider different inputs, but we consider the worst condition for the tx as whole

    -

    Trait Implementations§

    source§

    impl<'a> Clone for BuildSatisfaction<'a>

    source§

    fn clone(&self) -> BuildSatisfaction<'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 for BuildSatisfaction<'a>

    source§

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

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

    impl<'a> Copy for BuildSatisfaction<'a>

    Auto Trait Implementations§

    §

    impl<'a> Freeze for BuildSatisfaction<'a>

    §

    impl<'a> RefUnwindSafe for BuildSatisfaction<'a>

    §

    impl<'a> Send for BuildSatisfaction<'a>

    §

    impl<'a> Sync for BuildSatisfaction<'a>

    §

    impl<'a> Unpin for BuildSatisfaction<'a>

    §

    impl<'a> UnwindSafe for BuildSatisfaction<'a>

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl<'a> Clone for BuildSatisfaction<'a>

    source§

    fn clone(&self) -> BuildSatisfaction<'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 for BuildSatisfaction<'a>

    source§

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

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

    impl<'a> Copy for BuildSatisfaction<'a>

    Auto Trait Implementations§

    §

    impl<'a> Freeze for BuildSatisfaction<'a>

    §

    impl<'a> RefUnwindSafe for BuildSatisfaction<'a>

    §

    impl<'a> Send for BuildSatisfaction<'a>

    §

    impl<'a> Sync for BuildSatisfaction<'a>

    §

    impl<'a> Unpin for BuildSatisfaction<'a>

    §

    impl<'a> UnwindSafe for BuildSatisfaction<'a>

    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/bdk_wallet/descriptor/policy/enum.PkOrF.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.PkOrF.html index 96c4398712..bc2a4cb6ba 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.PkOrF.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.PkOrF.html @@ -1,4 +1,4 @@ -PkOrF in bdk_wallet::descriptor::policy - Rust

    Enum bdk_wallet::descriptor::policy::PkOrF

    source ·
    pub enum PkOrF {
    +PkOrF in bdk_wallet::descriptor::policy - Rust

    Enum bdk_wallet::descriptor::policy::PkOrF

    source ·
    pub enum PkOrF {
         Pubkey(PublicKey),
         XOnlyPubkey(XOnlyPublicKey),
         Fingerprint(Fingerprint),
    @@ -6,12 +6,12 @@
     

    Variants§

    §

    Pubkey(PublicKey)

    A legacy public key

    §

    XOnlyPubkey(XOnlyPublicKey)

    A x-only public key

    §

    Fingerprint(Fingerprint)

    An extended key fingerprint

    -

    Trait Implementations§

    source§

    impl Clone for PkOrF

    source§

    fn clone(&self) -> PkOrF

    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 Debug for PkOrF

    source§

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

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

    impl Hash for PkOrF

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where +

    Trait Implementations§

    source§

    impl Clone for PkOrF

    source§

    fn clone(&self) -> PkOrF

    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 Debug for PkOrF

    source§

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

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

    impl Hash for PkOrF

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where H: Hasher, - Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    source§

    impl PartialEq for PkOrF

    source§

    fn eq(&self, other: &PkOrF) -> bool

    This method tests for self and other values to be equal, and is used + Self: Sized,
    Feeds a slice of this type into the given Hasher. Read more
    source§

    impl PartialEq for PkOrF

    source§

    fn eq(&self, other: &PkOrF) -> 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 Serialize for PkOrF

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where - __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl Eq for PkOrF

    source§

    impl StructuralPartialEq for PkOrF

    Auto Trait Implementations§

    §

    impl Freeze for PkOrF

    §

    impl RefUnwindSafe for PkOrF

    §

    impl Send for PkOrF

    §

    impl Sync for PkOrF

    §

    impl Unpin for PkOrF

    §

    impl UnwindSafe for PkOrF

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +sufficient, and should not be overridden without very good reason.

    source§

    impl Serialize for PkOrF

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where + __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl Eq for PkOrF

    source§

    impl StructuralPartialEq for PkOrF

    Auto Trait Implementations§

    §

    impl Freeze for PkOrF

    §

    impl RefUnwindSafe for PkOrF

    §

    impl Send for PkOrF

    §

    impl Sync for PkOrF

    §

    impl Unpin for PkOrF

    §

    impl UnwindSafe for PkOrF

    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/bdk_wallet/descriptor/policy/enum.PolicyError.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.PolicyError.html index 8ff09f8870..1b0bc5ab28 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.PolicyError.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.PolicyError.html @@ -1,4 +1,4 @@ -PolicyError in bdk_wallet::descriptor::policy - Rust

    Enum bdk_wallet::descriptor::policy::PolicyError

    source ·
    pub enum PolicyError {
    +PolicyError in bdk_wallet::descriptor::policy - Rust

    Enum bdk_wallet::descriptor::policy::PolicyError

    source ·
    pub enum PolicyError {
         NotEnoughItemsSelected(String),
         IndexOutOfRange(usize),
         AddOnLeaf,
    @@ -12,9 +12,9 @@
     
    §

    AddOnPartialComplete

    Can not add to an item that is Satisfaction::PartialComplete

    §

    MixedTimelockUnits

    Can not merge CSV or timelock values unless both are less than or both are equal or greater than 500_000_000

    §

    IncompatibleConditions

    Incompatible conditions (not currently used)

    -

    Trait Implementations§

    source§

    impl Debug for PolicyError

    source§

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

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

    impl Display for PolicyError

    source§

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

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

    impl Error for PolicyError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<PolicyError> for CreateTxError

    source§

    fn from(err: PolicyError) -> Self

    Converts to this type from the input type.
    source§

    impl From<PolicyError> for Error

    source§

    fn from(err: PolicyError) -> Self

    Converts to this type from the input type.
    source§

    impl PartialEq for PolicyError

    source§

    fn eq(&self, other: &PolicyError) -> bool

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

    Trait Implementations§

    source§

    impl Debug for PolicyError

    source§

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

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

    impl Display for PolicyError

    source§

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

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

    impl Error for PolicyError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<PolicyError> for CreateTxError

    source§

    fn from(err: PolicyError) -> Self

    Converts to this type from the input type.
    source§

    impl From<PolicyError> for Error

    source§

    fn from(err: PolicyError) -> Self

    Converts to this type from the input type.
    source§

    impl PartialEq for PolicyError

    source§

    fn eq(&self, other: &PolicyError) -> 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 Eq for PolicyError

    source§

    impl StructuralPartialEq for PolicyError

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +sufficient, and should not be overridden without very good reason.

    source§

    impl Eq for PolicyError

    source§

    impl StructuralPartialEq for PolicyError

    Auto Trait Implementations§

    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/bdk_wallet/descriptor/policy/enum.Satisfaction.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.Satisfaction.html index ce99f39932..7b97aa55c1 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.Satisfaction.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.Satisfaction.html @@ -1,4 +1,4 @@ -Satisfaction in bdk_wallet::descriptor::policy - Rust

    Enum bdk_wallet::descriptor::policy::Satisfaction

    source ·
    pub enum Satisfaction {
    +Satisfaction in bdk_wallet::descriptor::policy - Rust

    Enum bdk_wallet::descriptor::policy::Satisfaction

    source ·
    pub enum Satisfaction {
         Partial {
             n: usize,
             m: usize,
    @@ -33,11 +33,11 @@
     
    §

    Complete

    Can satisfy the policy item

    Fields

    §condition: Condition

    Extra conditions that also need to be satisfied

    §

    None

    Cannot satisfy or contribute to the policy item

    -

    Implementations§

    source§

    impl Satisfaction

    source

    pub fn is_leaf(&self) -> bool

    Returns whether the Satisfaction is a leaf item

    -

    Trait Implementations§

    source§

    impl Clone for Satisfaction

    source§

    fn clone(&self) -> Satisfaction

    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 Debug for Satisfaction

    source§

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

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

    impl From<bool> for Satisfaction

    source§

    fn from(other: bool) -> Self

    Converts to this type from the input type.
    source§

    impl PartialEq for Satisfaction

    source§

    fn eq(&self, other: &Satisfaction) -> bool

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

    Implementations§

    source§

    impl Satisfaction

    source

    pub fn is_leaf(&self) -> bool

    Returns whether the Satisfaction is a leaf item

    +

    Trait Implementations§

    source§

    impl Clone for Satisfaction

    source§

    fn clone(&self) -> Satisfaction

    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 Debug for Satisfaction

    source§

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

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

    impl From<bool> for Satisfaction

    source§

    fn from(other: bool) -> Self

    Converts to this type from the input type.
    source§

    impl PartialEq for Satisfaction

    source§

    fn eq(&self, other: &Satisfaction) -> 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 Serialize for Satisfaction

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where - __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl Eq for Satisfaction

    source§

    impl StructuralPartialEq for Satisfaction

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +sufficient, and should not be overridden without very good reason.

    source§

    impl Serialize for Satisfaction

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where + __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl Eq for Satisfaction

    source§

    impl StructuralPartialEq for Satisfaction

    Auto Trait Implementations§

    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/bdk_wallet/descriptor/policy/enum.SatisfiableItem.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.SatisfiableItem.html index e367ec8cea..18bc68e242 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.SatisfiableItem.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/enum.SatisfiableItem.html @@ -1,4 +1,4 @@ -SatisfiableItem in bdk_wallet::descriptor::policy - Rust

    Enum bdk_wallet::descriptor::policy::SatisfiableItem

    source ·
    pub enum SatisfiableItem {
    +SatisfiableItem in bdk_wallet::descriptor::policy - Rust

    Enum bdk_wallet::descriptor::policy::SatisfiableItem

    source ·
    pub enum SatisfiableItem {
         EcdsaSignature(PkOrF),
         SchnorrSignature(PkOrF),
         Sha256Preimage {
    @@ -17,7 +17,7 @@
             value: LockTime,
         },
         RelativeTimelock {
    -        value: Sequence,
    +        value: LockTime,
         },
         Multisig {
             keys: Vec<PkOrF>,
    @@ -41,19 +41,19 @@
     
    §

    AbsoluteTimelock

    Absolute timeclock timestamp

    Fields

    §value: LockTime

    The timelock value

    §

    RelativeTimelock

    Relative timelock locktime

    -

    Fields

    §value: Sequence

    The timelock value

    +

    Fields

    §value: LockTime

    The timelock value

    §

    Multisig

    Multi-signature public keys with threshold count

    Fields

    §keys: Vec<PkOrF>

    The raw public key or extended key fingerprint

    §threshold: usize

    The required threshold count

    §

    Thresh

    Threshold items with threshold count

    Fields

    §items: Vec<Policy>

    The policy items

    §threshold: usize

    The required threshold count

    -

    Implementations§

    source§

    impl SatisfiableItem

    source

    pub fn is_leaf(&self) -> bool

    Returns whether the SatisfiableItem is a leaf item

    -
    source

    pub fn id(&self) -> String

    Returns a unique id for the SatisfiableItem

    -

    Trait Implementations§

    source§

    impl Clone for SatisfiableItem

    source§

    fn clone(&self) -> SatisfiableItem

    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 Debug for SatisfiableItem

    source§

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

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

    impl From<SatisfiableItem> for Policy

    source§

    fn from(other: SatisfiableItem) -> Self

    Converts to this type from the input type.
    source§

    impl PartialEq for SatisfiableItem

    source§

    fn eq(&self, other: &SatisfiableItem) -> bool

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

    Implementations§

    source§

    impl SatisfiableItem

    source

    pub fn is_leaf(&self) -> bool

    Returns whether the SatisfiableItem is a leaf item

    +
    source

    pub fn id(&self) -> String

    Returns a unique id for the SatisfiableItem

    +

    Trait Implementations§

    source§

    impl Clone for SatisfiableItem

    source§

    fn clone(&self) -> SatisfiableItem

    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 Debug for SatisfiableItem

    source§

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

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

    impl From<SatisfiableItem> for Policy

    source§

    fn from(other: SatisfiableItem) -> Self

    Converts to this type from the input type.
    source§

    impl PartialEq for SatisfiableItem

    source§

    fn eq(&self, other: &SatisfiableItem) -> 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 Serialize for SatisfiableItem

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where - __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl Eq for SatisfiableItem

    source§

    impl StructuralPartialEq for SatisfiableItem

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +sufficient, and should not be overridden without very good reason.

    source§

    impl Serialize for SatisfiableItem

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where + __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl Eq for SatisfiableItem

    source§

    impl StructuralPartialEq for SatisfiableItem

    Auto Trait Implementations§

    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/bdk_wallet/descriptor/policy/struct.Condition.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/struct.Condition.html index 824caed38c..67889ec975 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/struct.Condition.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/struct.Condition.html @@ -1,19 +1,19 @@ -Condition in bdk_wallet::descriptor::policy - Rust

    Struct bdk_wallet::descriptor::policy::Condition

    source ·
    pub struct Condition {
    +Condition in bdk_wallet::descriptor::policy - Rust

    Struct bdk_wallet::descriptor::policy::Condition

    source ·
    pub struct Condition {
         pub csv: Option<Sequence>,
         pub timelock: Option<LockTime>,
     }
    Expand description

    An extra condition that must be satisfied but that is out of control of the user TODO: use bitcoin::LockTime and bitcoin::Sequence

    Fields§

    §csv: Option<Sequence>

    Optional CheckSequenceVerify condition

    §timelock: Option<LockTime>

    Optional timelock condition

    -

    Implementations§

    source§

    impl Condition

    source

    pub fn is_null(&self) -> bool

    Returns true if there are no extra conditions to verify

    -

    Trait Implementations§

    source§

    impl Clone for Condition

    source§

    fn clone(&self) -> Condition

    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 Debug for Condition

    source§

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

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

    impl Default for Condition

    source§

    fn default() -> Condition

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

    impl Hash for Condition

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where +

    Implementations§

    source§

    impl Condition

    source

    pub fn is_null(&self) -> bool

    Returns true if there are no extra conditions to verify

    +

    Trait Implementations§

    source§

    impl Clone for Condition

    source§

    fn clone(&self) -> Condition

    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 Debug for Condition

    source§

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

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

    impl Default for Condition

    source§

    fn default() -> Condition

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

    impl Hash for Condition

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where H: Hasher, - Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    source§

    impl PartialEq for Condition

    source§

    fn eq(&self, other: &Condition) -> bool

    This method tests for self and other values to be equal, and is used + Self: Sized,
    Feeds a slice of this type into the given Hasher. Read more
    source§

    impl PartialEq for Condition

    source§

    fn eq(&self, other: &Condition) -> 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 PartialOrd for Condition

    source§

    fn partial_cmp(&self, other: &Condition) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

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

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

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

    This method tests less than or equal to (for self and other) and is used by the <= +sufficient, and should not be overridden without very good reason.
    source§

    impl PartialOrd for Condition

    source§

    fn partial_cmp(&self, other: &Condition) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

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

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

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

    This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
    1.0.0 · source§

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

    This method tests greater than (for self and other) and is used by the > operator. Read more
    1.0.0 · source§

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

    This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
    source§

    impl Serialize for Condition

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where - __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl Copy for Condition

    source§

    impl Eq for Condition

    source§

    impl StructuralPartialEq for Condition

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +operator. Read more

    source§

    impl Serialize for Condition

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where + __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl Copy for Condition

    source§

    impl Eq for Condition

    source§

    impl StructuralPartialEq for Condition

    Auto Trait Implementations§

    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/bdk_wallet/descriptor/policy/struct.Policy.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/struct.Policy.html index f463b12514..1650d79b1a 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/struct.Policy.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/struct.Policy.html @@ -1,4 +1,4 @@ -Policy in bdk_wallet::descriptor::policy - Rust

    Struct bdk_wallet::descriptor::policy::Policy

    source ·
    pub struct Policy {
    +Policy in bdk_wallet::descriptor::policy - Rust

    Struct bdk_wallet::descriptor::policy::Policy

    source ·
    pub struct Policy {
         pub id: String,
         pub item: SatisfiableItem,
         pub satisfaction: Satisfaction,
    @@ -8,20 +8,20 @@
     
    §item: SatisfiableItem

    Type of this policy node

    §satisfaction: Satisfaction

    How much a given PSBT already satisfies this policy node in terms of signatures

    §contribution: Satisfaction

    How the wallet’s descriptor can satisfy this policy node

    -

    Implementations§

    source§

    impl Policy

    source

    pub fn requires_path(&self) -> bool

    Return whether or not a specific path in the policy tree is required to unambiguously +

    Implementations§

    source§

    impl Policy

    source

    pub fn requires_path(&self) -> bool

    Return whether or not a specific path in the policy tree is required to unambiguously create a transaction

    What this means is that for some spending policies the user should select which paths in the tree it intends to satisfy while signing, because the transaction must be created differently based on that.

    -
    source

    pub fn get_condition( +

    source

    pub fn get_condition( &self, path: &BTreeMap<String, Vec<usize>> ) -> Result<Condition, PolicyError>

    Return the conditions that are set by the spending policy for a given path in the policy tree

    -

    Trait Implementations§

    source§

    impl Clone for Policy

    source§

    fn clone(&self) -> Policy

    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 Debug for Policy

    source§

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

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

    impl From<SatisfiableItem> for Policy

    source§

    fn from(other: SatisfiableItem) -> Self

    Converts to this type from the input type.
    source§

    impl PartialEq for Policy

    source§

    fn eq(&self, other: &Policy) -> bool

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

    Trait Implementations§

    source§

    impl Clone for Policy

    source§

    fn clone(&self) -> Policy

    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 Debug for Policy

    source§

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

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

    impl From<SatisfiableItem> for Policy

    source§

    fn from(other: SatisfiableItem) -> Self

    Converts to this type from the input type.
    source§

    impl PartialEq for Policy

    source§

    fn eq(&self, other: &Policy) -> 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 Serialize for Policy

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where - __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl Eq for Policy

    source§

    impl StructuralPartialEq for Policy

    Auto Trait Implementations§

    §

    impl Freeze for Policy

    §

    impl RefUnwindSafe for Policy

    §

    impl Send for Policy

    §

    impl Sync for Policy

    §

    impl Unpin for Policy

    §

    impl UnwindSafe for Policy

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +sufficient, and should not be overridden without very good reason.

    source§

    impl Serialize for Policy

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where + __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl Eq for Policy

    source§

    impl StructuralPartialEq for Policy

    Auto Trait Implementations§

    §

    impl Freeze for Policy

    §

    impl RefUnwindSafe for Policy

    §

    impl Send for Policy

    §

    impl Sync for Policy

    §

    impl Unpin for Policy

    §

    impl UnwindSafe for Policy

    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/bdk_wallet/descriptor/policy/type.ConditionMap.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/type.ConditionMap.html index 52dc4f427e..6ee150a544 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/type.ConditionMap.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/type.ConditionMap.html @@ -1,2 +1,2 @@ -ConditionMap in bdk_wallet::descriptor::policy - Rust

    Type Alias bdk_wallet::descriptor::policy::ConditionMap

    source ·
    pub type ConditionMap = BTreeMap<usize, HashSet<Condition>>;
    Expand description

    Type for a map of sets of Condition items keyed by each set’s index

    +ConditionMap in bdk_wallet::descriptor::policy - Rust

    Type Alias bdk_wallet::descriptor::policy::ConditionMap

    source ·
    pub type ConditionMap = BTreeMap<usize, HashSet<Condition>>;
    Expand description

    Type for a map of sets of Condition items keyed by each set’s index

    Aliased Type§

    struct ConditionMap { /* private fields */ }
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/type.FoldedConditionMap.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/type.FoldedConditionMap.html index 5fd8bffd2a..bcd2a210fb 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/type.FoldedConditionMap.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/policy/type.FoldedConditionMap.html @@ -1,2 +1,2 @@ -FoldedConditionMap in bdk_wallet::descriptor::policy - Rust

    Type Alias bdk_wallet::descriptor::policy::FoldedConditionMap

    source ·
    pub type FoldedConditionMap = BTreeMap<Vec<usize>, HashSet<Condition>>;
    Expand description

    Type for a map of folded sets of Condition items keyed by a vector of the combined set’s indexes

    +FoldedConditionMap in bdk_wallet::descriptor::policy - Rust

    Type Alias bdk_wallet::descriptor::policy::FoldedConditionMap

    source ·
    pub type FoldedConditionMap = BTreeMap<Vec<usize>, HashSet<Condition>>;
    Expand description

    Type for a map of folded sets of Condition items keyed by a vector of the combined set’s indexes

    Aliased Type§

    struct FoldedConditionMap { /* private fields */ }
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/struct.Miniscript.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/struct.Miniscript.html index 7106eceea3..5ce3efd4a3 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/struct.Miniscript.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/struct.Miniscript.html @@ -1,4 +1,4 @@ -Miniscript in bdk_wallet::descriptor - Rust

    Struct bdk_wallet::descriptor::Miniscript

    pub struct Miniscript<Pk, Ctx>
    where +Miniscript in bdk_wallet::descriptor - Rust

    Struct bdk_wallet::descriptor::Miniscript

    pub struct Miniscript<Pk, Ctx>
    where Pk: MiniscriptKey, Ctx: ScriptContext,
    { pub node: Terminal<Pk, Ctx>, @@ -43,7 +43,9 @@

    NB: The function analyzes only single miniscript item and not any of its descendants in AST.

    §

    impl<Pk, Ctx> Miniscript<Pk, Ctx>
    where Pk: MiniscriptKey, - Ctx: ScriptContext,

    pub fn from_ast(t: Terminal<Pk, Ctx>) -> Result<Miniscript<Pk, Ctx>, Error>

    Add type information(Type and Extdata) to Miniscript based on + Ctx: ScriptContext,

    pub const TRUE: Miniscript<Pk, Ctx> = _

    The 1 combinator.

    +

    pub const FALSE: Miniscript<Pk, Ctx> = _

    The 0 combinator.

    +

    pub fn from_ast(t: Terminal<Pk, Ctx>) -> Result<Miniscript<Pk, Ctx>, Error>

    Add type information(Type and Extdata) to Miniscript based on AstElem fragment. Dependent on display and clone because of Error Display code of type_check.

    pub fn from_components_unchecked( @@ -153,16 +155,7 @@
    BTreeMap<Hash, Pk> ) -> Miniscript<Pk, Ctx>

    Substitutes raw public keys hashes with the public keys as provided by map.

    §

    impl<Pk, Ctx> Miniscript<Pk, Ctx>
    where - Pk: MiniscriptKey + FromStr, - <Pk as MiniscriptKey>::Sha256: FromStr, - <Pk as MiniscriptKey>::Hash256: FromStr, - <Pk as MiniscriptKey>::Ripemd160: FromStr, - <Pk as MiniscriptKey>::Hash160: FromStr, - <Pk as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString, + Pk: FromStrKey, Ctx: ScriptContext,

    pub fn from_str_insane(s: &str) -> Result<Miniscript<Pk, Ctx>, Error>

    Attempt to parse an insane(scripts don’t clear sanity checks) from string into a Miniscript representation. Use this to parse scripts with repeated pubkeys, timelock mixing, malleable @@ -170,25 +163,14 @@

    §

    impl<Pk, Ctx> Miniscript<Pk, Ctx>
    where - Pk: MiniscriptKey + FromStr, - <Pk as MiniscriptKey>::Sha256: FromStr, - <Pk as MiniscriptKey>::Hash256: FromStr, - <Pk as MiniscriptKey>::Ripemd160: FromStr, - <Pk as MiniscriptKey>::Hash160: FromStr, - <Pk as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString, - Ctx: ScriptContext,

    pub fn from_str_ext( +

    pub fn from_str_ext( s: &str, ext: &ExtParams ) -> Result<Miniscript<Pk, Ctx>, Error>

    Attempt to parse an Miniscripts that don’t follow the spec. Use this to parse scripts with repeated pubkeys, timelock mixing, malleable scripts, raw pubkey hashes without sig or scripts that can exceed resource limits.

    Use [ExtParams] builder to specify the types of non-sane rules to allow while parsing.

    -
    §

    impl<Pk, Ctx> Miniscript<Pk, Ctx>
    where +

    §

    impl<Pk, Ctx> Miniscript<Pk, Ctx>
    where Pk: MiniscriptKey, Ctx: ScriptContext,

    pub fn lift_check(&self) -> Result<(), LiftError>

    Lifting corresponds to conversion of a miniscript into a [Semantic] policy for human readable or machine analysis. However, naively lifting @@ -204,22 +186,13 @@

    Clone + ScriptContext,
    §

    fn clone(&self) -> Miniscript<Pk, Ctx>

    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
    §

    impl<Pk, Ctx> Debug for Miniscript<Pk, Ctx>
    where Pk: MiniscriptKey, Ctx: ScriptContext,

    §

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

    Formats the value using the given formatter. Read more
    §

    impl<'de, Pk, Ctx> Deserialize<'de> for Miniscript<Pk, Ctx>
    where - Pk: MiniscriptKey + FromStr, - <Pk as MiniscriptKey>::Sha256: FromStr, - <Pk as MiniscriptKey>::Hash256: FromStr, - <Pk as MiniscriptKey>::Ripemd160: FromStr, - <Pk as MiniscriptKey>::Hash160: FromStr, - <Pk as FromStr>::Err: Display, - <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: Display, - <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: Display, - <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: Display, - <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: Display, + Pk: FromStrKey, Ctx: ScriptContext,

    §

    fn deserialize<D>( deserializer: D ) -> Result<Miniscript<Pk, Ctx>, <D as Deserializer<'de>>::Error>
    where D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    §

    impl<Pk, Ctx> Display for Miniscript<Pk, Ctx>
    where Pk: MiniscriptKey, - Ctx: ScriptContext,

    §

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

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

    impl<Ctx: ScriptContext + 'static> ExtractPolicy for Miniscript<DescriptorPublicKey, Ctx>

    §

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

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

    impl<Ctx: ScriptContext + 'static> ExtractPolicy for Miniscript<DescriptorPublicKey, Ctx>

    source§

    fn extract_policy( &self, signers: &SignersContainer, build_sat: BuildSatisfaction<'_>, @@ -232,30 +205,12 @@

    FnMut(&'a Pk) -> bool, Pk: 'a,
    Run a predicate on every key in the descriptor, returning whether the predicate returned true for any key
    §

    impl<Pk, Ctx> FromStr for Miniscript<Pk, Ctx>
    where - Pk: MiniscriptKey + FromStr, - <Pk as MiniscriptKey>::Sha256: FromStr, - <Pk as MiniscriptKey>::Hash256: FromStr, - <Pk as MiniscriptKey>::Ripemd160: FromStr, - <Pk as MiniscriptKey>::Hash160: FromStr, - <Pk as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString, + Pk: FromStrKey, Ctx: ScriptContext,

    §

    fn from_str(s: &str) -> Result<Miniscript<Pk, Ctx>, Error>

    Parse a Miniscript from string and perform sanity checks See Miniscript::from_str_insane to parse scripts from string that do not clear the Miniscript::sanity_check checks.

    §

    type Err = Error

    The associated error which can be returned from parsing.
    §

    impl<Pk, Ctx> FromTree for Miniscript<Pk, Ctx>
    where - Pk: MiniscriptKey + FromStr, - <Pk as MiniscriptKey>::Sha256: FromStr, - <Pk as MiniscriptKey>::Hash256: FromStr, - <Pk as MiniscriptKey>::Ripemd160: FromStr, - <Pk as MiniscriptKey>::Hash160: FromStr, - <Pk as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString, - <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString, + Pk: FromStrKey, Ctx: ScriptContext,

    §

    fn from_tree(top: &Tree<'_>) -> Result<Miniscript<Pk, Ctx>, Error>

    Parse an expression tree into a Miniscript. As a general rule, this should not be called directly; rather go through the descriptor API.

    §

    impl<Pk, Ctx> Hash for Miniscript<Pk, Ctx>
    where diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/trait.ExtractPolicy.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/trait.ExtractPolicy.html index 4db3eb4af7..5ad0f033a1 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/trait.ExtractPolicy.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/trait.ExtractPolicy.html @@ -13,4 +13,4 @@ psbt: BuildSatisfaction<'_>, secp: &Secp256k1<All> ) -> Result<Option<Policy>, DescriptorError>

    Extract the spending policy

    -

    Implementors§

    \ No newline at end of file +

    Implementors§

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/trait.ScriptContext.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/trait.ScriptContext.html index 53e8d6e336..db5e792b99 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/trait.ScriptContext.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/trait.ScriptContext.html @@ -16,8 +16,7 @@ fn name_str() -> &'static str; // Provided methods - fn check_witness<Pk>(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError> - where Pk: MiniscriptKey { ... } + fn check_witness(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError> { ... } fn check_global_consensus_validity<Pk>( _ms: &Miniscript<Pk, Self> ) -> Result<(), ScriptContextError> @@ -80,8 +79,7 @@ 34/66 for Bare/Legacy based on key compressedness 34 for Segwitv0, 33 for Tap

    fn name_str() -> &'static str

    Local helper function to display error messages with context

    -

    Provided Methods§

    fn check_witness<Pk>(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError>
    where - Pk: MiniscriptKey,

    Check whether the given satisfaction is valid under the ScriptContext +

    Provided Methods§

    fn check_witness(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError>

    Check whether the given satisfaction is valid under the ScriptContext For example, segwit satisfactions may fail if the witness len is more 3600 or number of stack elements are more than 100.

    fn check_global_consensus_validity<Pk>( diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/enum.DescriptorPublicKey.html b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/enum.DescriptorPublicKey.html index 039eb923b4..e686180320 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/enum.DescriptorPublicKey.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/enum.DescriptorPublicKey.html @@ -1,4 +1,4 @@ -DescriptorPublicKey in bdk_wallet::keys - Rust

    Enum bdk_wallet::keys::DescriptorPublicKey

    pub enum DescriptorPublicKey {
    +DescriptorPublicKey in bdk_wallet::keys - Rust

    Enum bdk_wallet::keys::DescriptorPublicKey

    pub enum DescriptorPublicKey {
         Single(SinglePub),
         XPub(DescriptorXKey<Xpub>),
         MultiXPub(DescriptorMultiXKey<Xpub>),
    @@ -52,7 +52,7 @@ 
    §Errors
    ) -> Result<DescriptorPublicKey, <DescriptorPublicKey as FromStr>::Err>

    Parses a string s to return a value of this type. Read more
    §

    impl Hash for DescriptorPublicKey

    §

    fn hash<__H>(&self, state: &mut __H)
    where __H: Hasher,

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where H: Hasher, - Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    §

    impl IntoAssets for DescriptorPublicKey

    §

    fn into_assets(self) -> Assets

    Convert self into a Assets struct
    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorPublicKey

    source§

    fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError>

    Turn the key into a DescriptorKey within the requested ScriptContext
    §

    impl MiniscriptKey for DescriptorPublicKey

    §

    type Sha256 = Hash

    The associated [bitcoin::hashes::sha256::Hash] for this [MiniscriptKey], used in the + Self: Sized,
    Feeds a slice of this type into the given Hasher. Read more
    §

    impl IntoAssets for DescriptorPublicKey

    §

    fn into_assets(self) -> Assets

    Convert self into a Assets struct
    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorPublicKey

    source§

    fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError>

    Turn the key into a DescriptorKey within the requested ScriptContext
    §

    impl MiniscriptKey for DescriptorPublicKey

    §

    type Sha256 = Hash

    The associated [bitcoin::hashes::sha256::Hash] for this [MiniscriptKey], used in the sha256 fragment.
    §

    type Hash256 = Hash

    The associated [miniscript::hash256::Hash] for this [MiniscriptKey], used in the hash256 fragment.
    §

    type Ripemd160 = Hash

    The associated [bitcoin::hashes::ripemd160::Hash] for this [MiniscriptKey] type, used in the ripemd160 fragment.
    §

    type Hash160 = Hash

    The associated [bitcoin::hashes::hash160::Hash] for this [MiniscriptKey] type, used in @@ -72,7 +72,17 @@
    §Errors
    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 +

    §

    impl<T> FromStrKey for T
    where + T: MiniscriptKey + FromStr, + <T as MiniscriptKey>::Sha256: FromStr, + <T as MiniscriptKey>::Hash256: FromStr, + <T as MiniscriptKey>::Ripemd160: FromStr, + <T as MiniscriptKey>::Hash160: FromStr, + <T as FromStr>::Err: Debug + Display, + <<T as MiniscriptKey>::Sha256 as FromStr>::Err: Debug + Display, + <<T as MiniscriptKey>::Hash256 as FromStr>::Err: Debug + Display, + <<T as MiniscriptKey>::Ripemd160 as FromStr>::Err: Debug + Display, + <<T as MiniscriptKey>::Hash160 as FromStr>::Err: Debug + Display,

    §

    type _Sha256 = <T as MiniscriptKey>::Sha256

    Dummy type. Do not use.
    §

    type _Sha256FromStrErr = <<T as MiniscriptKey>::Sha256 as FromStr>::Err

    Dummy type. Do not use.
    §

    type _Hash256 = <T as MiniscriptKey>::Hash256

    Dummy type. Do not use.
    §

    type _Hash256FromStrErr = <<T as MiniscriptKey>::Hash256 as FromStr>::Err

    Dummy type. Do not use.
    §

    type _Ripemd160 = <T as MiniscriptKey>::Ripemd160

    Dummy type. Do not use.
    §

    type _Ripemd160FromStrErr = <<T as MiniscriptKey>::Ripemd160 as FromStr>::Err

    Dummy type. Do not use.
    §

    type _Hash160 = <T as MiniscriptKey>::Hash160

    Dummy type. Do not use.
    §

    type _Hash160FromStrErr = <<T as MiniscriptKey>::Hash160 as FromStr>::Err

    Dummy type. Do not use.
    §

    type _FromStrErr = <T as FromStr>::Err

    Dummy type. Do not use.
    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.

    diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/enum.DescriptorSecretKey.html b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/enum.DescriptorSecretKey.html index 25b52832d2..5e041879e1 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/enum.DescriptorSecretKey.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/enum.DescriptorSecretKey.html @@ -23,7 +23,7 @@ path.

    Trait Implementations§

    §

    impl Clone for DescriptorSecretKey

    §

    fn clone(&self) -> DescriptorSecretKey

    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
    §

    impl Debug for DescriptorSecretKey

    §

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

    Formats the value using the given formatter. Read more
    §

    impl Display for DescriptorSecretKey

    §

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

    Formats the value using the given formatter. Read more
    §

    impl FromStr for DescriptorSecretKey

    §

    type Err = DescriptorKeyParseError

    The associated error which can be returned from parsing.
    §

    fn from_str( s: &str -) -> Result<DescriptorSecretKey, <DescriptorSecretKey as FromStr>::Err>

    Parses a string s to return a value of this type. Read more
    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorSecretKey

    source§

    fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError>

    Turn the key into a DescriptorKey within the requested ScriptContext
    §

    impl PartialEq for DescriptorSecretKey

    §

    fn eq(&self, other: &DescriptorSecretKey) -> bool

    This method tests for self and other values to be equal, and is used +) -> Result<DescriptorSecretKey, <DescriptorSecretKey as FromStr>::Err>
    Parses a string s to return a value of this type. Read more
    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorSecretKey

    source§

    fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError>

    Turn the key into a DescriptorKey within the requested ScriptContext
    §

    impl PartialEq for DescriptorSecretKey

    §

    fn eq(&self, other: &DescriptorSecretKey) -> 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.
    §

    impl Eq for DescriptorSecretKey

    §

    impl StructuralPartialEq for DescriptorSecretKey

    Auto Trait Implementations§

    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 diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/enum.KeyError.html b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/enum.KeyError.html index e5b35a2d74..ec2cc48cde 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/enum.KeyError.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/enum.KeyError.html @@ -1,4 +1,4 @@ -KeyError in bdk_wallet::keys - Rust

    Enum bdk_wallet::keys::KeyError

    source ·
    pub enum KeyError {
    +KeyError in bdk_wallet::keys - Rust

    Enum bdk_wallet::keys::KeyError

    source ·
    pub enum KeyError {
         InvalidScriptContext,
         InvalidNetwork,
         InvalidChecksum,
    @@ -12,7 +12,7 @@
     
    §

    Message(String)

    Custom error message

    §

    Bip32(Error)

    BIP32 error

    §

    Miniscript(Error)

    Miniscript error

    -

    Trait Implementations§

    source§

    impl Debug for KeyError

    source§

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

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

    impl Display for KeyError

    source§

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

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

    impl Error for KeyError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<Error> for KeyError

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<Error> for KeyError

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<KeyError> for Error

    source§

    fn from(key_error: KeyError) -> Error

    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Debug for KeyError

    source§

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

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

    impl Display for KeyError

    source§

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

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

    impl Error for KeyError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<Error> for KeyError

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<Error> for KeyError

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<KeyError> for Error

    source§

    fn from(key_error: KeyError) -> Error

    Converts to this type from the input type.

    Auto Trait Implementations§

    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/bdk_wallet/keys/index.html b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/index.html index 87b95f6600..aeaa9e7f79 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/index.html @@ -1,4 +1,4 @@ -bdk_wallet::keys - Rust

    Module bdk_wallet::keys

    source ·
    Expand description

    Key formats

    +bdk_wallet::keys - Rust

    Module bdk_wallet::keys

    source ·
    Expand description

    Key formats

    Structs§

    Enums§

    Traits§

    • Trait for keys that can be derived.
    • Trait that adds extra useful methods to ScriptContexts
    • Trait that allows generating a key with the default options
    • Trait for keys that can be generated
    • Trait for objects that can be turned into a public or secret DescriptorKey
    • The ScriptContext for Miniscript. Additional type information associated with miniscript that is used for carrying out checks that dependent on the context under which the script is used. diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/struct.GeneratedKey.html b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/struct.GeneratedKey.html index bfde4fdb90..1e5536960e 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/struct.GeneratedKey.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/struct.GeneratedKey.html @@ -2,14 +2,14 @@

    Implementations§

    source§

    impl<K, Ctx: ScriptContext> GeneratedKey<K, Ctx>

    source

    pub fn into_key(self) -> K

    Consumes self and returns the key

    Trait Implementations§

    source§

    impl<K: Clone, Ctx: ScriptContext> Clone for GeneratedKey<K, Ctx>

    source§

    fn clone(&self) -> GeneratedKey<K, Ctx>

    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<K, Ctx: ScriptContext> Deref for GeneratedKey<K, Ctx>

    §

    type Target = K

    The resulting type after dereferencing.
    source§

    fn deref(&self) -> &Self::Target

    Dereferences the value.
    source§

    impl<Ctx, K> DerivableKey<Ctx> for GeneratedKey<K, Ctx>
    where Ctx: ScriptContext, - K: DerivableKey<Ctx>,

    source§

    fn into_extended_key(self) -> Result<ExtendedKey<Ctx>, KeyError>

    Consume self and turn it into an ExtendedKey
    source§

    fn into_descriptor_key( + K: DerivableKey<Ctx>,

    source§

    fn into_extended_key(self) -> Result<ExtendedKey<Ctx>, KeyError>

    Consume self and turn it into an ExtendedKey
    source§

    fn into_descriptor_key( self, origin: Option<KeySource>, derivation_path: DerivationPath ) -> Result<DescriptorKey<Ctx>, KeyError>

    Consume self and turn it into a DescriptorKey by adding the extra metadata, such as key origin and derivation path
    source§

    impl<Ctx, K> IntoDescriptorKey<Ctx> for GeneratedKey<K, Ctx>
    where Ctx: ScriptContext, - K: IntoDescriptorKey<Ctx>,

    source§

    fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError>

    Turn the key into a DescriptorKey within the requested ScriptContext

    Auto Trait Implementations§

    §

    impl<K, Ctx> Freeze for GeneratedKey<K, Ctx>
    where + K: IntoDescriptorKey<Ctx>,

    source§

    fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError>

    Turn the key into a DescriptorKey within the requested ScriptContext

    Auto Trait Implementations§

    §

    impl<K, Ctx> Freeze for GeneratedKey<K, Ctx>
    where K: Freeze,

    §

    impl<K, Ctx> RefUnwindSafe for GeneratedKey<K, Ctx>

    §

    impl<K, Ctx> Send for GeneratedKey<K, Ctx>
    where diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/struct.SortedMultiVec.html b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/struct.SortedMultiVec.html index 57c1fb105b..fae708acc8 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/struct.SortedMultiVec.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/struct.SortedMultiVec.html @@ -1,19 +1,13 @@ -SortedMultiVec in bdk_wallet::keys - Rust

    Struct bdk_wallet::keys::SortedMultiVec

    pub struct SortedMultiVec<Pk, Ctx>
    where +SortedMultiVec in bdk_wallet::keys - Rust

    Struct bdk_wallet::keys::SortedMultiVec

    pub struct SortedMultiVec<Pk, Ctx>
    where Pk: MiniscriptKey, - Ctx: ScriptContext,
    { - pub k: usize, - pub pks: Vec<Pk>, - /* private fields */ -}
    Expand description

    Contents of a “sortedmulti” descriptor

    -

    Fields§

    §k: usize

    signatures required

    -
    §pks: Vec<Pk>

    public keys inside sorted Multi

    -

    Implementations§

    §

    impl<Pk, Ctx> SortedMultiVec<Pk, Ctx>
    where + Ctx: ScriptContext,
    { /* private fields */ }

    Expand description

    Contents of a “sortedmulti” descriptor

    +

    Implementations§

    §

    impl<Pk, Ctx> SortedMultiVec<Pk, Ctx>
    where Pk: MiniscriptKey, Ctx: ScriptContext,

    pub fn new(k: usize, pks: Vec<Pk>) -> Result<SortedMultiVec<Pk, Ctx>, Error>

    Create a new instance of SortedMultiVec given a list of keys and the threshold

    Internally checks all the applicable size limits and pubkey types limitations according to the current Ctx.

    pub fn from_tree(tree: &Tree<'_>) -> Result<SortedMultiVec<Pk, Ctx>, Error>
    where Pk: FromStr, - <Pk as FromStr>::Err: ToString,

    Parse an expression tree into a SortedMultiVec

    + <Pk as FromStr>::Err: Display,

    Parse an expression tree into a SortedMultiVec

    pub fn translate_pk<T, Q, FuncError>( &self, t: &mut T @@ -22,6 +16,12 @@ Q: MiniscriptKey,

    This will panic if fpk returns an uncompressed key when converting to a Segwit descriptor. To prevent this panic, ensure fpk returns an error in this case instead.

    +

    pub fn k(&self) -> usize

    The threshold value for the multisig.

    +

    pub fn n(&self) -> usize

    The number of keys in the multisig.

    +

    pub fn pks(&self) -> &[Pk]

    Accessor for the public keys in the multisig.

    +

    The keys in this structure might not be sorted. In general, they cannot be +sorted until they are converted to consensus-encoded public keys, which may not +be possible (for example for BIP32 paths with unfilled wildcards).

    §

    impl<Pk, Ctx> SortedMultiVec<Pk, Ctx>
    where Pk: MiniscriptKey, Ctx: ScriptContext,

    pub fn sanity_check(&self) -> Result<(), Error>

    utility function to sanity a sorted multi vec

    diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/trait.DerivableKey.html b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/trait.DerivableKey.html index e64907d195..e08be82732 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/trait.DerivableKey.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/trait.DerivableKey.html @@ -33,7 +33,7 @@

    §Examples

    impl<Ctx: ScriptContext> DerivableKey<Ctx> for MyCustomKeyType { fn into_extended_key(self) -> Result<ExtendedKey<Ctx>, KeyError> { let xprv = bip32::Xpriv { - network: self.network, + network: self.network.into(), depth: 0, parent_fingerprint: bip32::Fingerprint::default(), private_key: self.key_data.inner, @@ -62,7 +62,7 @@

    §Examples

    impl<Ctx: ScriptContext> DerivableKey<Ctx> for MyCustomKeyType { fn into_extended_key(self) -> Result<ExtendedKey<Ctx>, KeyError> { let xprv = bip32::Xpriv { - network: bitcoin::Network::Bitcoin, // pick an arbitrary network here + network: bitcoin::Network::Bitcoin.into(), // pick an arbitrary network here depth: 0, parent_fingerprint: bip32::Fingerprint::default(), private_key: self.key_data.inner, diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/trait.IntoDescriptorKey.html b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/trait.IntoDescriptorKey.html index e8ddf8283a..b7c5598c39 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/trait.IntoDescriptorKey.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/trait.IntoDescriptorKey.html @@ -104,7 +104,7 @@

    §Examples

    // ^^^^^ changing this to `wpkh` would make it compile

    Required Methods§

    source

    fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError>

    Turn the key into a DescriptorKey within the requested ScriptContext

    -

    Object Safety§

    This trait is not object safe.

    Implementations on Foreign Types§

    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for &str

    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for PrivateKey

    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for PublicKey

    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for XOnlyPublicKey

    source§

    impl<Ctx: ScriptContext, T: DerivableKey<Ctx>> IntoDescriptorKey<Ctx> for (T, DerivationPath)

    source§

    impl<Ctx: ScriptContext, T: DerivableKey<Ctx>> IntoDescriptorKey<Ctx> for (T, KeySource, DerivationPath)

    Implementors§

    source§

    impl<Ctx, K> IntoDescriptorKey<Ctx> for GeneratedKey<K, Ctx>
    where +

    Object Safety§

    This trait is not object safe.

    Implementations on Foreign Types§

    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for &str

    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for PrivateKey

    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for PublicKey

    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for XOnlyPublicKey

    source§

    impl<Ctx: ScriptContext, T: DerivableKey<Ctx>> IntoDescriptorKey<Ctx> for (T, DerivationPath)

    source§

    impl<Ctx: ScriptContext, T: DerivableKey<Ctx>> IntoDescriptorKey<Ctx> for (T, KeySource, DerivationPath)

    Implementors§

    source§

    impl<Ctx, K> IntoDescriptorKey<Ctx> for GeneratedKey<K, Ctx>
    where Ctx: ScriptContext, K: IntoDescriptorKey<Ctx>,

    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorKey<Ctx>

    The “identity” conversion is used internally by some bdk_wallet::fragments

    -
    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorPublicKey

    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorSecretKey

    \ No newline at end of file +
    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorPublicKey

    source§

    impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorSecretKey

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/trait.ScriptContext.html b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/trait.ScriptContext.html index 85f487db85..75e6ce1f99 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/keys/trait.ScriptContext.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/keys/trait.ScriptContext.html @@ -16,8 +16,7 @@ fn name_str() -> &'static str; // Provided methods - fn check_witness<Pk>(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError> - where Pk: MiniscriptKey { ... } + fn check_witness(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError> { ... } fn check_global_consensus_validity<Pk>( _ms: &Miniscript<Pk, Self> ) -> Result<(), ScriptContextError> @@ -80,8 +79,7 @@ 34/66 for Bare/Legacy based on key compressedness 34 for Segwitv0, 33 for Tap

    fn name_str() -> &'static str

    Local helper function to display error messages with context

    -

    Provided Methods§

    fn check_witness<Pk>(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError>
    where - Pk: MiniscriptKey,

    Check whether the given satisfaction is valid under the ScriptContext +

    Provided Methods§

    fn check_witness(_witness: &[Vec<u8>]) -> Result<(), ScriptContextError>

    Check whether the given satisfaction is valid under the ScriptContext For example, segwit satisfactions may fail if the witness len is more 3600 or number of stack elements are more than 100.

    fn check_global_consensus_validity<Pk>( diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/macro.fragment.html b/docs-rs/bdk/nightly/latest/bdk_wallet/macro.fragment.html index e338209dda..b85ce98923 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/macro.fragment.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/macro.fragment.html @@ -1,4 +1,4 @@ -fragment in bdk_wallet - Rust

    Macro bdk_wallet::fragment

    source ·
    macro_rules! fragment {
    +fragment in bdk_wallet - Rust

    Macro bdk_wallet::fragment

    source ·
    macro_rules! fragment {
         ( $modif:tt : $( $tail:tt )* ) => { ... };
         ( true ) => { ... };
         ( false ) => { ... };
    diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/coin_selection/enum.Error.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/coin_selection/enum.Error.html
    index c4e38ae616..0fc33a66dc 100644
    --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/coin_selection/enum.Error.html
    +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/coin_selection/enum.Error.html
    @@ -13,7 +13,7 @@
     the desired outputs plus fee, if there is not such combination this error is thrown

    §

    BnBTotalTriesExceeded

    Branch and bound coin selection possible attempts with sufficiently big UTXO set could grow exponentially, thus a limit is set, and when hit, this error is thrown

    -

    Trait Implementations§

    source§

    impl Debug for Error

    source§

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

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

    impl Display for Error

    source§

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

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

    impl Error for Error

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<Error> for CreateTxError

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    §

    impl Freeze for Error

    §

    impl RefUnwindSafe for Error

    §

    impl Send for Error

    §

    impl Sync for Error

    §

    impl Unpin for Error

    §

    impl UnwindSafe for Error

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Debug for Error

    source§

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

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

    impl Display for Error

    source§

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

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

    impl Error for Error

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<Error> for CreateTxError

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    §

    impl Freeze for Error

    §

    impl RefUnwindSafe for Error

    §

    impl Send for Error

    §

    impl Sync for Error

    §

    impl Unpin for Error

    §

    impl UnwindSafe for Error

    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/bdk_wallet/wallet/enum.ApplyBlockError.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.ApplyBlockError.html index 4125a45305..01ba10f8ec 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.ApplyBlockError.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.ApplyBlockError.html @@ -9,7 +9,7 @@
    §

    UnexpectedConnectedToHash

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

    Fields

    §connected_to_hash: BlockHash

    Block hash of connected_to.

    §expected_hash: BlockHash

    Expected block hash of connected_to, as derived from block.

    -

    Trait Implementations§

    source§

    impl Debug for ApplyBlockError

    source§

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

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

    impl Display for ApplyBlockError

    source§

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

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

    impl Error for ApplyBlockError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Debug for ApplyBlockError

    source§

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

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

    impl Display for ApplyBlockError

    source§

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

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

    impl Error for ApplyBlockError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    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/bdk_wallet/wallet/enum.InsertTxError.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.InsertTxError.html index 4c0c5fc5c4..8c1bb09283 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.InsertTxError.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.InsertTxError.html @@ -8,7 +8,7 @@ confirmation height that is greater than the internal chain tip.

    Fields

    §tip_height: u32

    The internal chain’s tip height.

    §tx_height: u32

    The introduced transaction’s confirmation height.

    -

    Trait Implementations§

    source§

    impl Debug for InsertTxError

    source§

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

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

    impl Display for InsertTxError

    source§

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

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

    impl Error for InsertTxError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Debug for InsertTxError

    source§

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

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

    impl Display for InsertTxError

    source§

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

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

    impl Error for InsertTxError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    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/bdk_wallet/wallet/enum.LoadError.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.LoadError.html index eb01a53700..d13031ba6e 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.LoadError.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.LoadError.html @@ -13,7 +13,7 @@
    §

    MissingNetwork

    Data loaded from persistence is missing network type.

    §

    MissingGenesis

    Data loaded from persistence is missing genesis hash.

    §

    MissingDescriptor(KeychainKind)

    Data loaded from persistence is missing descriptor.

    -

    Trait Implementations§

    source§

    impl Debug for LoadError

    source§

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

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

    impl Display for LoadError

    source§

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

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

    impl Error for LoadError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Debug for LoadError

    source§

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

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

    impl Display for LoadError

    source§

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

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

    impl Error for LoadError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    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/bdk_wallet/wallet/enum.NewError.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.NewError.html index 68565f4477..aec6d4825e 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.NewError.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.NewError.html @@ -7,7 +7,7 @@

    Variants§

    §

    NonEmptyDatabase

    Database already has data.

    §

    Descriptor(DescriptorError)

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

    §

    Persist(Error)

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

    -

    Trait Implementations§

    source§

    impl Debug for NewError

    source§

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

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

    impl Display for NewError

    source§

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

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

    impl Error for NewError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Debug for NewError

    source§

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

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

    impl Display for NewError

    source§

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

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

    impl Error for NewError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    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/bdk_wallet/wallet/enum.NewOrLoadError.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.NewOrLoadError.html index e609bf16c6..c6188fc723 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.NewOrLoadError.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/enum.NewOrLoadError.html @@ -28,7 +28,7 @@
    §

    LoadedDescriptorDoesNotMatch

    The loaded desccriptor does not match what was provided.

    Fields

    §got: Option<ExtendedDescriptor>

    The descriptor loaded from persistence.

    §keychain: KeychainKind

    The keychain of the descriptor not matching

    -

    Trait Implementations§

    source§

    impl Debug for NewOrLoadError

    source§

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

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

    impl Display for NewOrLoadError

    source§

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

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

    impl Error for NewOrLoadError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Debug for NewOrLoadError

    source§

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

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

    impl Display for NewOrLoadError

    source§

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

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

    impl Error for NewOrLoadError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    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/bdk_wallet/wallet/error/enum.BuildFeeBumpError.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/error/enum.BuildFeeBumpError.html index dc4fb64a37..335ef13263 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/error/enum.BuildFeeBumpError.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/error/enum.BuildFeeBumpError.html @@ -10,7 +10,7 @@
    §

    TransactionConfirmed(Txid)

    Happens when trying to bump a transaction that is already confirmed

    §

    IrreplaceableTransaction(Txid)

    Trying to replace a tx that has a sequence >= 0xFFFFFFFE

    §

    FeeRateUnavailable

    Node doesn’t have data to estimate a fee rate

    -

    Trait Implementations§

    source§

    impl Debug for BuildFeeBumpError

    source§

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

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

    impl Display for BuildFeeBumpError

    source§

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

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

    impl Error for BuildFeeBumpError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Debug for BuildFeeBumpError

    source§

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

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

    impl Display for BuildFeeBumpError

    source§

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

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

    impl Error for BuildFeeBumpError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    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/bdk_wallet/wallet/error/enum.CreateTxError.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/error/enum.CreateTxError.html index 83807a5309..bc2743acf1 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/error/enum.CreateTxError.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/error/enum.CreateTxError.html @@ -58,7 +58,7 @@
    §

    UnknownUtxo

    Happens when trying to spend an UTXO that is not in the internal database

    §

    MissingNonWitnessUtxo(OutPoint)

    Missing non_witness_utxo on foreign utxo for given OutPoint

    §

    MiniscriptPsbt(MiniscriptPsbtError)

    Miniscript PSBT error

    -

    Trait Implementations§

    source§

    impl Debug for CreateTxError

    source§

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

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

    impl Display for CreateTxError

    source§

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

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

    impl Error for CreateTxError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<Error> for CreateTxError

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<Error> for CreateTxError

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<Error> for CreateTxError

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<MiniscriptPsbtError> for CreateTxError

    source§

    fn from(err: MiniscriptPsbtError) -> Self

    Converts to this type from the input type.
    source§

    impl From<PolicyError> for CreateTxError

    source§

    fn from(err: PolicyError) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Debug for CreateTxError

    source§

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

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

    impl Display for CreateTxError

    source§

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

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

    impl Error for CreateTxError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<Error> for CreateTxError

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<Error> for CreateTxError

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<Error> for CreateTxError

    source§

    fn from(err: Error) -> Self

    Converts to this type from the input type.
    source§

    impl From<MiniscriptPsbtError> for CreateTxError

    source§

    fn from(err: MiniscriptPsbtError) -> Self

    Converts to this type from the input type.
    source§

    impl From<PolicyError> for CreateTxError

    source§

    fn from(err: PolicyError) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    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/bdk_wallet/wallet/error/enum.MiniscriptPsbtError.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/error/enum.MiniscriptPsbtError.html index 4b60fea1c4..187f7af0bb 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/error/enum.MiniscriptPsbtError.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/error/enum.MiniscriptPsbtError.html @@ -6,7 +6,7 @@

    Variants§

    §

    Conversion(ConversionError)

    Descriptor key conversion error

    §

    UtxoUpdate(UtxoUpdateError)

    Return error type for PsbtExt::update_input_with_descriptor

    §

    OutputUpdate(OutputUpdateError)

    Return error type for PsbtExt::update_output_with_descriptor

    -

    Trait Implementations§

    source§

    impl Clone for MiniscriptPsbtError

    source§

    fn clone(&self) -> MiniscriptPsbtError

    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 Debug for MiniscriptPsbtError

    source§

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

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

    impl Display for MiniscriptPsbtError

    source§

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

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

    impl Error for MiniscriptPsbtError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<MiniscriptPsbtError> for CreateTxError

    source§

    fn from(err: MiniscriptPsbtError) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Clone for MiniscriptPsbtError

    source§

    fn clone(&self) -> MiniscriptPsbtError

    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 Debug for MiniscriptPsbtError

    source§

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

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

    impl Display for MiniscriptPsbtError

    source§

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

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

    impl Error for MiniscriptPsbtError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<MiniscriptPsbtError> for CreateTxError

    source§

    fn from(err: MiniscriptPsbtError) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    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/bdk_wallet/wallet/export/struct.FullyNodedExport.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/export/struct.FullyNodedExport.html index 9bd6602104..c5fc8650c4 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/export/struct.FullyNodedExport.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/export/struct.FullyNodedExport.html @@ -20,8 +20,8 @@ returned will be 0.

    source

    pub fn descriptor(&self) -> String

    Return the external descriptor

    source

    pub fn change_descriptor(&self) -> Option<String>

    Return the internal descriptor, if present

    -

    Trait Implementations§

    source§

    impl Debug for FullyNodedExport

    source§

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

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

    impl<'de> Deserialize<'de> for FullyNodedExport

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for FullyNodedExport

    source§

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

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

    impl FromStr for FullyNodedExport

    §

    type Err = Error

    The associated error which can be returned from parsing.
    source§

    fn from_str(s: &str) -> Result<Self, Self::Err>

    Parses a string s to return a value of this type. Read more
    source§

    impl Serialize for FullyNodedExport

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where +

    Trait Implementations§

    source§

    impl Debug for FullyNodedExport

    source§

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

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

    impl<'de> Deserialize<'de> for FullyNodedExport

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where + __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for FullyNodedExport

    source§

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

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

    impl FromStr for FullyNodedExport

    §

    type Err = Error

    The associated error which can be returned from parsing.
    source§

    fn from_str(s: &str) -> Result<Self, Self::Err>

    Parses a string s to return a value of this type. Read more
    source§

    impl Serialize for FullyNodedExport

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where __S: Serializer,

    Serialize this value into the given Serde serializer. Read more

    Auto Trait Implementations§

    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 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 719fd393df..757717ea5a 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 7944dd3419..3bacfea4dc 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§

    source§

    impl Copy for SignerContext

    source§

    impl Eq for SignerContext

    source§

    impl StructuralPartialEq for SignerContext

    Auto Trait Implementations§

    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/bdk_wallet/wallet/signer/enum.SignerError.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/enum.SignerError.html index 1279f124f9..d176214064 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/enum.SignerError.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/enum.SignerError.html @@ -1,5 +1,5 @@ -SignerError in bdk_wallet::wallet::signer - Rust

    Enum bdk_wallet::wallet::signer::SignerError

    source ·
    pub enum SignerError {
    -
    Show 14 variants MissingKey, +SignerError in bdk_wallet::wallet::signer - Rust

    Enum bdk_wallet::wallet::signer::SignerError

    source ·
    pub enum SignerError {
    +
    Show 16 variants MissingKey, InvalidKey, UserCanceled, InputIndexOutOfRange, @@ -10,7 +10,9 @@ MissingHdKeypath, NonStandardSighash, InvalidSighash, - SighashError(Error), + SighashP2wpkh(P2wpkhError), + SighashTaproot(TaprootError), + TxInputsIndexError(InputsIndexError), MiniscriptPsbt(MiniscriptPsbtError), External(String),
    }
    Expand description

    Signing error

    @@ -28,15 +30,17 @@

    To enable signing transactions with non-standard sighashes set SignOptions::allow_all_sighashes to true.

    §

    InvalidSighash

    Invalid SIGHASH for the signing context in use

    -
    §

    SighashError(Error)

    Error while computing the hash to sign

    +
    §

    SighashP2wpkh(P2wpkhError)

    Error while computing the hash to sign a P2WPKH input.

    +
    §

    SighashTaproot(TaprootError)

    Error while computing the hash to sign a Taproot input.

    +
    §

    TxInputsIndexError(InputsIndexError)

    Error while computing the hash, out of bounds access on the transaction inputs.

    §

    MiniscriptPsbt(MiniscriptPsbtError)

    Miniscript PSBT error

    §

    External(String)

    To be used only by external libraries implementing InputSigner or TransactionSigner, so that they can return their own custom errors, without having to modify SignerError in BDK.

    -

    Trait Implementations§

    source§

    impl Debug for SignerError

    source§

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

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

    impl Display for SignerError

    source§

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

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

    impl Error for SignerError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<Error> for SignerError

    source§

    fn from(e: Error) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Debug for SignerError

    source§

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

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

    impl Display for SignerError

    source§

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

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

    impl Error for SignerError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl From<InputsIndexError> for SignerError

    source§

    fn from(v: InputsIndexError) -> Self

    Converts to this type from the input type.
    source§

    impl From<P2wpkhError> for SignerError

    source§

    fn from(e: P2wpkhError) -> Self

    Converts to this type from the input type.
    source§

    impl From<TaprootError> for SignerError

    source§

    fn from(e: TaprootError) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    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.

    + 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 diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/enum.SignerId.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/enum.SignerId.html index 32e0bde115..7a33438c52 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/enum.SignerId.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/enum.SignerId.html @@ -7,7 +7,7 @@

    Variants§

    §

    PkHash(Hash)

    Bitcoin HASH160 (RIPEMD160 after SHA256) hash of an ECDSA public key

    §

    Fingerprint(Fingerprint)

    The fingerprint of a BIP32 extended key

    §

    Dummy(u64)

    Dummy identifier

    -

    Trait Implementations§

    source§

    impl Clone for SignerId

    source§

    fn clone(&self) -> SignerId

    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 Debug for SignerId

    source§

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

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

    impl From<Fingerprint> for SignerId

    source§

    fn from(fing: Fingerprint) -> SignerId

    Converts to this type from the input type.
    source§

    impl From<Hash> for SignerId

    source§

    fn from(hash: Hash) -> SignerId

    Converts to this type from the input type.
    source§

    impl Hash for SignerId

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where +

    Trait Implementations§

    source§

    impl Clone for SignerId

    source§

    fn clone(&self) -> SignerId

    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 Debug for SignerId

    source§

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

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

    impl From<Fingerprint> for SignerId

    source§

    fn from(fing: Fingerprint) -> SignerId

    Converts to this type from the input type.
    source§

    impl From<Hash> for SignerId

    source§

    fn from(hash: Hash) -> SignerId

    Converts to this type from the input type.
    source§

    impl Hash for SignerId

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where H: Hasher, Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    source§

    impl Ord for SignerId

    source§

    fn cmp(&self, other: &SignerId) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · source§

    fn min(self, other: Self) -> Self
    where diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/enum.TapLeavesOptions.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/enum.TapLeavesOptions.html index 54bf33dbd7..d791d1d4cd 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/enum.TapLeavesOptions.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/enum.TapLeavesOptions.html @@ -1,4 +1,4 @@ -TapLeavesOptions in bdk_wallet::wallet::signer - Rust

    Enum bdk_wallet::wallet::signer::TapLeavesOptions

    source ·
    pub enum TapLeavesOptions {
    +TapLeavesOptions in bdk_wallet::wallet::signer - Rust

    Enum bdk_wallet::wallet::signer::TapLeavesOptions

    source ·
    pub enum TapLeavesOptions {
         All,
         Include(Vec<TapLeafHash>),
         Exclude(Vec<TapLeafHash>),
    @@ -9,9 +9,9 @@
     some of the specified leaves, if it doesn’t have the right key to sign them.

    §

    Exclude(Vec<TapLeafHash>)

    The signer won’t sign the specified leaves.

    §

    None

    The signer won’t sign any leaf.

    -

    Trait Implementations§

    source§

    impl Clone for TapLeavesOptions

    source§

    fn clone(&self) -> TapLeavesOptions

    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 Debug for TapLeavesOptions

    source§

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

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

    impl Default for TapLeavesOptions

    source§

    fn default() -> TapLeavesOptions

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

    impl PartialEq for TapLeavesOptions

    source§

    fn eq(&self, other: &TapLeavesOptions) -> bool

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

    Trait Implementations§

    source§

    impl Clone for TapLeavesOptions

    source§

    fn clone(&self) -> TapLeavesOptions

    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 Debug for TapLeavesOptions

    source§

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

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

    impl Default for TapLeavesOptions

    source§

    fn default() -> TapLeavesOptions

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

    impl PartialEq for TapLeavesOptions

    source§

    fn eq(&self, other: &TapLeavesOptions) -> 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 Eq for TapLeavesOptions

    source§

    impl StructuralPartialEq for TapLeavesOptions

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +sufficient, and should not be overridden without very good reason.

    source§

    impl Eq for TapLeavesOptions

    source§

    impl StructuralPartialEq for TapLeavesOptions

    Auto Trait Implementations§

    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/bdk_wallet/wallet/signer/index.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/index.html index b2a2f22951..8896c0a41a 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/index.html @@ -1,4 +1,4 @@ -bdk_wallet::wallet::signer - Rust

    Module bdk_wallet::wallet::signer

    source ·
    Expand description

    Generalized signers

    +bdk_wallet::wallet::signer - Rust

    Module bdk_wallet::wallet::signer

    source ·
    Expand description

    Generalized signers

    This module provides the ability to add customized signers to a Wallet through the Wallet::add_signer function.

    diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/struct.SignOptions.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/struct.SignOptions.html index a9f0d759d7..7757b68853 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/struct.SignOptions.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/struct.SignOptions.html @@ -1,4 +1,4 @@ -SignOptions in bdk_wallet::wallet::signer - Rust

    Struct bdk_wallet::wallet::signer::SignOptions

    source ·
    pub struct SignOptions {
    +SignOptions in bdk_wallet::wallet::signer - Rust

    Struct bdk_wallet::wallet::signer::SignOptions

    source ·
    pub struct SignOptions {
         pub trust_witness_utxo: bool,
         pub assume_height: Option<u32>,
         pub allow_all_sighashes: bool,
    @@ -45,7 +45,7 @@
     
    §allow_grinding: bool

    Whether we should grind ECDSA signature to ensure signing with low r or not. Defaults to true, i.e., we always grind ECDSA signature to sign with low r.

    -

    Trait Implementations§

    source§

    impl Clone for SignOptions

    source§

    fn clone(&self) -> SignOptions

    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 Debug for SignOptions

    source§

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

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

    impl Default for SignOptions

    source§

    fn default() -> Self

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

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Clone for SignOptions

    source§

    fn clone(&self) -> SignOptions

    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 Debug for SignOptions

    source§

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

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

    impl Default for SignOptions

    source§

    fn default() -> Self

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

    Auto Trait Implementations§

    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/bdk_wallet/wallet/signer/struct.SignerOrdering.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/struct.SignerOrdering.html index ef918dcbdb..2241c2938c 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/struct.SignerOrdering.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/struct.SignerOrdering.html @@ -1,15 +1,15 @@ -SignerOrdering in bdk_wallet::wallet::signer - Rust

    Struct bdk_wallet::wallet::signer::SignerOrdering

    source ·
    pub struct SignerOrdering(pub usize);
    Expand description

    Defines the order in which signers are called

    +SignerOrdering in bdk_wallet::wallet::signer - Rust

    Struct bdk_wallet::wallet::signer::SignerOrdering

    source ·
    pub struct SignerOrdering(pub usize);
    Expand description

    Defines the order in which signers are called

    The default value is 100. Signers with an ordering above that will be called later, and they will thus see the partial signatures added to the transaction once they get to sign themselves.

    -

    Tuple Fields§

    §0: usize

    Trait Implementations§

    source§

    impl Clone for SignerOrdering

    source§

    fn clone(&self) -> SignerOrdering

    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 Debug for SignerOrdering

    source§

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

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

    impl Default for SignerOrdering

    source§

    fn default() -> Self

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

    impl Ord for SignerOrdering

    source§

    fn cmp(&self, other: &SignerOrdering) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Self
    where +

    Tuple Fields§

    §0: usize

    Trait Implementations§

    source§

    impl Clone for SignerOrdering

    source§

    fn clone(&self) -> SignerOrdering

    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 Debug for SignerOrdering

    source§

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

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

    impl Default for SignerOrdering

    source§

    fn default() -> Self

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

    impl Ord for SignerOrdering

    source§

    fn cmp(&self, other: &SignerOrdering) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · source§

    fn min(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · source§

    fn clamp(self, min: Self, max: Self) -> Self
    where - Self: Sized + PartialOrd,

    Restrict a value to a certain interval. Read more
    source§

    impl PartialEq for SignerOrdering

    source§

    fn eq(&self, other: &SignerOrdering) -> bool

    This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,

    Restrict a value to a certain interval. Read more
    source§

    impl PartialEq for SignerOrdering

    source§

    fn eq(&self, other: &SignerOrdering) -> 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 PartialOrd for SignerOrdering

    source§

    fn partial_cmp(&self, other: &SignerOrdering) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

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

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

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

    This method tests less than or equal to (for self and other) and is used by the <= +sufficient, and should not be overridden without very good reason.
    source§

    impl PartialOrd for SignerOrdering

    source§

    fn partial_cmp(&self, other: &SignerOrdering) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

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

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

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

    This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
    1.0.0 · source§

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

    This method tests greater than (for self and other) and is used by the > operator. Read more
    1.0.0 · source§

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

    This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
    source§

    impl Eq for SignerOrdering

    source§

    impl StructuralPartialEq for SignerOrdering

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +operator. Read more

    source§

    impl Eq for SignerOrdering

    source§

    impl StructuralPartialEq for SignerOrdering

    Auto Trait Implementations§

    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/bdk_wallet/wallet/signer/struct.SignerWrapper.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/struct.SignerWrapper.html index e48a3d0d62..5138374607 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/struct.SignerWrapper.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/struct.SignerWrapper.html @@ -1,24 +1,24 @@ -SignerWrapper in bdk_wallet::wallet::signer - Rust

    Struct bdk_wallet::wallet::signer::SignerWrapper

    source ·
    pub struct SignerWrapper<S: Sized + Debug + Clone> { /* private fields */ }
    Expand description

    Wrapper to pair a signer with its context

    -

    Implementations§

    source§

    impl<S: Sized + Debug + Clone> SignerWrapper<S>

    source

    pub fn new(signer: S, ctx: SignerContext) -> Self

    Create a wrapped signer from a signer and a context

    -

    Trait Implementations§

    source§

    impl<S: Clone + Sized + Debug + Clone> Clone for SignerWrapper<S>

    source§

    fn clone(&self) -> SignerWrapper<S>

    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<S: Debug + Sized + Debug + Clone> Debug for SignerWrapper<S>

    source§

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

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

    impl<S: Sized + Debug + Clone> Deref for SignerWrapper<S>

    §

    type Target = S

    The resulting type after dereferencing.
    source§

    fn deref(&self) -> &Self::Target

    Dereferences the value.
    source§

    impl InputSigner for SignerWrapper<DescriptorMultiXKey<Xpriv>>

    source§

    fn sign_input( +SignerWrapper in bdk_wallet::wallet::signer - Rust

    Struct bdk_wallet::wallet::signer::SignerWrapper

    source ·
    pub struct SignerWrapper<S: Sized + Debug + Clone> { /* private fields */ }
    Expand description

    Wrapper to pair a signer with its context

    +

    Implementations§

    source§

    impl<S: Sized + Debug + Clone> SignerWrapper<S>

    source

    pub fn new(signer: S, ctx: SignerContext) -> Self

    Create a wrapped signer from a signer and a context

    +

    Trait Implementations§

    source§

    impl<S: Clone + Sized + Debug + Clone> Clone for SignerWrapper<S>

    source§

    fn clone(&self) -> SignerWrapper<S>

    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<S: Debug + Sized + Debug + Clone> Debug for SignerWrapper<S>

    source§

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

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

    impl<S: Sized + Debug + Clone> Deref for SignerWrapper<S>

    §

    type Target = S

    The resulting type after dereferencing.
    source§

    fn deref(&self) -> &Self::Target

    Dereferences the value.
    source§

    impl InputSigner for SignerWrapper<DescriptorMultiXKey<Xpriv>>

    source§

    fn sign_input( &self, psbt: &mut Psbt, input_index: usize, sign_options: &SignOptions, secp: &Secp256k1<All> -) -> Result<(), SignerError>

    Sign a single psbt input
    source§

    impl InputSigner for SignerWrapper<DescriptorXKey<Xpriv>>

    source§

    fn sign_input( +) -> Result<(), SignerError>

    Sign a single psbt input
    source§

    impl InputSigner for SignerWrapper<DescriptorXKey<Xpriv>>

    source§

    fn sign_input( &self, psbt: &mut Psbt, input_index: usize, sign_options: &SignOptions, secp: &Secp256k1<All> -) -> Result<(), SignerError>

    Sign a single psbt input
    source§

    impl InputSigner for SignerWrapper<PrivateKey>

    source§

    fn sign_input( +) -> Result<(), SignerError>

    Sign a single psbt input
    source§

    impl InputSigner for SignerWrapper<PrivateKey>

    source§

    fn sign_input( &self, psbt: &mut Psbt, input_index: usize, sign_options: &SignOptions, secp: &Secp256k1<All> -) -> Result<(), SignerError>

    Sign a single psbt input
    source§

    impl SignerCommon for SignerWrapper<DescriptorMultiXKey<Xpriv>>

    source§

    fn id(&self, secp: &Secp256k1<All>) -> SignerId

    Return the SignerId for this signer Read more
    source§

    fn descriptor_secret_key(&self) -> Option<DescriptorSecretKey>

    Return the secret key for the signer Read more
    source§

    impl SignerCommon for SignerWrapper<DescriptorXKey<Xpriv>>

    source§

    fn id(&self, secp: &Secp256k1<All>) -> SignerId

    Return the SignerId for this signer Read more
    source§

    fn descriptor_secret_key(&self) -> Option<DescriptorSecretKey>

    Return the secret key for the signer Read more
    source§

    impl SignerCommon for SignerWrapper<PrivateKey>

    source§

    fn id(&self, secp: &Secp256k1<All>) -> SignerId

    Return the SignerId for this signer Read more
    source§

    fn descriptor_secret_key(&self) -> Option<DescriptorSecretKey>

    Return the secret key for the signer Read more

    Auto Trait Implementations§

    §

    impl<S> Freeze for SignerWrapper<S>
    where +) -> Result<(), SignerError>

    Sign a single psbt input
    source§

    impl SignerCommon for SignerWrapper<DescriptorMultiXKey<Xpriv>>

    source§

    fn id(&self, secp: &Secp256k1<All>) -> SignerId

    Return the SignerId for this signer Read more
    source§

    fn descriptor_secret_key(&self) -> Option<DescriptorSecretKey>

    Return the secret key for the signer Read more
    source§

    impl SignerCommon for SignerWrapper<DescriptorXKey<Xpriv>>

    source§

    fn id(&self, secp: &Secp256k1<All>) -> SignerId

    Return the SignerId for this signer Read more
    source§

    fn descriptor_secret_key(&self) -> Option<DescriptorSecretKey>

    Return the secret key for the signer Read more
    source§

    impl SignerCommon for SignerWrapper<PrivateKey>

    source§

    fn id(&self, secp: &Secp256k1<All>) -> SignerId

    Return the SignerId for this signer Read more
    source§

    fn descriptor_secret_key(&self) -> Option<DescriptorSecretKey>

    Return the secret key for the signer Read more

    Auto Trait Implementations§

    §

    impl<S> Freeze for SignerWrapper<S>
    where S: Freeze,

    §

    impl<S> RefUnwindSafe for SignerWrapper<S>
    where S: RefUnwindSafe,

    §

    impl<S> Send for SignerWrapper<S>
    where S: Send,

    §

    impl<S> Sync for SignerWrapper<S>
    where @@ -33,8 +33,8 @@

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

    source§

    impl<T> ToOwned for T
    where - T: Clone,

    §

    type Owned = T

    The resulting type after obtaining ownership.
    source§

    fn to_owned(&self) -> T

    Creates owned data from borrowed data, usually by cloning. Read more
    source§

    fn clone_into(&self, target: &mut T)

    Uses borrowed data to replace owned data, usually by cloning. Read more
    source§

    impl<T> TransactionSigner for T
    where - T: InputSigner,

    §

    type Owned = T

    The resulting type after obtaining ownership.
    source§

    fn to_owned(&self) -> T

    Creates owned data from borrowed data, usually by cloning. Read more
    source§

    fn clone_into(&self, target: &mut T)

    Uses borrowed data to replace owned data, usually by cloning. Read more
    source§

    impl<T> TransactionSigner for T
    where + T: InputSigner,

    source§

    fn sign_transaction( &self, psbt: &mut Psbt, sign_options: &SignOptions, diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/struct.SignersContainer.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/struct.SignersContainer.html index 499adae091..68145d8f97 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/struct.SignersContainer.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/struct.SignersContainer.html @@ -1,29 +1,29 @@ -SignersContainer in bdk_wallet::wallet::signer - Rust

    Struct bdk_wallet::wallet::signer::SignersContainer

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

    Container for multiple signers

    -

    Implementations§

    source§

    impl SignersContainer

    source

    pub fn as_key_map(&self, secp: &Secp256k1<All>) -> KeyMap

    Create a map of public keys to secret keys

    -
    source

    pub fn build( +SignersContainer in bdk_wallet::wallet::signer - Rust

    Struct bdk_wallet::wallet::signer::SignersContainer

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

    Container for multiple signers

    +

    Implementations§

    source§

    impl SignersContainer

    source

    pub fn as_key_map(&self, secp: &Secp256k1<All>) -> KeyMap

    Create a map of public keys to secret keys

    +
    source

    pub fn build( keymap: KeyMap, descriptor: &Descriptor<DescriptorPublicKey>, secp: &Secp256k1<All> ) -> SignersContainer

    Build a new signer container from a KeyMap

    Also looks at the corresponding descriptor to determine the SignerContext to attach to the signers

    -
    source§

    impl SignersContainer

    source

    pub fn new() -> Self

    Default constructor

    -
    source

    pub fn add_external( +

    source§

    impl SignersContainer

    source

    pub fn new() -> Self

    Default constructor

    +
    source

    pub fn add_external( &mut self, id: SignerId, ordering: SignerOrdering, signer: Arc<dyn TransactionSigner> ) -> Option<Arc<dyn TransactionSigner>>

    Adds an external signer to the container for the specified id. Optionally returns the signer that was previously in the container, if any

    -
    source

    pub fn remove( +

    source

    pub fn remove( &mut self, id: SignerId, ordering: SignerOrdering ) -> Option<Arc<dyn TransactionSigner>>

    Removes a signer from the container and returns it

    -
    source

    pub fn ids(&self) -> Vec<&SignerId>

    Returns the list of identifiers of all the signers in the container

    -
    source

    pub fn signers(&self) -> Vec<&Arc<dyn TransactionSigner>>

    Returns the list of signers in the container, sorted by lowest to highest ordering

    -
    source

    pub fn find(&self, id: SignerId) -> Option<&Arc<dyn TransactionSigner>>

    Finds the signer with lowest ordering for a given id in the container.

    -

    Trait Implementations§

    source§

    impl Clone for SignersContainer

    source§

    fn clone(&self) -> SignersContainer

    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 Debug for SignersContainer

    source§

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

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

    impl Default for SignersContainer

    source§

    fn default() -> SignersContainer

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

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    source

    pub fn ids(&self) -> Vec<&SignerId>

    Returns the list of identifiers of all the signers in the container

    +
    source

    pub fn signers(&self) -> Vec<&Arc<dyn TransactionSigner>>

    Returns the list of signers in the container, sorted by lowest to highest ordering

    +
    source

    pub fn find(&self, id: SignerId) -> Option<&Arc<dyn TransactionSigner>>

    Finds the signer with lowest ordering for a given id in the container.

    +

    Trait Implementations§

    source§

    impl Clone for SignersContainer

    source§

    fn clone(&self) -> SignersContainer

    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 Debug for SignersContainer

    source§

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

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

    impl Default for SignersContainer

    source§

    fn default() -> SignersContainer

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

    Auto Trait Implementations§

    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/bdk_wallet/wallet/signer/trait.InputSigner.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/trait.InputSigner.html index 00cbbe8083..8172773826 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/trait.InputSigner.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/trait.InputSigner.html @@ -1,4 +1,4 @@ -InputSigner in bdk_wallet::wallet::signer - Rust

    Trait bdk_wallet::wallet::signer::InputSigner

    source ·
    pub trait InputSigner: SignerCommon {
    +InputSigner in bdk_wallet::wallet::signer - Rust

    Trait bdk_wallet::wallet::signer::InputSigner

    source ·
    pub trait InputSigner: SignerCommon {
         // Required method
         fn sign_input(
             &self,
    @@ -11,11 +11,11 @@
     

    This trait can be implemented to provide custom signers to the wallet. If the signer supports signing individual inputs, this trait should be implemented and BDK will provide automatically an implementation for TransactionSigner.

    -

    Required Methods§

    Required Methods§

    source

    fn sign_input( &self, psbt: &mut Psbt, input_index: usize, sign_options: &SignOptions, secp: &Secp256k1<All> ) -> Result<(), SignerError>

    Sign a single psbt input

    -

    Implementors§

    source§

    impl InputSigner for SignerWrapper<DescriptorMultiXKey<Xpriv>>

    source§

    impl InputSigner for SignerWrapper<DescriptorXKey<Xpriv>>

    source§

    impl InputSigner for SignerWrapper<PrivateKey>

    \ No newline at end of file +

    Implementors§

    source§

    impl InputSigner for SignerWrapper<DescriptorMultiXKey<Xpriv>>

    source§

    impl InputSigner for SignerWrapper<DescriptorXKey<Xpriv>>

    source§

    impl InputSigner for SignerWrapper<PrivateKey>

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/trait.SignerCommon.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/trait.SignerCommon.html index 9478b2e084..f7f27f5c52 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/trait.SignerCommon.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/trait.SignerCommon.html @@ -1,15 +1,15 @@ -SignerCommon in bdk_wallet::wallet::signer - Rust

    Trait bdk_wallet::wallet::signer::SignerCommon

    source ·
    pub trait SignerCommon: Debug + Send + Sync {
    +SignerCommon in bdk_wallet::wallet::signer - Rust

    Trait bdk_wallet::wallet::signer::SignerCommon

    source ·
    pub trait SignerCommon: Debug + Send + Sync {
         // Required method
         fn id(&self, secp: &Secp256k1<All>) -> SignerId;
     
         // Provided method
         fn descriptor_secret_key(&self) -> Option<DescriptorSecretKey> { ... }
     }
    Expand description

    Common signer methods

    -

    Required Methods§

    source

    fn id(&self, secp: &Secp256k1<All>) -> SignerId

    Return the SignerId for this signer

    +

    Required Methods§

    source

    fn id(&self, secp: &Secp256k1<All>) -> SignerId

    Return the SignerId for this signer

    The SignerId can be used to lookup a signer in the Wallet’s signers map or to compare two signers.

    -

    Provided Methods§

    source

    fn descriptor_secret_key(&self) -> Option<DescriptorSecretKey>

    Return the secret key for the signer

    +

    Provided Methods§

    source

    fn descriptor_secret_key(&self) -> Option<DescriptorSecretKey>

    Return the secret key for the signer

    This is used internally to reconstruct the original descriptor that may contain secrets. External signers that are meant to keep key isolated should just return None here (which is the default for this method, if not overridden).

    -

    Implementors§

    source§

    impl SignerCommon for SignerWrapper<DescriptorMultiXKey<Xpriv>>

    source§

    impl SignerCommon for SignerWrapper<DescriptorXKey<Xpriv>>

    source§

    impl SignerCommon for SignerWrapper<PrivateKey>

    \ No newline at end of file +

    Implementors§

    source§

    impl SignerCommon for SignerWrapper<DescriptorMultiXKey<Xpriv>>

    source§

    impl SignerCommon for SignerWrapper<DescriptorXKey<Xpriv>>

    source§

    impl SignerCommon for SignerWrapper<PrivateKey>

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/trait.TransactionSigner.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/trait.TransactionSigner.html index 4c6a25c8e8..00579f432b 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/trait.TransactionSigner.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/signer/trait.TransactionSigner.html @@ -1,4 +1,4 @@ -TransactionSigner in bdk_wallet::wallet::signer - Rust

    Trait bdk_wallet::wallet::signer::TransactionSigner

    source ·
    pub trait TransactionSigner: SignerCommon {
    +TransactionSigner in bdk_wallet::wallet::signer - Rust

    Trait bdk_wallet::wallet::signer::TransactionSigner

    source ·
    pub trait TransactionSigner: SignerCommon {
         // Required method
         fn sign_transaction(
             &self,
    @@ -9,10 +9,10 @@
     }
    Expand description

    PSBT signer

    This trait can be implemented when the signer can’t sign inputs individually, but signs the whole transaction at once.

    -

    Required Methods§

    Required Methods§

    source

    fn sign_transaction( &self, psbt: &mut Psbt, sign_options: &SignOptions, secp: &Secp256k1<All> ) -> Result<(), SignerError>

    Sign all the inputs of the psbt

    -

    Implementors§

    \ No newline at end of file +

    Implementors§

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/struct.AddressInfo.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/struct.AddressInfo.html index 9d6683f795..429e647d59 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/struct.AddressInfo.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/struct.AddressInfo.html @@ -1,4 +1,4 @@ -AddressInfo in bdk_wallet::wallet - Rust

    Struct bdk_wallet::wallet::AddressInfo

    source ·
    pub struct AddressInfo {
    +AddressInfo in bdk_wallet::wallet - Rust

    Struct bdk_wallet::wallet::AddressInfo

    source ·
    pub struct AddressInfo {
         pub index: u32,
         pub address: Address,
         pub keychain: KeychainKind,
    @@ -7,13 +7,14 @@
     

    Fields§

    §index: u32

    Child index of this address

    §address: Address

    Address

    §keychain: KeychainKind

    Type of keychain

    -

    Methods from Deref<Target = Address>§

    pub fn payload(&self) -> &Payload

    Returns a reference to the payload of this address.

    -

    pub fn network(&self) -> &Network

    Returns a reference to the network of this address.

    -

    pub fn as_unchecked(&self) -> &Address<NetworkUnchecked>

    Returns a reference to the unchecked address, which is dangerous to use if the address -is invalid in the context of NetworkUnchecked.

    +

    Methods from Deref<Target = Address>§

    pub fn as_unchecked(&self) -> &Address<NetworkUnchecked>

    Returns a reference to the address as if it was unchecked.

    pub fn address_type(&self) -> Option<AddressType>

    Gets the address type of the address.

    §Returns

    None if unknown, non-standard or related to the future witness version.

    +

    pub fn to_address_data(&self) -> AddressData

    Gets the address data from this address.

    +

    pub fn pubkey_hash(&self) -> Option<PubkeyHash>

    Gets the pubkey hash for this address if this is a P2PKH address.

    +

    pub fn script_hash(&self) -> Option<ScriptHash>

    Gets the script hash for this address if this is a P2SH address.

    +

    pub fn witness_program(&self) -> Option<WitnessProgram>

    Gets the witness program for this address if this is a segwit address.

    pub fn is_spend_standard(&self) -> bool

    Checks whether or not the address is following Bitcoin standardness rules when spending from this address. NOT to be called by senders.

    @@ -44,11 +45,11 @@
    §Returns

    Returns true if the supplied xonly public key can be used to derive the address.

    This will only work for Taproot addresses. The Public Key is assumed to have already been tweaked.

    -

    pub fn matches_script_pubkey(&self, script_pubkey: &Script) -> bool

    Returns true if the address creates a particular script +

    pub fn matches_script_pubkey(&self, script: &Script) -> bool

    Returns true if the address creates a particular script This function doesn’t make any allocations.

    -

    pub fn assume_checked_ref(&self) -> &Address

    Returns a reference to the checked address. -This function is dangerous in case the address is not a valid checked address.

    -

    pub fn is_valid_for_network(&self, network: Network) -> bool

    Parsed addresses do not always have one network. The problem is that legacy testnet, +

    pub fn assume_checked_ref(&self) -> &Address

    Returns a reference to the checked address.

    +

    This function is dangerous in case the address is not a valid checked address.

    +

    pub fn is_valid_for_network(&self, n: Network) -> bool

    Parsed addresses do not always have one network. The problem is that legacy testnet, regtest and signet addresse use the same prefix instead of multiple different ones. When parsing, such addresses are always assumed to be testnet addresses (the same is true for bech32 signet addresses). So if one wants to check if an address belongs to a certain diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/struct.Update.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/struct.Update.html index 0ea64e464a..2ab63dc181 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/struct.Update.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/struct.Update.html @@ -8,7 +8,7 @@ [KeychainTxOutIndex].

    §graph: TxGraph<ConfirmationTimeHeightAnchor>

    Update for the wallet’s internal [TxGraph].

    §chain: Option<CheckPoint>

    Update for the wallet’s internal LocalChain.

    -

    Trait Implementations§

    source§

    impl Clone for Update

    source§

    fn clone(&self) -> Update

    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 Debug for Update

    source§

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

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

    impl Default for Update

    source§

    fn default() -> Update

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

    impl From<FullScanResult<KeychainKind>> for Update

    source§

    fn from(value: FullScanResult<KeychainKind>) -> Self

    Converts to this type from the input type.
    source§

    impl From<SyncResult> for Update

    source§

    fn from(value: SyncResult) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    §

    impl Freeze for Update

    §

    impl RefUnwindSafe for Update

    §

    impl Send for Update

    §

    impl Sync for Update

    §

    impl Unpin for Update

    §

    impl UnwindSafe for Update

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Clone for Update

    source§

    fn clone(&self) -> Update

    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 Debug for Update

    source§

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

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

    impl Default for Update

    source§

    fn default() -> Update

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

    impl From<FullScanResult<KeychainKind>> for Update

    source§

    fn from(value: FullScanResult<KeychainKind>) -> Self

    Converts to this type from the input type.
    source§

    impl From<SyncResult> for Update

    source§

    fn from(value: SyncResult) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    §

    impl Freeze for Update

    §

    impl RefUnwindSafe for Update

    §

    impl Send for Update

    §

    impl Sync for Update

    §

    impl Unpin for Update

    §

    impl UnwindSafe for Update

    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/bdk_wallet/wallet/struct.Wallet.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/struct.Wallet.html index b8770760c8..5a9e18d2e0 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 @@ -16,7 +16,7 @@ network: Network, genesis_hash: BlockHash ) -> Result<Self, DescriptorError>

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

    -
    source§

    impl Wallet

    source§

    impl Wallet

    source

    pub fn new<E: IntoWalletDescriptor>( descriptor: E, change_descriptor: E, db: impl PersistBackend<ChangeSet> + Send + Sync + 'static, @@ -289,7 +289,7 @@

    §Example
    }; // sign and broadcast ...
    -
    source

    pub fn build_fee_bump( +

    source

    pub fn build_fee_bump( &mut self, txid: Txid ) -> Result<TxBuilder<'_, DefaultCoinSelectionAlgorithm>, BuildFeeBumpError>

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

    @@ -308,7 +308,7 @@
    §Example
    let tx = psbt.clone().extract_tx().expect("tx"); // broadcast tx but it's taking too long to confirm so we want to bump the fee let mut psbt = { - let mut builder = wallet.build_fee_bump(tx.txid())?; + let mut builder = wallet.build_fee_bump(tx.compute_txid())?; builder .fee_rate(FeeRate::from_sat_per_vb(5).expect("valid feerate")); builder.finish()? @@ -362,28 +362,28 @@
    §Example
    source

    pub fn next_derivation_index(&self, keychain: KeychainKind) -> u32

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

    source

    pub fn cancel_tx(&mut self, tx: &Transaction)

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

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

    -
    source

    pub fn get_psbt_input( +

    source

    pub fn get_psbt_input( &self, utxo: LocalOutput, sighash_type: Option<PsbtSighashType>, only_witness_utxo: bool ) -> Result<Input, CreateTxError>

    get the corresponding PSBT Input for a LocalUtxo

    -
    source

    pub fn descriptor_checksum(&self, keychain: KeychainKind) -> String

    Return the checksum of the public descriptor associated to keychain

    +
    source

    pub fn descriptor_checksum(&self, keychain: KeychainKind) -> String

    Return the checksum of the public descriptor associated to keychain

    Internally calls Self::get_descriptor_for_keychain to fetch the right descriptor

    -
    source

    pub fn apply_update( +

    source

    pub fn apply_update( &mut self, update: impl Into<Update> ) -> Result<(), CannotConnectError>

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

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

    -
    source

    pub fn commit(&mut self) -> Result<bool>

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

    source

    pub fn commit(&mut self) -> Result<bool>

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

    This returns whether the update resulted in any changes.

    -
    source

    pub fn staged(&self) -> &ChangeSet

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

    -
    source

    pub fn tx_graph(&self) -> &TxGraph<ConfirmationTimeHeightAnchor>

    Get a reference to the inner [TxGraph].

    -
    source

    pub fn spk_index(&self) -> &KeychainTxOutIndex<KeychainKind>

    Get a reference to the inner [KeychainTxOutIndex].

    -
    source

    pub fn local_chain(&self) -> &LocalChain

    Get a reference to the inner [LocalChain].

    -
    source

    pub fn apply_block( +

    source

    pub fn staged(&self) -> &ChangeSet

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

    +
    source

    pub fn tx_graph(&self) -> &TxGraph<ConfirmationTimeHeightAnchor>

    Get a reference to the inner [TxGraph].

    +
    source

    pub fn spk_index(&self) -> &KeychainTxOutIndex<KeychainKind>

    Get a reference to the inner [KeychainTxOutIndex].

    +
    source

    pub fn local_chain(&self) -> &LocalChain

    Get a reference to the inner [LocalChain].

    +
    source

    pub fn apply_block( &mut self, block: &Block, height: u32 @@ -391,7 +391,7 @@

    §Example
    prev_blockhash of the block’s header.

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

    -
    source

    pub fn apply_block_connected_to( +

    source

    pub fn apply_block_connected_to( &mut self, block: &Block, height: u32, @@ -401,7 +401,7 @@

    §Example

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

    -
    source

    pub fn apply_unconfirmed_txs<'t>( +

    source

    pub fn apply_unconfirmed_txs<'t>( &mut self, unconfirmed_txs: impl IntoIterator<Item = (&'t Transaction, u64)> )

    Apply relevant unconfirmed transactions to the wallet.

    @@ -410,18 +410,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/bdk_wallet/wallet/tx_builder/enum.AddForeignUtxoError.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/enum.AddForeignUtxoError.html index 86044fd6d3..47cf2758d5 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/enum.AddForeignUtxoError.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/enum.AddForeignUtxoError.html @@ -1,4 +1,4 @@ -AddForeignUtxoError in bdk_wallet::wallet::tx_builder - Rust

    Enum bdk_wallet::wallet::tx_builder::AddForeignUtxoError

    source ·
    pub enum AddForeignUtxoError {
    +AddForeignUtxoError in bdk_wallet::wallet::tx_builder - Rust

    Enum bdk_wallet::wallet::tx_builder::AddForeignUtxoError

    source ·
    pub enum AddForeignUtxoError {
         InvalidTxid {
             input_txid: Txid,
             foreign_utxo: OutPoint,
    @@ -11,7 +11,7 @@
     
    §foreign_utxo: OutPoint

    Foreign UTXO outpoint

    §

    InvalidOutpoint(OutPoint)

    Requested outpoint doesn’t exist in the tx (vout greater than available outputs)

    §

    MissingUtxo

    Foreign utxo missing witness_utxo or non_witness_utxo

    -

    Trait Implementations§

    source§

    impl Debug for AddForeignUtxoError

    source§

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

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

    impl Display for AddForeignUtxoError

    source§

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

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

    impl Error for AddForeignUtxoError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Debug for AddForeignUtxoError

    source§

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

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

    impl Display for AddForeignUtxoError

    source§

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

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

    impl Error for AddForeignUtxoError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    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/bdk_wallet/wallet/tx_builder/enum.AddUtxoError.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/enum.AddUtxoError.html index c9379ef957..2c6751074c 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/enum.AddUtxoError.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/enum.AddUtxoError.html @@ -1,8 +1,8 @@ -AddUtxoError in bdk_wallet::wallet::tx_builder - Rust

    Enum bdk_wallet::wallet::tx_builder::AddUtxoError

    source ·
    pub enum AddUtxoError {
    +AddUtxoError in bdk_wallet::wallet::tx_builder - Rust

    Enum bdk_wallet::wallet::tx_builder::AddUtxoError

    source ·
    pub enum AddUtxoError {
         UnknownUtxo(OutPoint),
     }
    Expand description

    Error returned from TxBuilder::add_utxo and TxBuilder::add_utxos

    Variants§

    §

    UnknownUtxo(OutPoint)

    Happens when trying to spend an UTXO that is not in the internal database

    -

    Trait Implementations§

    source§

    impl Debug for AddUtxoError

    source§

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

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

    impl Display for AddUtxoError

    source§

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

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

    impl Error for AddUtxoError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Trait Implementations§

    source§

    impl Debug for AddUtxoError

    source§

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

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

    impl Display for AddUtxoError

    source§

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

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

    impl Error for AddUtxoError

    1.30.0 · source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    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/bdk_wallet/wallet/tx_builder/enum.ChangeSpendPolicy.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/enum.ChangeSpendPolicy.html index 59de0b6273..063b9ff244 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/enum.ChangeSpendPolicy.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/enum.ChangeSpendPolicy.html @@ -1,4 +1,4 @@ -ChangeSpendPolicy in bdk_wallet::wallet::tx_builder - Rust

    Enum bdk_wallet::wallet::tx_builder::ChangeSpendPolicy

    source ·
    pub enum ChangeSpendPolicy {
    +ChangeSpendPolicy in bdk_wallet::wallet::tx_builder - Rust

    Enum bdk_wallet::wallet::tx_builder::ChangeSpendPolicy

    source ·
    pub enum ChangeSpendPolicy {
         ChangeAllowed,
         OnlyChange,
         ChangeForbidden,
    @@ -6,16 +6,16 @@
     

    Variants§

    §

    ChangeAllowed

    Use both change and non-change outputs (default)

    §

    OnlyChange

    Only use change outputs (see TxBuilder::only_spend_change)

    §

    ChangeForbidden

    Only use non-change outputs (see TxBuilder::do_not_spend_change)

    -

    Trait Implementations§

    source§

    impl Clone for ChangeSpendPolicy

    source§

    fn clone(&self) -> ChangeSpendPolicy

    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 Debug for ChangeSpendPolicy

    source§

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

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

    impl Default for ChangeSpendPolicy

    source§

    fn default() -> ChangeSpendPolicy

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

    impl Hash for ChangeSpendPolicy

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where +

    Trait Implementations§

    source§

    impl Clone for ChangeSpendPolicy

    source§

    fn clone(&self) -> ChangeSpendPolicy

    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 Debug for ChangeSpendPolicy

    source§

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

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

    impl Default for ChangeSpendPolicy

    source§

    fn default() -> ChangeSpendPolicy

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

    impl Hash for ChangeSpendPolicy

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where H: Hasher, - Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    source§

    impl Ord for ChangeSpendPolicy

    source§

    fn cmp(&self, other: &ChangeSpendPolicy) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Self
    where + Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    source§

    impl Ord for ChangeSpendPolicy

    source§

    fn cmp(&self, other: &ChangeSpendPolicy) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · source§

    fn min(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · source§

    fn clamp(self, min: Self, max: Self) -> Self
    where - Self: Sized + PartialOrd,

    Restrict a value to a certain interval. Read more
    source§

    impl PartialEq for ChangeSpendPolicy

    source§

    fn eq(&self, other: &ChangeSpendPolicy) -> bool

    This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,
    Restrict a value to a certain interval. Read more
    source§

    impl PartialEq for ChangeSpendPolicy

    source§

    fn eq(&self, other: &ChangeSpendPolicy) -> 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 PartialOrd for ChangeSpendPolicy

    source§

    fn partial_cmp(&self, other: &ChangeSpendPolicy) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

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

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

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

    This method tests less than or equal to (for self and other) and is used by the <= +sufficient, and should not be overridden without very good reason.
    source§

    impl PartialOrd for ChangeSpendPolicy

    source§

    fn partial_cmp(&self, other: &ChangeSpendPolicy) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

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

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

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

    This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
    1.0.0 · source§

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

    This method tests greater than (for self and other) and is used by the > operator. Read more
    1.0.0 · source§

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

    This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
    source§

    impl Copy for ChangeSpendPolicy

    source§

    impl Eq for ChangeSpendPolicy

    source§

    impl StructuralPartialEq for ChangeSpendPolicy

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +operator. Read more

    source§

    impl Copy for ChangeSpendPolicy

    source§

    impl Eq for ChangeSpendPolicy

    source§

    impl StructuralPartialEq for ChangeSpendPolicy

    Auto Trait Implementations§

    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/bdk_wallet/wallet/tx_builder/enum.TxOrdering.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/enum.TxOrdering.html index 4187f5d347..3d9f933a34 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/enum.TxOrdering.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/enum.TxOrdering.html @@ -1,4 +1,4 @@ -TxOrdering in bdk_wallet::wallet::tx_builder - Rust

    Enum bdk_wallet::wallet::tx_builder::TxOrdering

    source ·
    pub enum TxOrdering {
    +TxOrdering in bdk_wallet::wallet::tx_builder - Rust

    Enum bdk_wallet::wallet::tx_builder::TxOrdering

    source ·
    pub enum TxOrdering {
         Shuffle,
         Untouched,
         Bip69Lexicographic,
    @@ -6,17 +6,17 @@
     

    Variants§

    §

    Shuffle

    Randomized (default)

    §

    Untouched

    Unchanged

    §

    Bip69Lexicographic

    BIP69 / Lexicographic

    -

    Implementations§

    source§

    impl TxOrdering

    source

    pub fn sort_tx(&self, tx: &mut Transaction)

    Sort transaction inputs and outputs by TxOrdering variant

    -

    Trait Implementations§

    source§

    impl Clone for TxOrdering

    source§

    fn clone(&self) -> TxOrdering

    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 Debug for TxOrdering

    source§

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

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

    impl Default for TxOrdering

    source§

    fn default() -> TxOrdering

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

    impl Hash for TxOrdering

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where +

    Implementations§

    source§

    impl TxOrdering

    source

    pub fn sort_tx(&self, tx: &mut Transaction)

    Sort transaction inputs and outputs by TxOrdering variant

    +

    Trait Implementations§

    source§

    impl Clone for TxOrdering

    source§

    fn clone(&self) -> TxOrdering

    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 Debug for TxOrdering

    source§

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

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

    impl Default for TxOrdering

    source§

    fn default() -> TxOrdering

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

    impl Hash for TxOrdering

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where H: Hasher, - Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    source§

    impl Ord for TxOrdering

    source§

    fn cmp(&self, other: &TxOrdering) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Self
    where + Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    source§

    impl Ord for TxOrdering

    source§

    fn cmp(&self, other: &TxOrdering) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · source§

    fn min(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · source§

    fn clamp(self, min: Self, max: Self) -> Self
    where - Self: Sized + PartialOrd,

    Restrict a value to a certain interval. Read more
    source§

    impl PartialEq for TxOrdering

    source§

    fn eq(&self, other: &TxOrdering) -> bool

    This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,
    Restrict a value to a certain interval. Read more
    source§

    impl PartialEq for TxOrdering

    source§

    fn eq(&self, other: &TxOrdering) -> 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 PartialOrd for TxOrdering

    source§

    fn partial_cmp(&self, other: &TxOrdering) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

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

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

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

    This method tests less than or equal to (for self and other) and is used by the <= +sufficient, and should not be overridden without very good reason.
    source§

    impl PartialOrd for TxOrdering

    source§

    fn partial_cmp(&self, other: &TxOrdering) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

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

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

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

    This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
    1.0.0 · source§

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

    This method tests greater than (for self and other) and is used by the > operator. Read more
    1.0.0 · source§

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

    This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
    source§

    impl Copy for TxOrdering

    source§

    impl Eq for TxOrdering

    source§

    impl StructuralPartialEq for TxOrdering

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +operator. Read more

    source§

    impl Copy for TxOrdering

    source§

    impl Eq for TxOrdering

    source§

    impl StructuralPartialEq for TxOrdering

    Auto Trait Implementations§

    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/bdk_wallet/wallet/tx_builder/index.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/index.html index d4b26ba5ce..a7e4d4ccb9 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/index.html @@ -1,4 +1,4 @@ -bdk_wallet::wallet::tx_builder - Rust

    Module bdk_wallet::wallet::tx_builder

    source ·
    Expand description

    Transaction builder

    +bdk_wallet::wallet::tx_builder - Rust

    Module bdk_wallet::wallet::tx_builder

    source ·
    Expand description

    Transaction builder

    §Example

    // create a TxBuilder from a wallet
     let mut tx_builder = wallet.build_tx();
    diff --git a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/struct.TxBuilder.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/struct.TxBuilder.html
    index 60fb0ddd7b..7185fd8640 100644
    --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/struct.TxBuilder.html
    +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/tx_builder/struct.TxBuilder.html
    @@ -29,7 +29,7 @@
     

    At the moment coin_selection is an exception to the rule as it consumes self. This means it is usually best to call coin_selection on the return value of build_tx before assigning it.

    For further examples see this module’s documentation;

    -

    Implementations§

    source§

    impl<'a, Cs> TxBuilder<'a, Cs>

    source

    pub fn fee_rate(&mut self, fee_rate: FeeRate) -> &mut Self

    Set a custom fee rate.

    +

    Implementations§

    source§

    impl<'a, Cs> TxBuilder<'a, Cs>

    source

    pub fn fee_rate(&mut self, fee_rate: FeeRate) -> &mut Self

    Set a custom fee rate.

    This method sets the mining fee paid by the transaction as a rate on its size. This means that the total fee paid is equal to fee_rate times the size of the transaction. Default is 1 sat/vB in accordance with Bitcoin Core’s default @@ -96,20 +96,20 @@

    §Example
    .add_recipient(to_address.script_pubkey(), Amount::from_sat(50_000)) .policy_path(path, KeychainKind::External);
    -
    source

    pub fn add_utxos( +

    source

    pub fn add_utxos( &mut self, outpoints: &[OutPoint] ) -> Result<&mut Self, AddUtxoError>

    Add the list of outpoints to the internal list of UTXOs that must be spent.

    If an error occurs while adding any of the UTXOs then none of them are added and the error is returned.

    These have priority over the “unspendable” utxos, meaning that if a utxo is present both in the “utxos” and the “unspendable” list, it will be spent.

    -
    source

    pub fn add_utxo( +

    source

    pub fn add_utxo( &mut self, outpoint: OutPoint ) -> Result<&mut Self, AddUtxoError>

    Add a utxo to the internal list of utxos that must be spent

    These have priority over the “unspendable” utxos, meaning that if a utxo is present both in the “utxos” and the “unspendable” list, it will be spent.

    -
    source

    pub fn add_foreign_utxo( +

    source

    pub fn add_foreign_utxo( &mut self, outpoint: OutPoint, psbt_input: Input, @@ -149,64 +149,64 @@

    §Errors

    Note unless you set only_witness_utxo any non-taproot psbt_input you pass to this method must have non_witness_utxo set otherwise you will get an error when finish is called.

    -
    source

    pub fn add_foreign_utxo_with_sequence( +

    source

    pub fn add_foreign_utxo_with_sequence( &mut self, outpoint: OutPoint, psbt_input: Input, satisfaction_weight: usize, sequence: Sequence ) -> Result<&mut Self, AddForeignUtxoError>

    Same as add_foreign_utxo but allows to set the nSequence value.

    -
    source

    pub fn manually_selected_only(&mut self) -> &mut Self

    Only spend utxos added by add_utxo.

    +
    source

    pub fn manually_selected_only(&mut self) -> &mut Self

    Only spend utxos added by add_utxo.

    The wallet will not add additional utxos to the transaction even if they are needed to make the transaction valid.

    -
    source

    pub fn unspendable(&mut self, unspendable: Vec<OutPoint>) -> &mut Self

    Replace the internal list of unspendable utxos with a new list

    +
    source

    pub fn unspendable(&mut self, unspendable: Vec<OutPoint>) -> &mut Self

    Replace the internal list of unspendable utxos with a new list

    It’s important to note that the “must-be-spent” utxos added with TxBuilder::add_utxo have priority over these. See the docs of the two linked methods for more details.

    -
    source

    pub fn add_unspendable(&mut self, unspendable: OutPoint) -> &mut Self

    Add a utxo to the internal list of unspendable utxos

    +
    source

    pub fn add_unspendable(&mut self, unspendable: OutPoint) -> &mut Self

    Add a utxo to the internal list of unspendable utxos

    It’s important to note that the “must-be-spent” utxos added with TxBuilder::add_utxo have priority over this. See the docs of the two linked methods for more details.

    -
    source

    pub fn sighash(&mut self, sighash: PsbtSighashType) -> &mut Self

    Sign with a specific sig hash

    +
    source

    pub fn sighash(&mut self, sighash: PsbtSighashType) -> &mut Self

    Sign with a specific sig hash

    Use this option very carefully

    -
    source

    pub fn ordering(&mut self, ordering: TxOrdering) -> &mut Self

    Choose the ordering for inputs and outputs of the transaction

    -
    source

    pub fn nlocktime(&mut self, locktime: LockTime) -> &mut Self

    Use a specific nLockTime while creating the transaction

    +
    source

    pub fn ordering(&mut self, ordering: TxOrdering) -> &mut Self

    Choose the ordering for inputs and outputs of the transaction

    +
    source

    pub fn nlocktime(&mut self, locktime: LockTime) -> &mut Self

    Use a specific nLockTime while creating the transaction

    This can cause conflicts if the wallet’s descriptors contain an “after” (OP_CLTV) operator.

    -
    source

    pub fn version(&mut self, version: i32) -> &mut Self

    Build a transaction with a specific version

    +
    source

    pub fn version(&mut self, version: i32) -> &mut Self

    Build a transaction with a specific version

    The version should always be greater than 0 and greater than 1 if the wallet’s descriptors contain an “older” (OP_CSV) operator.

    -
    source

    pub fn do_not_spend_change(&mut self) -> &mut Self

    Do not spend change outputs

    +
    source

    pub fn do_not_spend_change(&mut self) -> &mut Self

    Do not spend change outputs

    This effectively adds all the change outputs to the “unspendable” list. See TxBuilder::unspendable.

    -
    source

    pub fn only_spend_change(&mut self) -> &mut Self

    Only spend change outputs

    +
    source

    pub fn only_spend_change(&mut self) -> &mut Self

    Only spend change outputs

    This effectively adds all the non-change outputs to the “unspendable” list. See TxBuilder::unspendable.

    -
    source

    pub fn change_policy(&mut self, change_policy: ChangeSpendPolicy) -> &mut Self

    source

    pub fn change_policy(&mut self, change_policy: ChangeSpendPolicy) -> &mut Self

    source

    pub fn only_witness_utxo(&mut self) -> &mut Self

    Only Fill-in the psbt::Input::witness_utxo field when spending from +

    source

    pub fn only_witness_utxo(&mut self) -> &mut Self

    Only Fill-in the psbt::Input::witness_utxo field when spending from SegWit descriptors.

    This reduces the size of the PSBT, but some signers might reject them due to the lack of the non_witness_utxo.

    -
    source

    pub fn include_output_redeem_witness_script(&mut self) -> &mut Self

    Fill-in the psbt::Output::redeem_script and +

    source

    pub fn include_output_redeem_witness_script(&mut self) -> &mut Self

    Fill-in the psbt::Output::redeem_script and psbt::Output::witness_script fields.

    This is useful for signers which always require it, like ColdCard hardware wallets.

    -
    source

    pub fn add_global_xpubs(&mut self) -> &mut Self

    Fill-in the PSBT_GLOBAL_XPUB field with the extended keys contained in both the external +

    source

    pub fn add_global_xpubs(&mut self) -> &mut Self

    Fill-in the PSBT_GLOBAL_XPUB field with the extended keys contained in both the external and internal descriptors

    This is useful for offline signers that take part to a multisig. Some hardware wallets like BitBox and ColdCard are known to require this.

    -
    source

    pub fn drain_wallet(&mut self) -> &mut Self

    Spend all the available inputs. This respects filters like TxBuilder::unspendable and the change policy.

    -
    source

    pub fn coin_selection<P: CoinSelectionAlgorithm>( +

    source

    pub fn drain_wallet(&mut self) -> &mut Self

    Spend all the available inputs. This respects filters like TxBuilder::unspendable and the change policy.

    +
    source

    pub fn coin_selection<P: CoinSelectionAlgorithm>( self, coin_selection: P ) -> TxBuilder<'a, P>

    Choose the coin selection algorithm

    Overrides the CoinSelectionAlgorithm.

    Note that this function consumes the builder and returns it so it is usually best to put this as the first call on the builder.

    -
    source

    pub fn enable_rbf(&mut self) -> &mut Self

    Enable signaling RBF

    +
    source

    pub fn enable_rbf(&mut self) -> &mut Self

    Enable signaling RBF

    This will use the default nSequence value of 0xFFFFFFFD.

    -
    source

    pub fn enable_rbf_with_sequence(&mut self, nsequence: Sequence) -> &mut Self

    Enable signaling RBF with a specific nSequence value

    +
    source

    pub fn enable_rbf_with_sequence(&mut self, nsequence: Sequence) -> &mut Self

    Enable signaling RBF with a specific nSequence value

    This can cause conflicts if the wallet’s descriptors contain an “older” (OP_CSV) operator and the given nsequence is lower than the CSV value.

    If the nsequence is higher than 0xFFFFFFFD an error will be thrown, since it would not be a valid nSequence to signal RBF.

    -
    source

    pub fn current_height(&mut self, height: u32) -> &mut Self

    Set the current blockchain height.

    +
    source

    pub fn current_height(&mut self, height: u32) -> &mut Self

    Set the current blockchain height.

    This will be used to:

    1. Set the nLockTime for preventing fee sniping. @@ -217,19 +217,19 @@
      §Errors
      add them using TxBuilder::add_utxos.

    In both cases, if you don’t provide a current height, we use the last sync height.

    -
    source

    pub fn allow_dust(&mut self, allow_dust: bool) -> &mut Self

    Set whether or not the dust limit is checked.

    +
    source

    pub fn allow_dust(&mut self, allow_dust: bool) -> &mut Self

    Set whether or not the dust limit is checked.

    Note: by avoiding a dust limit check you may end up with a transaction that is non-standard.

    -
    source

    pub fn set_recipients( +

    source

    pub fn set_recipients( &mut self, recipients: Vec<(ScriptBuf, Amount)> ) -> &mut Self

    Replace the recipients already added with a new list

    -
    source

    pub fn add_recipient( +

    source

    pub fn add_recipient( &mut self, script_pubkey: ScriptBuf, amount: Amount ) -> &mut Self

    Add a recipient to the internal list

    -
    source

    pub fn add_data<T: AsRef<PushBytes>>(&mut self, data: &T) -> &mut Self

    Add data as an output, using OP_RETURN

    -
    source

    pub fn drain_to(&mut self, script_pubkey: ScriptBuf) -> &mut Self

    Sets the address to drain excess coins to.

    +
    source

    pub fn add_data<T: AsRef<PushBytes>>(&mut self, data: &T) -> &mut Self

    Add data as an output, using OP_RETURN

    +
    source

    pub fn drain_to(&mut self, script_pubkey: ScriptBuf) -> &mut Self

    Sets the address to drain excess coins to.

    Usually, when there are excess coins they are sent to a change address generated by the wallet. This option replaces the usual change address with an arbitrary script_pubkey of your choosing. Just as with a change output, if the drain output is not needed (the excess @@ -255,7 +255,7 @@

    §Example
    .fee_rate(FeeRate::from_sat_per_vb(5).expect("valid feerate")) .enable_rbf(); let psbt = tx_builder.finish()?;
    -
    source§

    impl<'a, Cs: CoinSelectionAlgorithm> TxBuilder<'a, Cs>

    source

    pub fn finish(self) -> Result<Psbt, CreateTxError>

    Finish building the transaction.

    +
    source§

    impl<'a, Cs: CoinSelectionAlgorithm> TxBuilder<'a, Cs>

    source

    pub fn finish(self) -> Result<Psbt, CreateTxError>

    Finish building the transaction.

    Returns a new [Psbt] per BIP174.

    Trait Implementations§

    source§

    impl<'a, Cs: Clone> Clone for TxBuilder<'a, Cs>

    source§

    fn clone(&self) -> Self

    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, Cs: Debug> Debug for TxBuilder<'a, Cs>

    source§

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

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    §

    impl<'a, Cs> Freeze for TxBuilder<'a, Cs>
    where Cs: Freeze,

    §

    impl<'a, Cs> !RefUnwindSafe for TxBuilder<'a, Cs>

    §

    impl<'a, Cs> !Send for TxBuilder<'a, Cs>

    §

    impl<'a, Cs> !Sync for TxBuilder<'a, Cs>

    §

    impl<'a, Cs> Unpin for TxBuilder<'a, Cs>
    where diff --git a/docs-rs/bdk/nightly/latest/example_cli/enum.CoinSelectionAlgo.html b/docs-rs/bdk/nightly/latest/example_cli/enum.CoinSelectionAlgo.html index 1d53aa72d4..172fcdd28b 100644 --- a/docs-rs/bdk/nightly/latest/example_cli/enum.CoinSelectionAlgo.html +++ b/docs-rs/bdk/nightly/latest/example_cli/enum.CoinSelectionAlgo.html @@ -4,7 +4,7 @@ OldestFirst, NewestFirst, BranchAndBound, -}

    Variants§

    §

    LargestFirst

    §

    SmallestFirst

    §

    OldestFirst

    §

    NewestFirst

    §

    BranchAndBound

    Trait Implementations§

    source§

    impl Clone for CoinSelectionAlgo

    source§

    fn clone(&self) -> CoinSelectionAlgo

    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 Debug for CoinSelectionAlgo

    source§

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

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

    impl Default for CoinSelectionAlgo

    source§

    fn default() -> Self

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

    impl Display for CoinSelectionAlgo

    source§

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

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

    impl FromStr for CoinSelectionAlgo

    §

    type Err = Error

    The associated error which can be returned from parsing.
    source§

    fn from_str(s: &str) -> Result<Self, Self::Err>

    Parses a string s to return a value of this type. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +}

    Variants§

    §

    LargestFirst

    §

    SmallestFirst

    §

    OldestFirst

    §

    NewestFirst

    §

    BranchAndBound

    Trait Implementations§

    source§

    impl Clone for CoinSelectionAlgo

    source§

    fn clone(&self) -> CoinSelectionAlgo

    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 Debug for CoinSelectionAlgo

    source§

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

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

    impl Default for CoinSelectionAlgo

    source§

    fn default() -> Self

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

    impl Display for CoinSelectionAlgo

    source§

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

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

    impl FromStr for CoinSelectionAlgo

    §

    type Err = Error

    The associated error which can be returned from parsing.
    source§

    fn from_str(s: &str) -> Result<Self, Self::Err>

    Parses a string s to return a value of this type. Read more

    Auto Trait Implementations§

    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/enum.Keychain.html b/docs-rs/bdk/nightly/latest/example_cli/enum.Keychain.html index ac2e18d736..593f64f759 100644 --- a/docs-rs/bdk/nightly/latest/example_cli/enum.Keychain.html +++ b/docs-rs/bdk/nightly/latest/example_cli/enum.Keychain.html @@ -1,8 +1,8 @@ Keychain in example_cli - Rust

    Enum example_cli::Keychain

    source ·
    pub enum Keychain {
         External,
         Internal,
    -}

    Variants§

    §

    External

    §

    Internal

    Trait Implementations§

    source§

    impl Clone for Keychain

    source§

    fn clone(&self) -> Keychain

    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 Debug for Keychain

    source§

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

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

    impl<'de> Deserialize<'de> for Keychain

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for Keychain

    source§

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

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

    impl Ord for Keychain

    source§

    fn cmp(&self, other: &Keychain) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Self
    where +}

    Variants§

    §

    External

    §

    Internal

    Trait Implementations§

    source§

    impl Clone for Keychain

    source§

    fn clone(&self) -> Keychain

    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 Debug for Keychain

    source§

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

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

    impl<'de> Deserialize<'de> for Keychain

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where + __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for Keychain

    source§

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

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

    impl Ord for Keychain

    source§

    fn cmp(&self, other: &Keychain) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · source§

    fn min(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · source§

    fn clamp(self, min: Self, max: Self) -> Self
    where Self: Sized + PartialOrd,

    Restrict a value to a certain interval. Read more
    source§

    impl PartialEq for Keychain

    source§

    fn eq(&self, other: &Keychain) -> bool

    This method tests for self and other values to be equal, and is used diff --git a/docs-rs/bdk/nightly/latest/example_electrum/type.ChangeSet.html b/docs-rs/bdk/nightly/latest/example_electrum/type.ChangeSet.html index be32deed0e..3ec31251e2 100644 --- a/docs-rs/bdk/nightly/latest/example_electrum/type.ChangeSet.html +++ b/docs-rs/bdk/nightly/latest/example_electrum/type.ChangeSet.html @@ -1 +1 @@ -ChangeSet in example_electrum - Rust

    Type Alias example_electrum::ChangeSet

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

    Type Alias example_electrum::ChangeSet

    source ·
    pub(crate) type ChangeSet = (ChangeSet, ChangeSet<ConfirmationHeightAnchor, ChangeSet<Keychain>>);
    \ 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 28b86f336f..535547b922 100644 --- a/docs-rs/bdk/nightly/latest/search-index.js +++ b/docs-rs/bdk/nightly/latest/search-index.js @@ -1,16 +1,16 @@ 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":"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}}}{}{}}000000100{{{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}11{{{Dn{{d{C`}}{d{Dl}}}}}Ab}{{{Dn{C`Dl}}}Ab}3333{Ann}4{{{d{E`}}AbEb}Ed}{{{d{E`}}AbEb}Ab}{{{d{E`}}AbEb}Ad}{{{d{E`}}AbEb}Af}{cn{}}05{{{d{{Bd{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{{Bd{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`}{{{If{c}}}{{Hd{e{If{c}}}}}{}{}}2{{{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{Fl}}}{}}{c{{Cb{Gh}}}{}}10{{{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,"array"],[1,"slice"],[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;+%3C%24hash+as+%24crate::Hash%3E::LEN%5D%3E-for-DescriptorId"],[36,"impl-AsRef%3C%5Bu8%5D%3E-for-DescriptorId"],[119,"impl-LowerHex-for-DescriptorId"],[120,"impl-Debug-for-DescriptorId"],[121,"impl-UpperHex-for-DescriptorId"],[122,"impl-Display-for-DescriptorId"],[128,"impl-From%3C(%26u32,+%26BlockHash)%3E-for-BlockId"],[129,"impl-From%3C(u32,+BlockHash)%3E-for-BlockId"],[299,"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"],[335,"impl-KeychainTxOutIndex%3CK%3E"],[336,"impl-Indexer-for-KeychainTxOutIndex%3CK%3E"],[359,"impl-Display-for-Balance"],[360,"impl-Debug-for-Balance"],[482,"impl-Debug-for-MissingGenesisError"],[483,"impl-Display-for-MissingGenesisError"],[484,"impl-Debug-for-AlterCheckPointError"],[485,"impl-Display-for-AlterCheckPointError"],[486,"impl-Debug-for-CannotConnectError"],[487,"impl-Display-for-CannotConnectError"],[488,"impl-Display-for-ApplyHeaderError"],[489,"impl-Debug-for-ApplyHeaderError"],[703,"impl-Display-for-CalculateFeeError"],[704,"impl-Debug-for-CalculateFeeError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAALgBSQASAAAAFQAAABkAAAAbAAIAIQABACQAFQA7ABEATgAGAFoAAQBdAAMAYwAEAGkAEgB+AAAAgQABAIcAAACKAAQAkAACAJQABQCcAAAAngABAKEAAACsAAAAtQAAALoAAAC+AAEAwwAGAM0ABQDWAAkA4QASAPkACAAFAQgAFQEAABsBAAAfAQsALAEBAD0BAABAAQkATQEAAFEBDABfAQoAcAECAHkBAACSAQEAlQEDAJwBBQClAQIArQECAL8BGQDaAQUA4QEJAPsBAAAJAgIADwIAABYCEAAoAg0ANwIGAEICBwBtAgcAdgIHAIwCAACPAgAAkgINAKICEQC1AgQAvQIFANwCAQDfAgAA5gIBAOkCBwD0AgYA/QIGAA0DBgAVAwYA"}],\ -["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{}}000{AlBl}{ClBl}22222222{{{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-Debug-for-ExcessStrategyKind"],[101,"impl-Display-for-ExcessStrategyKind"],[108,"impl-From%3Cusize%3E-for-BnbLimit"],[109,"impl-From%3CDuration%3E-for-BnbLimit"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAKcAFwAAAAAAAgAAAAYAAAAJAAIADgADABcAAgAcAAEAIAAAACIAKgBQAAIAVgAEAFwACwBtAAEAdwABAIcAAQCKAAEAkgANAKEAAACjAAAApgAAAKoAMADcAAwA6gABAA=="}],\ -["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_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::blockdata::block"],[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,"core::option"],[41,"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",31],[6,"Option",40],[5,"Header",31],[5,"TypeId",41]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAA0ABAAEAAAACAADAA4AAAAYAAcA"}],\ +["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::blockdata::block"],[816,"bitcoin_hashes"],[817,"bdk_chain::chain_oracle"],[818,"core::hash"],[819,"core::slice::index"],[820,"bitcoin::blockdata::script::borrowed"],[821,"bitcoin::blockdata::transaction"],[822,"bitcoin_units::amount"],[823,"core::ops::range"],[824,"alloc::collections::btree::set"],[825,"core::iter::traits::double_ended"],[826,"serde::ser"],[827,"alloc::string"],[828,"core::iter::traits::exact_size"],[829,"core::any"],[830,"core::iter::traits::collect"],[831,"core::default"],[832,"bdk_chain::keychain::txout_index"],[833,"core::iter::traits::iterator"],[834,"core::marker"],[835,"core::ops::function"],[836,"core::convert"],[837,"alloc::sync"],[838,"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,74,78,78,74,78,77,74,78,77,74,78,77,74,78,77,77,74,78,77,74,77,74,77,74,78,77,77,74,78,77,78,77,78,78,78,78,78,78,74,78,77,74,78,78,78,78,78,74,74,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,74,77,78,74,78,77,77,77,77,77,74,78,77,74,78,77,78,78,78,74,78,77,78,78,77,78,78,74,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,75,98,75,75,70,70,70,70,70,102,103,70,98,99,97,75,102,103,70,98,99,97,75,70,99,102,102,103,103,70,98,99,75,70,98,99,75,98,99,70,75,98,75,70,70,98,99,97,75,70,70,70,70,98,99,97,97,75,102,103,70,98,99,97,75,70,70,70,70,70,70,70,70,70,70,70,102,103,70,98,99,97,75,102,103,70,75,75,98,70,70,75,70,102,103,70,98,99,75,70,98,99,75,97,70,70,70,102,103,70,98,99,97,75,70,70,102,103,70,98,99,97,75,70,98,99,70,70,98,75,75,75,102,103,70,98,99,97,75,70,102,103,70,98,99,97,75,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}}}{}{}}000000010{{{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}1{{{Dn{{d{C`}}{d{Dl}}}}}Ab}{{{Dn{C`Dl}}}Ab}3333{Ann}4{{{d{E`}}AbEb}Ed}{{{d{E`}}AbEb}Ab}{{{d{E`}}AbEb}Ad}{{{d{E`}}AbEb}Af}{cn{}}05{{{d{{Bd{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{{Bd{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{e{Id{c}}}}}{}{}}{{{If{c}}}{{Hd{ce}}}{}I`}2{{{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{Id{c}}}}{Id{c}}}All}{{{d{Ah{Il{c}}}}{Id{c}}}Al{jlDj}}{{{d{Ah{Il{c}}}}e}Al{jlDj}{}}{{{d{c}}}{{d{e}}}{}{}}00{{{d{Ahc}}}{{d{Ahe}}}{}{}}00{{{d{{Id{c}}}}}{{Id{c}}}j}{{{d{{Il{c}}}}}{{Il{c}}}j}{{{d{Ij}}}Ij}{{{d{c}}{d{Ahe}}}Al{}{}}00`{{}{{Id{c}}}{}}{{}{{Il{c}}}{}}{{}Ij}{c{{Cl{{Id{e}}}}}Cn{lIb}}{c{{Cl{Ij}}}Cn}{{{d{{Id{c}}}}{d{{Id{c}}}}}DbDd}{{{d{Ij}}{d{Ij}}}Db}{{{d{{Id{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}}}{{Id{c}}}{jlDj}}{ce{}{}}00{{{d{{Id{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}}}}{Id{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}}}}{Id{c}}}}}}}{jlDj}}{{{d{Ah{Il{c}}}}{d{{h{cC`}}}}}{{Dn{{h{c{Bl{{Cf{Cd}}}}}}{Id{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{{Id{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{{If{c}}}}}{{`{{K`{}{{Gb{C`}}}}}}}A`}``{{{d{Ah{If{c}}}}{If{c}}}All}{{{d{Ah{Hl{c}}}}{If{c}}}Al{jl}}{{{d{Ah{Hl{c}}}}{Hl{c}}}{{If{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}{{If{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{Fl}}}{}}{c{{Cb{Gh}}}{}}01{{{d{{Hl{c}}}}}{{Hl{c}}}j}{{{d{{Ld{ce}}}}}{{Ld{ce}}}jj}{{{d{{Lf{ce}}}}}{{Lf{ce}}}jj}{{{d{{If{c}}}}}{{If{c}}}j}{{{d{c}}{d{Ahe}}}Al{}{}}000{{{d{{Ld{ce}}}}{d{{Ld{ce}}}}}Bnll}{{{d{{Lf{ce}}}}{d{{Lf{ce}}}}}Bnll}{{}{{Hl{c}}}{}}{{}{{If{c}}}{}}{{{d{{Ld{ce}}}}}{{d{g}}}{}{}{}}{c{{Cl{{If{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{{If{c}}}}{d{{If{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{{If{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}}}}}{{If{c}}}{jl}}{{{d{Ah{Hl{c}}}}H`c}{{If{c}}}{jl}}{{{d{Ah{Hl{c}}}}H`D`}{{If{c}}}{jl}}{{{d{Ah{Hl{c}}}}e}{{If{c}}}{jl}{{Lj{{Lh{Ff}}}}}}{{{d{Ah{Hl{c}}}}FhFj}{{If{c}}}{jl}}{ce{}{}}00000000{{{d{{Hl{c}}}}}Db{}}{{{d{{If{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}}}}}}{{{If{c}}g}{{If{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{{If{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{{If{c}}}}}{{`{{K`{}{{Gb{{Dn{Fh{d{Fj}}}}}}}}}}}{}}``{{{d{c}}}Hb{}}000000{{{d{Ah{Hl{c}}}}D`}{{If{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,"array"],[1,"slice"],[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",815],[1,"usize"],[10,"AnchorFromBlockPosition",0,804],[5,"FromSliceError",816],[1,"str"],[17,"Error"],[10,"ChainOracle",0,817],[10,"Hash",818],[10,"Hasher",818],[10,"SliceIndex",819],[5,"Script",820],[5,"Transaction",821],[5,"OutPoint",821],[5,"TxOut",821],[5,"SignedAmount",822],[10,"RangeBounds",823],[5,"BTreeSet",824],[17,"Item"],[10,"DoubleEndedIterator",825],[10,"PartialOrd",802],[5,"Amount",822],[10,"Serializer",826],[5,"String",827],[10,"ExactSizeIterator",828],[5,"Txid",821],[5,"TypeId",829],[5,"ChangeSet",272],[5,"IndexedTxGraph",272],[10,"Indexer",272],[17,"ChangeSet"],[5,"TxGraph",637],[10,"IntoIterator",830],[10,"Default",831],[10,"Deserialize",813],[5,"ChangeSet",329,832],[5,"ChangeSet",637],[10,"Serialize",826],[5,"Balance",329],[5,"KeychainTxOutIndex",329,832],[5,"LocalChain",431],[8,"ChangeSet",431],[5,"MissingGenesisError",431],[5,"Header",815],[5,"CannotConnectError",431],[6,"ApplyHeaderError",431],[5,"CheckPoint",431],[5,"AlterCheckPointError",431],[5,"CheckPointIter",431],[10,"Iterator",833],[5,"SyncRequest",573],[10,"Send",834],[17,"IntoIter"],[5,"FullScanRequest",573],[10,"FnMut",835],[10,"Sync",834],[6,"Infallible",836],[17,"Output"],[6,"CalculateFeeError",637],[5,"TxNode",637],[5,"CanonicalTx",637],[5,"Arc",837],[10,"Into",836],[5,"TxAncestors",637],[5,"TxDescendants",637],[5,"HashSet",838],[15,"Confirmed",269],[15,"Unconfirmed",269],[5,"SyncResult",573],[5,"FullScanResult",573]],"r":[[0,804],[1,804],[2,804],[3,807],[4,805],[6,817],[7,805],[8,805],[9,805],[10,805],[13,803],[14,803],[16,805],[17,272],[18,807],[19,798],[20,637],[330,832],[331,832]],"b":[[35,"impl-AsRef%3C%5Bu8;+%3C%24hash+as+%24crate::Hash%3E::LEN%5D%3E-for-DescriptorId"],[36,"impl-AsRef%3C%5Bu8%5D%3E-for-DescriptorId"],[119,"impl-Display-for-DescriptorId"],[120,"impl-LowerHex-for-DescriptorId"],[121,"impl-Debug-for-DescriptorId"],[122,"impl-UpperHex-for-DescriptorId"],[128,"impl-From%3C(%26u32,+%26BlockHash)%3E-for-BlockId"],[129,"impl-From%3C(u32,+BlockHash)%3E-for-BlockId"],[299,"impl-From%3CChangeSet%3CK%3E%3E-for-ChangeSet%3CA,+ChangeSet%3CK%3E%3E"],[300,"impl-From%3CChangeSet%3CA%3E%3E-for-ChangeSet%3CA,+IA%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-Debug-for-AlterCheckPointError"],[485,"impl-Display-for-AlterCheckPointError"],[486,"impl-Debug-for-CannotConnectError"],[487,"impl-Display-for-CannotConnectError"],[488,"impl-Debug-for-ApplyHeaderError"],[489,"impl-Display-for-ApplyHeaderError"],[703,"impl-Debug-for-CalculateFeeError"],[704,"impl-Display-for-CalculateFeeError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAALgBSQASAAAAFQAAABkAAAAbAAIAIQABACQAFQA7ABEATgAGAFoAAQBdAAMAYwAEAGkAEgB/AAAAgQABAIcAAACKAAQAkAACAJQABQCcAAAAngABAKEAAACsAAAAtQAAALoAAAC+AAEAwwAGAM0ABQDWAAkA4QASAPkACAAFAQgAFQEAABsBAAAfAQsALAEBAD0BAABAAQkATQEAAFEBDABfAQoAcAECAHkBAACSAQEAlQEDAJwBBQClAQIArQECAL8BGQDaAQUA4QEJAPsBAAAJAgIADwIAABYCEAAoAg0ANwIGAEICBwBtAgcAdgIHAIwCAACPAgAAkgINAKICEQC1AgQAvQIFANwCAQDfAgAA5gIBAOkCBwD0AgYA/QIGAA0DBgAVAwYA"}],\ +["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{ClBl}1{AlBl}22222222{{{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-Display-for-SelectionError"],[96,"impl-Debug-for-SelectionError"],[97,"impl-Display-for-SelectionConstraint"],[98,"impl-Debug-for-SelectionConstraint"],[100,"impl-Debug-for-ExcessStrategyKind"],[101,"impl-Display-for-ExcessStrategyKind"],[107,"impl-From%3CDuration%3E-for-BnbLimit"],[109,"impl-From%3Cusize%3E-for-BnbLimit"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAKcAGAAAAAAAAgAAAAYAAAAJAAIADgADABcAAgAcAAEAIAAAACIAKgBQAAIAVgAEAFwACwBsAAAAbgAAAHcAAQCHAAEAigABAJIADQChAAAAowAAAKYAAACqADAA3AAMAOoAAQA="}],\ +["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::blockdata::transaction"],[43,"alloc::sync"],[44,"electrum_client::types"],[45,"core::result"],[46,"electrum_client::api"],[47,"core::fmt"],[48,"bdk_chain::spk_client"],[49,"core::cmp"],[50,"core::clone"],[51,"bdk_chain::tx_graph"],[52,"core::convert"],[53,"core::any"],[54,"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",42],[5,"Arc",43],[6,"Error",44],[6,"Result",45],[10,"ElectrumApi",46],[5,"Formatter",47],[8,"Result",47],[10,"Debug",47],[5,"FullScanRequest",48],[1,"usize"],[1,"bool"],[5,"ElectrumFullScanResult",0,41],[10,"Ord",49],[10,"Clone",50],[1,"unit"],[5,"TxGraph",51],[10,"AsRef",52],[5,"SyncRequest",48],[5,"ElectrumSyncResult",0,41],[5,"TypeId",53],[5,"ConfirmationHeightAnchor",54],[5,"FullScanResult",48],[5,"SyncResult",48],[5,"ConfirmationTimeHeightAnchor",54]],"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}}}BlBn}{{{f{{j{c}}}}{f{bBj}}}Bl{}}{{{f{B`}}{f{bBj}}}Bl}0{cc{}}{AjBh}1111{AjB`}{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-Debug-for-IterError"],[25,"impl-Display-for-IterError"],[27,"impl-Debug-for-AggregateChangesetsError%3CC%3E"],[28,"impl-Display-for-AggregateChangesetsError%3CC%3E"],[29,"impl-Debug-for-FileError"],[30,"impl-Display-for-FileError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAADEABwAMAAkAGAAHACEAAAAmAAAALAAAAC8AAgA0ABkA"}],\ +["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}111{AjB`}{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-Debug-for-IterError"],[25,"impl-Display-for-IterError"],[27,"impl-Display-for-AggregateChangesetsError%3CC%3E"],[28,"impl-Debug-for-AggregateChangesetsError%3CC%3E"],[29,"impl-Display-for-FileError"],[30,"impl-Debug-for-FileError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAADEABwAMAAkAGAAHACIAAAAmAAAALAAAAC8AAgA0ABkA"}],\ ["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="}],\ -["bdk_persist",{"t":"FFKNNNNNONNNNNNNNNNNNONNNMONNNNNNNNNNNNNNM","n":["CombinedChangeSet","Persist","PersistBackend","append","borrow","borrow","borrow_mut","borrow_mut","chain","clone","clone_into","commit","default","deserialize","eq","fmt","fmt","from","from","from","from","indexed_tx_graph","into","into","is_empty","load_from_persistence","network","new","serialize","stage","stage_and_commit","staged","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","write_changes"],"q":[[0,"bdk_persist"],[42,"bdk_persist::changeset"],[43,"core::cmp"],[44,"bdk_chain::tx_data_traits"],[45,"core::clone"],[46,"bdk_persist::persist"],[47,"core::option"],[48,"anyhow"],[49,"core::default"],[50,"core::result"],[51,"serde::de"],[52,"core::fmt"],[53,"bdk_chain::keychain::txout_index"],[54,"bdk_chain::indexed_tx_graph"],[55,"bdk_chain::local_chain"],[56,"core::marker"],[57,"serde::ser"],[58,"core::any"]],"i":[0,0,0,2,8,2,8,2,2,2,2,8,2,2,2,8,2,8,2,2,2,2,8,2,2,25,2,8,2,8,8,8,2,8,2,8,2,8,2,8,2,25],"f":"```{{{f{b{d{ce}}}}{d{ce}}}hjl}{{{f{c}}}{{f{e}}}{}{}}0{{{f{bc}}}{{f{be}}}{}{}}0`{{{f{{d{ce}}}}}{{d{ce}}}nn}{{{f{c}}{f{be}}}h{}{}}{{{f{b{A`{c}}}}}{{Ad{{Ab{c}}}}}{AfAh}}{{}{{d{ce}}}{}{}}{c{{Aj{{d{eg}}}}}Al{jAn}{jAn}}{{{f{{d{ce}}}}{f{{d{ce}}}}}B`BbBb}{{{f{{A`{c}}}}{f{bBd}}}{{Aj{hBf}}}Bh}{{{f{{d{ce}}}}{f{bBd}}}BjBhBh}{cc{}}0{{{Bn{c{Bl{e}}}}}{{d{ec}}}{}{}}{C`{{d{ce}}}{}{}}`{ce{}{}}0{{{f{{d{ce}}}}}B`jl}{{{f{bCb}}}{{Ad{{Ab{c}}}}}{}}`{e{{A`{c}}}{AfAh}{{Cb{c}}CdCf}}{{{f{{d{ce}}}}g}Aj{jCh}{jCh}Cj}{{{f{b{A`{c}}}}c}h{AfAh}}{{{f{b{A`{c}}}}c}{{Ad{{Ab{c}}}}}{AfAh}}{{{f{{A`{c}}}}}{{f{c}}}{AfAh}}{{{f{c}}}e{}{}}{c{{Aj{e}}}{}{}}000{{{f{c}}}Cl{}}0::{{{f{bCb}}{f{c}}}{{Ad{h}}}{}}","D":"Bd","p":[[0,"mut"],[5,"CombinedChangeSet",0,42],[1,"reference"],[1,"unit"],[10,"Ord",43],[10,"Anchor",44],[10,"Clone",45],[5,"Persist",0,46],[6,"Option",47],[8,"Result",48],[10,"Default",49],[10,"Append",44],[6,"Result",50],[10,"Deserializer",51],[10,"Deserialize",51],[1,"bool"],[10,"PartialEq",43],[5,"Formatter",52],[5,"Error",52],[10,"Debug",52],[8,"Result",52],[5,"ChangeSet",53],[5,"ChangeSet",54],[8,"ChangeSet",55],[10,"PersistBackend",0,46],[10,"Send",56],[10,"Sync",56],[10,"Serialize",57],[10,"Serializer",57],[5,"TypeId",58]],"r":[[0,42],[1,46],[2,46]],"b":[[19,"impl-From%3CChangeSet%3CA,+ChangeSet%3CK%3E%3E%3E-for-CombinedChangeSet%3CK,+A%3E"],[20,"impl-From%3CBTreeMap%3Cu32,+Option%3CBlockHash%3E%3E%3E-for-CombinedChangeSet%3CK,+A%3E"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAABgABwAEAAQACgABAA0ABAAUAAEAGQAAAB0AAAAhAAgA"}],\ +["bdk_persist",{"t":"FFKNNNNNONNNNNNNNNNNNONNNMONNNNNNNNNNNNNNM","n":["CombinedChangeSet","Persist","PersistBackend","append","borrow","borrow","borrow_mut","borrow_mut","chain","clone","clone_into","commit","default","deserialize","eq","fmt","fmt","from","from","from","from","indexed_tx_graph","into","into","is_empty","load_from_persistence","network","new","serialize","stage","stage_and_commit","staged","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","write_changes"],"q":[[0,"bdk_persist"],[42,"bdk_persist::changeset"],[43,"core::cmp"],[44,"bdk_chain::tx_data_traits"],[45,"core::clone"],[46,"bdk_persist::persist"],[47,"core::option"],[48,"anyhow"],[49,"core::default"],[50,"core::result"],[51,"serde::de"],[52,"core::fmt"],[53,"bdk_chain::keychain::txout_index"],[54,"bdk_chain::indexed_tx_graph"],[55,"bdk_chain::local_chain"],[56,"core::marker"],[57,"serde::ser"],[58,"core::any"]],"i":[0,0,0,2,8,2,8,2,2,2,2,8,2,2,2,8,2,8,2,2,2,2,8,2,2,25,2,8,2,8,8,8,2,8,2,8,2,8,2,8,2,25],"f":"```{{{f{b{d{ce}}}}{d{ce}}}hjl}{{{f{c}}}{{f{e}}}{}{}}0{{{f{bc}}}{{f{be}}}{}{}}0`{{{f{{d{ce}}}}}{{d{ce}}}nn}{{{f{c}}{f{be}}}h{}{}}{{{f{b{A`{c}}}}}{{Ad{{Ab{c}}}}}{AfAh}}{{}{{d{ce}}}{}{}}{c{{Aj{{d{eg}}}}}Al{jAn}{jAn}}{{{f{{d{ce}}}}{f{{d{ce}}}}}B`BbBb}{{{f{{A`{c}}}}{f{bBd}}}{{Aj{hBf}}}Bh}{{{f{{d{ce}}}}{f{bBd}}}BjBhBh}{cc{}}{{{Bn{c{Bl{e}}}}}{{d{ec}}}{}{}}{C`{{d{ce}}}{}{}}2`{ce{}{}}0{{{f{{d{ce}}}}}B`jl}{{{f{bCb}}}{{Ad{{Ab{c}}}}}{}}`{e{{A`{c}}}{AfAh}{{Cb{c}}CdCf}}{{{f{{d{ce}}}}g}Aj{jCh}{jCh}Cj}{{{f{b{A`{c}}}}c}h{AfAh}}{{{f{b{A`{c}}}}c}{{Ad{{Ab{c}}}}}{AfAh}}{{{f{{A`{c}}}}}{{f{c}}}{AfAh}}{{{f{c}}}e{}{}}{c{{Aj{e}}}{}{}}000{{{f{c}}}Cl{}}0::{{{f{bCb}}{f{c}}}{{Ad{h}}}{}}","D":"Bd","p":[[0,"mut"],[5,"CombinedChangeSet",0,42],[1,"reference"],[1,"unit"],[10,"Ord",43],[10,"Anchor",44],[10,"Clone",45],[5,"Persist",0,46],[6,"Option",47],[8,"Result",48],[10,"Default",49],[10,"Append",44],[6,"Result",50],[10,"Deserializer",51],[10,"Deserialize",51],[1,"bool"],[10,"PartialEq",43],[5,"Formatter",52],[5,"Error",52],[10,"Debug",52],[8,"Result",52],[5,"ChangeSet",53],[5,"ChangeSet",54],[8,"ChangeSet",55],[10,"PersistBackend",0,46],[10,"Send",56],[10,"Sync",56],[10,"Serialize",57],[10,"Serializer",57],[5,"TypeId",58]],"r":[[0,42],[1,46],[2,46]],"b":[[18,"impl-From%3CChangeSet%3CA,+ChangeSet%3CK%3E%3E%3E-for-CombinedChangeSet%3CK,+A%3E"],[19,"impl-From%3CBTreeMap%3Cu32,+Option%3CBlockHash%3E%3E%3E-for-CombinedChangeSet%3CK,+A%3E"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAABgABwAEAAQACgABAA0ABAATAAEAGQAAAB0AAAAhAAgA"}],\ ["bdk_sqlite",{"t":"GPPFNNNNNNNNNNNNNENNNNNNNNNNOO","n":["Error","Network","Sqlite","Store","borrow","borrow","borrow_mut","borrow_mut","fmt","fmt","fmt","from","from","into","into","load_from_persistence","new","rusqlite","to_string","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","write_changes","expected","given"],"q":[[0,"bdk_sqlite"],[28,"bdk_sqlite::Error"],[30,"bdk_sqlite::store"],[31,"core::fmt"],[32,"core::option"],[33,"anyhow"],[34,"core::cmp"],[35,"serde::de"],[36,"serde::ser"],[37,"core::marker"],[38,"bdk_chain::tx_data_traits"],[39,"core::clone"],[40,"bdk_persist::changeset"],[41,"core::convert"],[42,"rusqlite"],[43,"rusqlite::error"],[44,"core::result"],[45,"alloc::string"],[46,"core::any"]],"i":[0,6,6,0,3,6,3,6,3,6,6,3,6,3,6,3,3,0,6,3,6,3,6,3,6,3,6,3,24,24],"f":"````{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{{f{ce}}}}{b{dh}}}j{}{}}{{{b{l}}{b{dh}}}j}0{cc{}}0{ce{}{}}0{{{b{d{f{ce}}}}}{{A`{{n{g}}}}}{AbAdAfAh}{AjAdAfAh}{Al{B`{{An{ce}}}}{Bb{{An{ce}}}}}}{Bd{{Bh{{f{ce}}Bf}}}{AbAdAfAh}{AjAdAfAh}}`{{{b{c}}}Bj{}}{c{{Bh{e}}}{}{}}000{{{b{c}}}Bl{}}055{{{b{d{f{ce}}}}{b{g}}}{{A`{Bn}}}{AbAdAfAh}{AjAdAfAh}{Al{B`{{An{ce}}}}{Bb{{An{ce}}}}}}``","D":"Ad","p":[[1,"reference"],[0,"mut"],[5,"Store",0,30],[5,"Formatter",31],[8,"Result",31],[6,"Error",0],[6,"Option",32],[8,"Result",33],[10,"Ord",34],[10,"Deserialize",35],[10,"Serialize",36],[10,"Send",37],[10,"Anchor",38],[10,"Clone",39],[5,"CombinedChangeSet",40],[10,"From",41],[10,"Into",41],[5,"Connection",42],[6,"Error",43],[6,"Result",44],[5,"String",45],[5,"TypeId",46],[1,"unit"],[15,"Network",28]],"r":[[3,30]],"b":[[9,"impl-Display-for-Error"],[10,"impl-Debug-for-Error"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAABQAAwAFAAYAEAAAABIADAA="}],\ -["bdk_testenv",{"t":"FEEEONNEOENNNNNNNNNNNNNNNNNNN","n":["TestEnv","anyhow","bitcoincore_rpc","bitcoind","bitcoind","borrow","borrow_mut","electrsd","electrsd","electrum_client","electrum_client","from","genesis_hash","into","invalidate_blocks","make_checkpoint_tip","mine_blocks","mine_empty_block","new","reorg","reorg_empty_blocks","reset_electrsd","rpc_client","send","try_from","try_into","type_id","vzip","wait_until_electrum_sees_block"],"q":[[0,"bdk_testenv"],[29,"electrum_client::api"],[30,"bitcoin::hash_types::newtypes"],[31,"anyhow"],[32,"bdk_chain::local_chain"],[33,"bitcoin::address"],[34,"core::option"],[35,"alloc::vec"],[36,"bitcoincore_rpc::client"],[37,"bitcoin::amount"],[38,"core::result"],[39,"core::any"]],"i":[0,0,0,0,3,3,3,0,3,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],"f":"`````{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}```{{{b{f}}}{{b{{`{h}}}}}}{cc{}}{{{b{f}}}{{l{j}}}}{ce{}{}}{{{b{f}}n}{{l{A`}}}}{{{b{f}}}Ab}{{{b{f}}n{Af{Ad}}}{{l{{Ah{j}}}}}}{{{b{f}}}{{l{{Aj{nj}}}}}}{{}{{l{f}}}}{{{b{f}}n}{{l{{Ah{j}}}}}}{{{b{f}}n}{{l{{Ah{{Aj{nj}}}}}}}}{f{{l{f}}}}{{{b{f}}}{{b{{`{Al}}}}}}{{{b{f}}{b{{Ad{An}}}}B`}{{l{Bb}}}}{c{{Bd{e}}}{}{}}0{{{b{c}}}Bf{}}<{{{b{f}}}{{l{A`}}}}","D":"An","p":[[1,"reference"],[0,"mut"],[5,"TestEnv",0],[10,"ElectrumApi",29],[5,"BlockHash",30],[8,"Result",31],[1,"usize"],[1,"unit"],[5,"CheckPoint",32],[5,"Address",33],[6,"Option",34],[5,"Vec",35],[1,"tuple"],[10,"RpcApi",36],[6,"NetworkChecked",33],[5,"Amount",37],[5,"Txid",30],[6,"Result",38],[5,"TypeId",39]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAA4ABAAAAAAAAgAIABYAAAAZAAMA"}],\ -["bdk_tmp_plan",{"t":"FKPPPPFFGGFFPPGPPONNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNNNNOOONNNNNNNNNNNNNNNNNNNOOOOOONNNNNNNNOONHNNNNOOOOOOONONNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNOOOOOOOO","n":["Assets","CanDerive","Complete","DerivationError","Incomplete","Legacy","Plan","PlanKey","PlanState","RequiredSignatures","Requirements","SatisfactionMaterial","Segwitv0","SigHashError","SigningError","TapKey","TapScript","asset_key","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","can_derive","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default","default","default","default","derivation_hint","descriptor_key","ecdsa_sigs","expected_weight","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","hash160","hash160_images","hash160_preimages","hash256","hash256_images","hash256_preimages","into","into","into","into","into","into","into","into","keys","max_locktime","min_version","plan_satisfaction","required_locktime","required_sequence","requirements","requires_hash_preimages","ripemd160","ripemd160_images","ripemd160_preimages","schnorr_sigs","sha256","sha256_images","sha256_preimages","sign_with_keymap","signatures","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_complete","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","txo_age","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","witness_version","final_script_sig","final_script_witness","keys","keys","leaf_hash","merkle_root","plan_key","plan_keys"],"q":[[0,"bdk_tmp_plan"],[149,"bdk_tmp_plan::PlanState"],[151,"bdk_tmp_plan::RequiredSignatures"],[157,"miniscript::descriptor::key"],[158,"bitcoin::bip32"],[159,"core::option"],[160,"bdk_tmp_plan::requirements"],[161,"core::clone"],[162,"bdk_tmp_plan::template"],[163,"core::fmt"],[164,"bitcoin::crypto::sighash"],[165,"miniscript::descriptor"],[166,"bitcoin::blockdata::locktime::absolute"],[167,"bitcoin::blockdata::transaction"],[168,"secp256k1"],[169,"core::result"],[170,"core::borrow"],[171,"secp256k1::context"],[172,"alloc::string"],[173,"core::any"],[174,"bitcoin::blockdata::script::witness_version"]],"i":[0,0,41,10,41,9,0,0,0,0,0,0,9,10,0,9,9,11,41,7,9,10,11,12,13,14,41,7,9,10,11,12,13,14,3,7,9,10,11,12,13,14,7,9,10,11,12,13,14,7,9,13,14,11,11,13,12,7,9,10,10,11,12,13,14,41,7,9,10,10,10,11,12,13,14,14,7,13,14,7,13,41,7,9,10,11,12,13,14,14,14,12,0,12,12,12,7,14,7,13,13,14,7,13,9,7,7,9,10,11,12,13,14,10,12,41,7,9,10,11,12,13,14,41,7,9,10,11,12,13,14,14,41,7,9,10,11,12,13,14,41,7,9,10,11,12,13,14,12,44,44,45,46,47,48,48,47],"f":"``````````````````{{{b{c}}}{{b{e}}}{}{}}0000000{{{b{dc}}}{{b{de}}}{}{}}0000000{{{b{f}}{b{h}}}{{l{j}}}}{{{b{{n{c}}}}}{{n{c}}}A`}{{{b{{Ab{c}}}}}{{Ab{c}}}A`}{{{b{Ad}}}Ad}{{{b{{Af{c}}}}}{{Af{c}}}A`}{{{b{{Ah{c}}}}}{{Ah{c}}}A`}{{{b{Aj}}}Aj}{{{b{{Al{c}}}}}{{Al{c}}}A`}{{{b{c}}{b{de}}}An{}{}}000000{{}{{n{c}}}{}}{{}{{Ab{c}}}{}}{{}Aj}{{}{{Al{c}}}{}}```{{{b{{Ah{c}}}}}B`A`}{{{b{{n{c}}}}{b{dBb}}}BdBf}{{{b{{Ab{c}}}}{b{dBb}}}BdBf}{{{b{Ad}}{b{dBb}}}Bd}0{{{b{{Af{c}}}}{b{dBb}}}BdBf}{{{b{{Ah{c}}}}{b{dBb}}}BdBf}{{{b{Aj}}{b{dBb}}}Bd}{{{b{{Al{c}}}}{b{dBb}}}BdBf}{cc{}}00{BhAd}{BjAd}22222``````{ce{}{}}0000000``{{{b{{Ah{c}}}}}{{l{Bl}}}A`}{{{b{{Bn{h}}}}{b{{Al{c}}}}}{{l{{Ah{c}}}}}{fA`}}{{{b{{Ah{c}}}}}{{l{C`}}}A`}{{{b{{Ah{c}}}}}{{l{Cb}}}A`}{{{b{{Ah{c}}}}}{{n{c}}}A`}{{{b{{n{c}}}}}Cd{}}```````{{{b{{Ab{Cf}}}}B`{b{Ch}}{b{{Cj{c}}}}{l{Cl}}{l{Cn}}{b{d{D`{e}}}}{b{dAj}}{b{{Db{g}}}}}{{Dd{CdAd}}}{{Dh{Df}}}{{Dh{Dj}}}{DlDn}}`{{{b{c}}}e{}{}}000000{{{b{c}}}E`{}}{{{b{{Ah{c}}}}{b{Aj}}}{{Eb{c}}}A`}{c{{Dd{e}}}{}{}}000000000000000`{{{b{c}}}Ed{}}0000000<<<<<<<<{{{b{{Ah{c}}}}}{{l{Ef}}}A`}````````","D":"Fl","p":[[1,"reference"],[0,"mut"],[10,"CanDerive",0],[5,"DefiniteDescriptorKey",157],[5,"DerivationPath",158],[6,"Option",159],[5,"Requirements",0,160],[10,"Clone",161],[6,"RequiredSignatures",0,160],[6,"SigningError",0,160],[5,"PlanKey",0,162],[5,"Plan",0],[5,"SatisfactionMaterial",0],[5,"Assets",0],[1,"unit"],[1,"usize"],[5,"Formatter",163],[8,"Result",163],[10,"Debug",163],[6,"Error",158],[6,"Error",164],[1,"u32"],[6,"Descriptor",165],[6,"LockTime",166],[5,"Sequence",167],[1,"bool"],[6,"DescriptorPublicKey",157],[8,"KeyMap",165],[6,"Prevouts",164],[6,"TapSighashType",164],[6,"EcdsaSighashType",164],[5,"SighashCache",164],[5,"Secp256k1",168],[6,"Result",169],[5,"TxOut",167],[10,"Borrow",170],[5,"Transaction",167],[10,"Signing",171],[10,"Verification",171],[5,"String",172],[6,"PlanState",0],[5,"TypeId",173],[6,"WitnessVersion",174],[15,"Complete",149],[15,"Legacy",151],[15,"Segwitv0",151],[15,"TapScript",151],[15,"TapKey",151]],"r":[[7,162],[9,160],[10,160],[14,160]],"b":[[59,"impl-Debug-for-SigningError"],[60,"impl-Display-for-SigningError"],[68,"impl-From%3CError%3E-for-SigningError"],[69,"impl-From%3CError%3E-for-SigningError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAGcAEAABAAEABAABAA4AAQATACIAOgAHAEUAAQBMAAAATwAAAFoAAQBdAAAAYAAAAGIAAABmAAAAaQAAAGsAKQCYAAEA"}],\ -["bdk_wallet",{"t":"PPEPGPFEEGEFNNDNNNNNNNNENNNNNNNNNOOCQNNNNNNNNNNQNNNNNNNNNNOOCDNONCONNNEENNNNNNNNNNNNNONNNNOHNNNNCOOOPPPIGEGIKIKRGFPPPPEKGPPPPIPPPPPPPPPPNNNNNNNNNNNNNNNNNENNNNNNNNNNNNNMNNMNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNCNONMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNMNNNNNNMNNNNNNNNNNNNNNNNONNNNNNNNNMNNNNCNNNNNNNNNNNMNNNCNNNNNNNNNNNNNNNNNNNONNNNNNNNNNHHPPGPPPPPPPPPPPNNNNNNNNNNNNNNNNNNPPPGPFIPPIPPPPPPPPPPPGFGPPPPPGGPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNONNONNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOFFFFFFFFKIFFFFNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPKGGGRRKGPKKFKPPPRGIPPPPPRPFPKGPPPFFGFPIPPPHMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMMNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNNNNNNMNNNNNNMNNNNNNNNNNNNNNNNNNOOONHNMNNHMNNOONNNNNNMONNNNMNHNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNKMMMFGFPIPPPPGKGPPPPPPGGPPPPPPPFFNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNCNONNNNNNNNNCCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOONNNNNNNNNNNNMNONONNNNNNNNONNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNONNNNNNNNNHOOOOOOOOOOPPFPKFIGGPFPFNNNNNNNNNNNNNNNNNNMNNNHNNNOONNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOGPPGPPPPPPPGPPPPPPPPPPPPPPPPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOFIOONNNNNNNNNNNOONNNNNNPPPPPPPKPPPPPPPPPPPPPPPFKGGGFFFPGKPNOONONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNNNOOMNNNMNONONNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOGGPPPGPPPPPFGPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOO","n":["External","Foreign","HdKeyPaths","Internal","KeychainKind","Local","LocalOutput","SignOptions","TxBuilder","Utxo","Wallet","WeightedUtxo","as_byte","as_ref","bitcoin","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","chain","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","confirmation_time","derivation_index","descriptor","descriptor","deserialize","deserialize","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fragment","from","from","from","from","hash","hash","into","into","into","into","is_spent","keychain","keys","miniscript","outpoint","outpoint","partial_cmp","psbt","satisfaction_weight","sequence","serialize","serialize","signer","template","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","txout","txout","type_id","type_id","type_id","type_id","utxo","version","vzip","vzip","vzip","vzip","wallet","outpoint","psbt_input","sequence","Bare","Bare","Bare","DerivedDescriptor","Descriptor","DescriptorError","DescriptorPublicKey","ExtendedDescriptor","ExtractPolicy","HdKeyPaths","IntoWalletDescriptor","Key","Legacy","Miniscript","MultiXPub","Pkh","Pkh","Pkh","Policy","ScriptContext","Segwitv0","Sh","Sh","Sh","Single","TapKeyOrigins","Tr","Tr","Tr","Wpkh","Wpkh","Wpkh","Wsh","Wsh","Wsh","XPub","address","as_enum","as_enum","as_inner","as_node","at_derivation_index","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","branches","build_template","build_template_mall","calc_checksum","check_global_consensus_validity","check_global_consensus_validity","check_global_consensus_validity","check_global_policy_validity","check_global_policy_validity","check_global_validity","check_local_consensus_validity","check_local_consensus_validity","check_local_consensus_validity","check_local_policy_validity","check_local_policy_validity","check_local_policy_validity","check_local_validity","check_pk","check_pk","check_pk","check_terminal_non_malleable","check_terminal_non_malleable","check_terminal_non_malleable","check_witness","check_witness","check_witness","checksum","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","contains_raw_pkh","derive","derived_descriptor","derived_descriptor","desc_type","descriptor_id","deserialize","deserialize","dust_value","encode","eq","eq","eq","eq","error","explicit_script","ext","ext_check","extract_policy","extract_policy","extract_policy","find_derivation_index_for_spk","fmt","fmt","fmt","fmt","fmt","fmt","for_each_key","for_each_key","from","from","from","from","from","from","from","from","from","from","from_ast","from_components_unchecked","from_str","from_str","from_str_ext","from_str_insane","from_tree","from_tree","get_nth_child","get_nth_pk","get_satisfaction","get_satisfaction_mall","has_mixed_timelocks","has_repeated_keys","has_wildcard","hash","hash","hash","hash","into","into","into","into","into_inner","into_single_descriptors","into_wallet_descriptor","into_wallet_descriptor","is_deriveable","is_multipath","is_non_malleable","iter","iter_pk","lift","lift","lift_check","max_satisfaction_size","max_satisfaction_size","max_satisfaction_size","max_satisfaction_size","max_satisfaction_weight","max_satisfaction_witness_elements","max_weight_to_satisfy","name_str","name_str","name_str","new_bare","new_pk","new_pkh","new_sh","new_sh_sortedmulti","new_sh_with_wpkh","new_sh_with_wsh","new_sh_wpkh","new_sh_wsh","new_sh_wsh_sortedmulti","new_tr","new_wpkh","new_wsh","new_wsh_sortedmulti","node","other_top_level_checks","parse","parse_descriptor","parse_insane","parse_with_ext","partial_cmp","partial_cmp","partial_cmp","partial_cmp","pk_len","pk_len","pk_len","plan","plan_mall","policy","requires_sig","sanity_check","sanity_check","satisfy","satisfy","satisfy_malleable","script_code","script_pubkey","script_size","serialize","serialize","sig_type","sig_type","sig_type","substitute_raw_pkh","template","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string_with_secret","top_level_checks","top_level_type_check","translate_pk","translate_pk","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","ty","type_id","type_id","type_id","type_id","unsigned_script_sig","vzip","vzip","vzip","vzip","within_resource_limits","calc_checksum","calc_checksum_bytes","Base58","Bip32","Error","ExternalAndInternalAreTheSame","HardenedDerivationXpub","Hex","InvalidDescriptorCharacter","InvalidDescriptorChecksum","InvalidHdKeyPath","Key","Miniscript","MultiPath","Pk","Policy","borrow","borrow_mut","fmt","fmt","from","from","from","from","from","from","from","from","into","to_string","try_from","try_into","type_id","vzip","AbsoluteTimelock","AddOnLeaf","AddOnPartialComplete","BuildSatisfaction","Complete","Condition","ConditionMap","EcdsaSignature","Fingerprint","FoldedConditionMap","Hash160Preimage","Hash256Preimage","IncompatibleConditions","IndexOutOfRange","MixedTimelockUnits","Multisig","None","None","NotEnoughItemsSelected","Partial","PartialComplete","PkOrF","Policy","PolicyError","Psbt","PsbtTimelocks","Pubkey","RelativeTimelock","Ripemd160Preimage","Satisfaction","SatisfiableItem","SchnorrSignature","Sha256Preimage","Thresh","XOnlyPubkey","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","contribution","csv","default","eq","eq","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","get_condition","hash","hash","id","id","into","into","into","into","into","into","into","is_leaf","is_leaf","is_null","item","partial_cmp","requires_path","satisfaction","serialize","serialize","serialize","serialize","serialize","timelock","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","current_height","input_max_height","psbt","condition","conditions","conditions","items","items","m","m","n","n","sorted","sorted","hash","hash","hash","hash","items","keys","threshold","threshold","value","value","Bip44","Bip44Public","Bip49","Bip49Public","Bip84","Bip84Public","Bip86","Bip86Public","DescriptorTemplate","DescriptorTemplateOut","P2Pkh","P2TR","P2Wpkh","P2Wpkh_P2Sh","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","build","build","build","build","build","build","build","build","build","build","build","build","from","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","into","into","into","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","Bip32","DerivableKey","DescriptorKey","DescriptorPublicKey","DescriptorSecretKey","Entropy","Error","ExtScriptContext","ExtendedKey","FullKey","GeneratableDefaultOptions","GeneratableKey","GeneratedKey","IntoDescriptorKey","InvalidChecksum","InvalidNetwork","InvalidScriptContext","Key","KeyError","KeyMap","Legacy","Message","Miniscript","MultiXPrv","MultiXPub","Options","Private","PrivateKeyGenerateOptions","Public","ScriptContext","ScriptContextEnum","Segwitv0","Single","Single","SinglePriv","SinglePub","SinglePubKey","SortedMultiVec","Tap","ValidNetworks","XOnly","XPrv","XPub","any_network","as_enum","at_derivation_index","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build_template","check_global_consensus_validity","check_global_policy_validity","check_global_validity","check_local_consensus_validity","check_local_policy_validity","check_local_validity","check_pk","check_terminal_non_malleable","check_witness","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","compressed","default","deref","derive","deserialize","encode","eq","eq","eq","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","for_each_key","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_public","from_secret","from_str","from_str","from_tree","full_derivation_path","full_derivation_paths","generate","generate_default","generate_with_entropy","generate_with_entropy_default","has_secret","has_wildcard","hash","hash","hash","hash","into","into","into","into","into","into","into","into","into","into","into","into","into_assets","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_extended_key","into_extended_key","into_extended_key","into_key","into_single_keys","into_single_keys","into_xprv","into_xpub","is_deriveable","is_legacy","is_legacy","is_multipath","is_multipath","is_segwit_v0","is_segwit_v0","is_taproot","is_taproot","is_uncompressed","is_x_only_key","k","key","key","lift","mainnet_network","master_fingerprint","max_satisfaction_size","max_satisfaction_size","max_satisfaction_witness_elements","merge_networks","name_str","new","num_der_paths","origin","origin","other_top_level_checks","override_valid_networks","partial_cmp","partial_cmp","partial_cmp","partial_cmp","pk_len","pks","sanity_check","satisfy","script_size","serialize","sig_type","sorted_node","test_networks","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_public","to_string","to_string","to_string","to_string","top_level_checks","top_level_type_check","translate_pk","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","PsbtUtils","fee_amount","fee_rate","get_utxo_for","AddressInfo","ApplyBlockError","Balance","CannotConnect","ChangeSet","ConfirmationHeightCannotBeGreaterThanTip","Descriptor","Descriptor","Descriptor","InsertTxError","IsDust","LoadError","LoadedDescriptorDoesNotMatch","LoadedGenesisDoesNotMatch","LoadedNetworkDoesNotMatch","MissingDescriptor","MissingGenesis","MissingNetwork","NewError","NewOrLoadError","NonEmptyDatabase","NotInitialized","NotInitialized","Persist","Persist","Persist","UnexpectedConnectedToHash","Update","Wallet","add","add_signer","address","all_unbounded_spk_iters","apply_block","apply_block_connected_to","apply_unconfirmed_txs","apply_update","as_ref","balance","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","build_fee_bump","build_tx","calculate_fee","calculate_fee_rate","cancel_tx","chain","chain","checkpoints","clone","clone","clone_into","clone_into","coin_selection","commit","confirmed","default","default","deref","derivation_index","derivation_of_spk","descriptor_checksum","deserialize","eq","eq","error","export","finalize_psbt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","get_descriptor_for_keychain","get_psbt_input","get_signers","get_tx","get_utxo","graph","immature","index","indexed_tx_graph","insert_checkpoint","insert_tx","insert_txout","into","into","into","into","into","into","into","into","into","is_dust","is_mine","keychain","keychains","last_active_indices","latest_checkpoint","list_output","list_unspent","list_unused_addresses","load","local_chain","mark_used","network","network","new","new_no_persist","new_no_persist_with_genesis_hash","new_or_load","new_or_load_with_genesis_hash","new_with_genesis_hash","next_derivation_index","next_unused_address","peek_address","policies","public_descriptor","reveal_addresses_to","reveal_next_address","secp_ctx","sent_and_received","serialize","sign","signer","spk_index","staged","start_full_scan","start_sync_with_revealed_spks","to_owned","to_owned","to_string","to_string","to_string","to_string","to_string","to_string","to_string","total","transactions","trusted_pending","trusted_spendable","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tx_builder","tx_graph","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unbounded_spk_iter","unmark_used","untrusted_pending","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","wallet_name_from_descriptor","connected_to_hash","expected_hash","tip_height","tx_height","expected","expected","got","got","got","keychain","BnBNoExactMatch","BnBTotalTriesExceeded","BranchAndBoundCoinSelection","Change","CoinSelectionAlgorithm","CoinSelectionResult","DefaultCoinSelectionAlgorithm","Error","Excess","InsufficientFunds","LargestFirstCoinSelection","NoChange","OldestFirstCoinSelection","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","coin_select","coin_select","coin_select","coin_select","decide_change","default","default","default","excess","fee_amount","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","into","into","into","into","into","into","local_selected_amount","new","selected","selected_amount","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","available","needed","amount","change_fee","dust_threshold","fee","remaining_amount","BuildFeeBumpError","CoinSelection","Conversion","CreateTxError","Descriptor","FeeRateTooLow","FeeRateUnavailable","FeeTooLow","IrreplaceableTransaction","LockTime","MiniscriptPsbt","MiniscriptPsbtError","MissingKeyOrigin","MissingNonWitnessUtxo","NoRecipients","NoUtxosSelected","OutputBelowDustLimit","OutputUpdate","Persist","Policy","Psbt","RbfSequence","RbfSequenceCsv","SpendingPolicyRequired","TransactionConfirmed","TransactionNotFound","UnknownUtxo","UnknownUtxo","UtxoUpdate","Version0","Version1Csv","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","into","into","into","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","csv","rbf","requested","required","required","required","FullyNodedExport","WalletExport","blockheight","blockheight","borrow","borrow_mut","change_descriptor","descriptor","deserialize","export_wallet","fmt","fmt","from","from_str","into","label","label","serialize","to_string","try_from","try_into","type_id","vzip","All","Dummy","Exclude","External","Fingerprint","Include","InputIndexOutOfRange","InputSigner","InvalidKey","InvalidNonWitnessUtxo","InvalidSighash","Legacy","MiniscriptPsbt","MissingHdKeypath","MissingKey","MissingNonWitnessUtxo","MissingWitnessScript","MissingWitnessUtxo","NonStandardSighash","None","PkHash","Segwitv0","SighashError","SignOptions","SignerCommon","SignerContext","SignerError","SignerId","SignerOrdering","SignerWrapper","SignersContainer","Tap","TapLeavesOptions","TransactionSigner","UserCanceled","add_external","allow_all_sighashes","allow_grinding","as_key_map","assume_height","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","default","default","default","default","deref","descriptor_secret_key","descriptor_secret_key","descriptor_secret_key","descriptor_secret_key","eq","eq","eq","eq","find","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","hash","id","id","id","id","ids","into","into","into","into","into","into","into","into","new","new","partial_cmp","partial_cmp","remove","remove_partial_sigs","remove_taproot_extras","sign_input","sign_input","sign_input","sign_input","sign_transaction","sign_transaction","sign_with_tap_internal_key","signers","tap_leaves_options","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","trust_witness_utxo","try_finalize","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","is_internal_key","AddForeignUtxoError","AddUtxoError","Bip69Lexicographic","ChangeAllowed","ChangeForbidden","ChangeSpendPolicy","InvalidOutpoint","InvalidTxid","MissingUtxo","OnlyChange","Shuffle","TxBuilder","TxOrdering","UnknownUtxo","Untouched","add_data","add_foreign_utxo","add_foreign_utxo_with_sequence","add_global_xpubs","add_recipient","add_unspendable","add_utxo","add_utxos","allow_dust","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","change_policy","clone","clone","clone","clone_into","clone_into","clone_into","cmp","cmp","coin_selection","current_height","default","default","do_not_spend_change","drain_to","drain_wallet","enable_rbf","enable_rbf_with_sequence","eq","eq","fee_absolute","fee_rate","finish","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","hash","hash","include_output_redeem_witness_script","into","into","into","into","into","manually_selected_only","nlocktime","only_spend_change","only_witness_utxo","ordering","partial_cmp","partial_cmp","policy_path","set_recipients","sighash","sort_tx","to_owned","to_owned","to_owned","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","unspendable","version","vzip","vzip","vzip","vzip","vzip","foreign_utxo","input_txid"],"q":[[0,"bdk_wallet"],[97,"bdk_wallet::Utxo"],[100,"bdk_wallet::descriptor"],[350,"bdk_wallet::descriptor::checksum"],[352,"bdk_wallet::descriptor::error"],[384,"bdk_wallet::descriptor::policy"],[531,"bdk_wallet::descriptor::policy::BuildSatisfaction"],[534,"bdk_wallet::descriptor::policy::Satisfaction"],[545,"bdk_wallet::descriptor::policy::SatisfiableItem"],[555,"bdk_wallet::descriptor::template"],[691,"bdk_wallet::keys"],[989,"bdk_wallet::psbt"],[993,"bdk_wallet::wallet"],[1216,"bdk_wallet::wallet::ApplyBlockError"],[1218,"bdk_wallet::wallet::InsertTxError"],[1220,"bdk_wallet::wallet::NewOrLoadError"],[1226,"bdk_wallet::wallet::coin_selection"],[1318,"bdk_wallet::wallet::coin_selection::Error"],[1320,"bdk_wallet::wallet::coin_selection::Excess"],[1325,"bdk_wallet::wallet::error"],[1397,"bdk_wallet::wallet::error::CreateTxError"],[1403,"bdk_wallet::wallet::export"],[1426,"bdk_wallet::wallet::signer"],[1605,"bdk_wallet::wallet::signer::SignerContext"],[1606,"bdk_wallet::wallet::tx_builder"],[1721,"bdk_wallet::wallet::tx_builder::AddForeignUtxoError"],[1723,"bdk_wallet::types"],[1724,"core::cmp"],[1725,"core::result"],[1726,"serde::de"],[1727,"core::fmt"],[1728,"core::hash"],[1729,"bitcoin::blockdata::transaction"],[1730,"core::option"],[1731,"serde::ser"],[1732,"core::any"],[1733,"miniscript::descriptor"],[1734,"bitcoin::network"],[1735,"bitcoin::address"],[1736,"miniscript"],[1737,"miniscript::miniscript"],[1738,"miniscript::miniscript::decode"],[1739,"miniscript::miniscript::context"],[1740,"miniscript::iter::tree"],[1741,"miniscript::descriptor::key"],[1742,"alloc::vec"],[1743,"miniscript::miniscript::satisfy"],[1744,"miniscript::plan"],[1745,"bitcoin_hashes::sha256"],[1746,"miniscript::miniscript::hash256"],[1747,"bitcoin_hashes::ripemd160"],[1748,"bitcoin_hashes::hash160"],[1749,"core::clone"],[1750,"secp256k1"],[1751,"bitcoin::crypto::key"],[1752,"secp256k1::context"],[1753,"bdk_chain::descriptor_ext"],[1754,"core::str::traits"],[1755,"bitcoin::blockdata::script::owned"],[1756,"miniscript::miniscript::analyzable"],[1757,"secp256k1::context::alloc_only"],[1758,"bitcoin::blockdata::script::borrowed"],[1759,"core::ops::range"],[1760,"core::ops::function"],[1761,"miniscript::descriptor::segwitv0"],[1762,"miniscript::descriptor::bare"],[1763,"miniscript::descriptor::tr"],[1764,"miniscript::descriptor::sh"],[1765,"miniscript::miniscript::types"],[1766,"miniscript::miniscript::types::extra_props"],[1767,"miniscript::expression"],[1768,"miniscript::miniscript::iter"],[1769,"miniscript::policy::semantic"],[1770,"miniscript::policy"],[1771,"alloc::collections::btree::map"],[1772,"alloc::string"],[1773,"hex_conservative::parse"],[1774,"bitcoin::bip32"],[1775,"bitcoin::base58"],[1776,"miniscript::descriptor::sortedmulti"],[1777,"core::convert"],[1778,"core::default"],[1779,"bitcoin::amount"],[1780,"bitcoin::blockdata::fee_rate"],[1781,"bdk_chain::keychain"],[1782,"alloc::sync"],[1783,"core::iter::traits::iterator"],[1784,"bitcoin::blockdata::block"],[1785,"bdk_chain::local_chain"],[1786,"bdk_chain::chain_data"],[1787,"core::iter::traits::collect"],[1788,"bdk_chain::tx_graph"],[1789,"bitcoin::hash_types::newtypes"],[1790,"anyhow"],[1791,"bitcoin::psbt"],[1792,"bdk_chain::spk_client"],[1793,"bitcoin::psbt::map::input"],[1794,"bdk_wallet::wallet::utils"],[1795,"core::iter::traits::double_ended"],[1796,"bdk_persist::persist"],[1797,"core::marker"],[1798,"bdk_chain::keychain::txout_index"],[1799,"bitcoin::psbt::error"],[1800,"bitcoin::crypto::sighash"],[1801,"bitcoin::blockdata::script::push_bytes::primitive"],[1802,"bitcoin::blockdata::locktime::absolute"]],"i":[1,8,0,1,0,8,0,0,0,0,0,0,1,1,0,1,6,7,8,1,6,7,8,0,1,6,7,8,1,6,7,8,1,6,6,0,0,1,6,1,6,7,8,1,6,7,8,0,1,6,7,8,1,6,1,6,7,8,6,6,0,0,8,6,1,0,7,8,1,6,0,0,1,6,7,8,1,6,7,8,1,6,7,8,8,6,1,6,7,8,7,0,1,6,7,8,0,249,249,249,94,250,24,0,0,0,0,0,0,0,0,33,0,0,35,94,250,24,0,0,0,94,250,24,35,0,94,250,24,94,250,24,94,250,24,35,24,54,55,31,31,24,24,54,55,31,24,54,55,31,31,31,31,0,33,54,55,33,55,33,33,54,55,33,54,55,33,33,54,55,33,54,55,33,54,55,0,24,54,55,31,24,54,55,31,24,54,55,31,31,24,24,24,24,24,24,31,24,31,24,54,55,31,0,24,31,31,69,24,31,24,24,24,54,55,31,31,24,31,24,24,24,24,24,24,24,54,55,31,31,31,24,31,31,31,24,31,31,31,24,24,31,31,24,24,54,55,31,24,54,55,31,31,24,93,94,24,24,31,31,31,24,31,31,33,54,55,31,24,31,24,33,54,55,24,24,24,24,24,24,24,24,24,24,24,24,24,24,31,33,31,24,31,31,24,54,55,31,33,54,55,24,24,0,31,24,31,24,31,31,24,24,31,24,31,33,54,55,31,0,24,54,55,31,24,31,24,33,33,24,31,24,54,55,31,24,54,55,31,31,24,54,55,31,24,24,54,55,31,31,0,0,74,74,0,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,120,114,114,0,121,0,0,120,119,0,120,120,114,114,114,120,121,71,114,121,121,0,0,0,71,71,119,120,120,0,0,120,120,120,119,119,120,121,73,122,114,71,119,120,121,73,122,114,71,119,120,121,73,122,71,119,120,121,73,122,71,73,122,122,119,120,121,73,122,114,119,120,121,73,122,114,114,71,119,120,121,121,73,73,122,114,71,73,119,122,120,73,119,120,121,73,122,114,71,120,121,122,73,122,73,73,119,120,121,73,122,122,119,120,121,73,122,71,114,119,120,121,73,122,114,71,119,120,121,73,122,114,71,119,120,121,73,122,114,71,119,120,121,73,122,114,71,251,251,251,252,253,254,253,254,253,254,253,254,253,254,255,256,257,258,259,260,260,259,261,262,0,0,0,0,0,0,0,0,0,0,0,0,0,0,125,127,128,129,131,133,134,135,136,137,138,139,125,127,128,129,131,133,134,135,136,137,138,139,123,125,127,128,129,131,133,134,135,136,137,138,139,125,127,128,129,131,133,134,135,136,137,138,139,125,127,128,129,131,133,134,135,136,137,138,139,124,125,127,128,129,131,133,134,135,136,137,138,139,125,127,128,129,131,133,134,135,136,137,138,139,125,127,128,129,131,133,134,135,136,137,138,139,125,127,128,129,131,133,134,135,136,137,138,139,125,127,128,129,131,133,134,135,136,137,138,139,118,0,0,0,0,156,156,0,0,146,0,0,0,0,118,118,118,33,0,0,30,118,118,102,35,156,150,0,150,0,0,30,35,102,0,0,0,0,30,0,146,102,35,0,263,35,150,142,147,30,143,118,141,35,102,144,145,146,150,142,147,30,143,118,141,35,102,144,145,146,141,33,33,33,33,33,33,33,33,33,142,30,143,141,35,102,144,145,146,142,30,143,141,35,102,144,145,146,141,35,144,146,143,143,142,35,35,141,30,141,35,102,144,145,146,147,30,143,118,118,141,141,35,35,102,102,144,145,146,141,150,150,150,142,147,30,143,118,118,118,141,35,35,102,144,145,146,147,147,35,102,141,35,35,156,159,156,159,150,35,141,35,144,146,150,142,147,30,143,118,141,35,102,144,145,146,35,126,132,142,142,147,35,102,132,150,142,142,35,102,150,150,35,263,30,35,102,263,30,263,30,35,35,141,144,145,141,0,35,33,141,141,0,33,141,35,144,145,33,147,141,35,144,146,33,141,141,141,141,35,33,141,0,142,30,143,141,35,102,144,145,146,102,118,141,35,102,33,33,141,150,142,147,30,143,118,141,35,102,144,145,146,150,142,147,30,143,118,141,35,102,144,145,146,150,142,147,30,143,118,141,35,102,144,145,146,150,142,147,30,143,118,141,35,102,144,145,146,0,164,164,164,0,0,0,199,0,198,195,196,197,0,0,0,197,197,197,196,196,196,0,0,195,196,197,195,196,197,199,0,0,167,168,191,168,168,168,168,168,168,168,167,168,180,191,195,196,197,198,199,167,168,180,191,195,196,197,198,199,168,168,168,168,168,211,180,168,167,180,167,180,0,168,167,167,180,191,168,168,168,167,167,191,0,0,168,167,167,168,180,191,191,195,195,196,196,197,197,198,198,199,199,167,168,180,180,180,191,195,196,197,198,199,168,168,168,168,168,180,167,191,211,168,168,168,167,168,180,191,195,196,197,198,199,208,168,191,168,180,168,168,168,168,168,168,168,168,211,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,167,168,0,168,168,168,168,167,180,167,191,195,196,197,198,199,167,168,167,167,167,168,180,191,195,196,197,198,199,167,168,180,191,195,196,197,198,199,0,168,167,168,180,191,195,196,197,198,199,168,168,167,167,168,180,191,195,196,197,198,199,0,264,264,265,265,266,267,266,267,268,268,225,225,0,226,0,0,0,0,0,225,0,226,0,225,226,224,220,221,222,225,226,224,220,221,222,220,221,222,220,221,222,223,220,221,222,0,220,221,222,224,224,225,225,226,224,220,221,222,225,226,224,220,221,222,225,226,224,220,221,222,224,222,224,224,220,221,222,225,225,226,224,220,221,222,225,226,224,220,221,222,225,226,224,220,221,222,225,226,224,220,221,222,269,269,270,271,271,270,271,0,204,227,0,204,204,187,204,187,204,204,0,204,204,204,204,204,227,204,204,204,204,204,204,187,187,204,187,227,204,204,227,204,187,227,204,187,227,227,227,227,204,204,187,187,227,204,204,204,204,204,204,187,227,204,187,227,227,204,187,227,204,187,227,204,187,227,204,187,227,204,187,272,272,273,273,274,275,0,0,276,229,229,229,229,229,229,229,229,229,229,229,229,276,229,229,229,229,229,229,229,234,230,234,194,230,234,194,0,194,194,194,231,194,194,194,194,194,194,194,234,230,231,194,0,0,0,0,0,0,0,0,231,0,0,194,70,193,193,70,193,230,194,231,232,169,70,193,234,230,194,231,232,169,70,193,234,70,230,231,232,169,70,193,234,230,231,232,169,70,193,234,230,169,169,70,193,234,232,235,232,232,232,230,231,169,234,70,230,194,194,231,232,169,70,193,234,230,230,230,194,194,231,232,169,70,193,234,230,235,232,232,232,70,230,194,231,232,169,70,193,234,232,70,230,169,70,193,193,240,232,232,232,170,232,193,70,193,230,231,232,169,70,193,234,194,193,193,230,194,231,232,169,70,193,234,230,194,231,232,169,70,193,234,230,194,231,232,169,70,193,234,230,194,231,232,169,70,193,234,277,0,0,246,245,245,0,243,243,243,245,246,0,0,244,246,186,186,186,186,186,186,186,186,186,186,244,243,246,245,186,244,243,246,245,186,186,246,245,186,246,245,246,245,186,186,246,245,186,186,186,186,186,246,245,186,186,186,186,244,244,243,243,246,245,186,244,243,246,245,246,245,186,186,244,243,246,245,186,186,186,186,186,246,245,186,186,186,246,186,246,245,244,243,186,244,243,246,245,186,244,243,246,245,186,244,243,246,245,186,186,186,244,243,246,245,278,278],"f":"````````````{{{d{b}}}f}{{{d{b}}}{{d{{h{f}}}}}}`{{{d{c}}}{{d{e}}}{}{}}000{{{d{jc}}}{{d{je}}}{}{}}000`{{{d{b}}}b}{{{d{l}}}l}{{{d{n}}}n}{{{d{A`}}}A`}{{{d{c}}{d{je}}}Ab{}{}}000{{{d{b}}{d{b}}}Ad}````{c{{Af{b}}}Ah}{c{{Af{l}}}Ah}{{{d{b}}{d{b}}}Aj}{{{d{l}}{d{l}}}Aj}{{{d{n}}{d{n}}}Aj}{{{d{A`}}{d{A`}}}Aj}{{{d{b}}{d{jAl}}}An}{{{d{l}}{d{jAl}}}An}{{{d{n}}{d{jAl}}}An}{{{d{A`}}{d{jAl}}}An}`{cc{}}000{{{d{b}}{d{jc}}}AbB`}{{{d{l}}{d{jc}}}AbB`}{ce{}{}}000````{{{d{A`}}}Bb}`{{{d{b}}{d{b}}}{{Bd{Ad}}}}``{{{d{A`}}}{{Bd{Bf}}}}{{{d{b}}c}AfBh}{{{d{l}}c}AfBh}``{{{d{c}}}e{}{}}000{c{{Af{e}}}{}{}}0000000{{{d{A`}}}{{d{Bj}}}}`{{{d{c}}}Bl{}}000`{{}{{d{Bn}}}}::::````````````````````````````````````````{{{d{{C`{c}}}}Cb}{{Af{CdCf}}}{ChCj}}{{}Cl}0{{{d{{Cn{ce}}}}}{{d{{D`{ce}}}}}ChDb}{{{d{{d{{Cn{ce}}}}}}}{{Dd{{d{{Cn{ce}}}}}}}ChDb}{{{d{{C`{Df}}}}Dh}{{Af{{C`{Dj}}Dl}}}}{{{d{c}}}{{d{e}}}{}{}}000{{{d{jc}}}{{d{je}}}{}{}}000{{{d{{Cn{ce}}}}}{{Dn{{d{{Cn{ce}}}}}}}ChDb}{{{d{{Cn{ce}}}}{d{g}}}{{Eb{{E`{c}}}}}{CjCh}Db{{Ed{c}}}}0`{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbEh}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}{{{d{{Cn{cFl}}}}}{{Af{AbEh}}}Ch}{{{d{{Cn{cFn}}}}}{{Af{AbEh}}}Ch}2022102102{{{d{c}}}{{Af{AbEh}}}Ch}00{{{d{{D`{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbEh}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}{{{d{{D`{cFl}}}}}{{Af{AbEh}}}Ch}{{{d{{D`{cFn}}}}}{{Af{AbEh}}}Ch}{{{d{{h{{Dn{f}}}}}}}{{Af{AbEh}}}}00`{{{d{{C`{c}}}}}{{C`{c}}}{G`Ch}}{{{d{Fl}}}Fl}{{{d{Fn}}}Fn}{{{d{{Cn{ce}}}}}{{Cn{ce}}}{G`Ch}{G`Db}}{{{d{c}}{d{je}}}Ab{}{}}000{{{d{{C`{c}}}}{d{{C`{c}}}}}Ad{GbCh}}{{{d{Fl}}{d{Fl}}}Ad}{{{d{Fn}}{d{Fn}}}Ad}{{{d{{Cn{ce}}}}{d{{Cn{ce}}}}}AdChDb}{{{d{{Cn{ce}}}}}AjChDb}{{{d{{C`{Df}}}}Dh}{{Af{{C`{Dj}}Dl}}}}{{{d{{C`{Dj}}}}{d{{Gd{c}}}}}{{Af{{C`{Gf}}Dl}}}Gh}{{{d{{C`{Df}}}}{d{{Gd{c}}}}Dh}{{Af{{C`{Gf}}Dl}}}Gh}{{{d{{C`{c}}}}}GjCh}{{{d{{C`{Df}}}}}Gl}{c{{Af{{C`{e}}}}}Ah{ChGn}}{c{{Af{{Cn{eg}}}}}Ah{ChGn}Db}{{{d{{C`{Df}}}}}H`}{{{d{{Cn{ce}}}}}Hb{CjCh}Db}{{{d{{C`{c}}}}{d{{C`{c}}}}}Aj{HdCh}}{{{d{Fl}}{d{Fl}}}Aj}{{{d{Fn}}{d{Fn}}}Aj}{{{d{{Cn{ce}}}}{d{{Cn{ce}}}}}AjChDb}`{{{d{{C`{c}}}}}{{Af{HbCf}}}{ChCj}}`{{{d{{Cn{ce}}}}{d{Hf}}}{{Af{AbHh}}}ChDb}{{{d{Hj}}{d{Hl}}Hn{d{{Gd{I`}}}}}{{Af{{Bd{Ib}}Id}}}}{{{d{{C`{Df}}}}{d{Hl}}Hn{d{{Gd{I`}}}}}{{Af{{Bd{Ib}}Id}}}}{{{d{{Cn{Dfc}}}}{d{Hl}}Hn{d{{Gd{I`}}}}}{{Af{{Bd{Ib}}Id}}}Db}{{{d{{C`{Df}}}}{d{{Gd{c}}}}{d{If}}{Ih{Dh}}}{{Af{{Bd{{Ij{Dh{C`{Gf}}}}}}Dl}}}Gh}{{{d{{C`{c}}}}{d{jAl}}}{{Af{AbIl}}}Ch}0{{{d{Fl}}{d{jAl}}}{{Af{AbIl}}}}{{{d{Fn}}{d{jAl}}}{{Af{AbIl}}}}{{{d{{Cn{ce}}}}{d{jAl}}}{{Af{AbIl}}}ChDb}0{{{d{{C`{c}}}}e}AjCh{{J`{{d{c}}}{{In{Aj}}}}}}{{{d{{Cn{ce}}}}g}AjChDb{{J`{{d{c}}}{{In{Aj}}}}}}{{{Jb{c}}}{{C`{c}}}Ch}{cc{}}{{{Jd{c}}}{{C`{c}}}Ch}{{{Jf{c}}}{{C`{c}}}Ch}{{{Jh{c}}}{{C`{c}}}Ch}{{{Jj{c}}}{{C`{c}}}Ch}{{{Jl{c}}}{{C`{c}}}Ch}555{{{D`{ce}}}{{Af{{Cn{ce}}Cf}}}ChDb}{{{D`{ce}}JnK`}{{Cn{ce}}}ChDb}{{{d{Bn}}}{{Af{{C`{c}}Cf}}}{ChGn}}{{{d{Bn}}}{{Af{{Cn{ce}}Cf}}}{ChGn}Db}{{{d{Bn}}{d{Hf}}}{{Af{{Cn{ce}}Cf}}}{ChGn}Db}1{{{d{Kb}}}{{Af{{C`{c}}Cf}}}{ChGn}}{{{d{Kb}}}{{Af{{Cn{ce}}Cf}}}{ChGn}Db}{{{d{{Cn{ce}}}}Kd}{{Bd{{d{{Cn{ce}}}}}}}ChDb}{{{d{{Cn{ce}}}}Kd}{{Bd{c}}}ChDb}{{{d{{C`{c}}}}e}{{Af{{Ij{{Dn{{Dn{f}}}}Hb}}Cf}}}{ChCj}{{Kf{c}}}}0{{{d{{Cn{ce}}}}}AjChDb}0{{{d{{C`{Df}}}}}Aj}{{{d{{C`{c}}}}{d{je}}}Ab{KhCh}B`}{{{d{Fl}}{d{jc}}}AbB`}{{{d{Fn}}{d{jc}}}AbB`}{{{d{{Cn{ce}}}}{d{jg}}}AbChDbB`}{ce{}{}}000{{{Cn{ce}}}{{D`{ce}}}ChDb}{{{C`{Df}}}{{Af{{Dn{{C`{Df}}}}Cf}}}}{{Kj{d{{Gd{I`}}}}Cb}{{Af{{Ij{KlKn}}Id}}}}{{Kl{d{{Gd{I`}}}}Cb}{{Af{{Ij{KlKn}}Id}}}}99:{{{d{{Cn{ce}}}}}{{L`{ce}}}ChDb}{{{d{{Cn{ce}}}}}{{Lb{ce}}}ChDb}{{{d{{C`{c}}}}}{{Af{{Ld{c}}Cf}}}Ch}{{{d{{Cn{ce}}}}}{{Af{{Ld{c}}Cf}}}ChDb}{{{d{{Cn{ce}}}}}{{Af{AbLf}}}ChDb}{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Bd{Kd}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}{{{d{{Cn{cFl}}}}}{{Bd{Kd}}}Ch}{{{d{{Cn{cFn}}}}}{{Bd{Kd}}}Ch}{{{d{{Cn{ce}}}}}{{Af{KdCf}}}ChDb}{{{d{{C`{c}}}}}{{Af{KdCf}}}Ch}10{{}{{d{Bn}}}}00{{{Cn{cLh}}}{{Af{{C`{c}}Cf}}}Ch}{c{{C`{c}}}Ch}{c{{Af{{C`{c}}Cf}}}Ch}{{{Cn{cFl}}}{{Af{{C`{c}}Cf}}}Ch}{{Kd{Dn{c}}}{{Af{{C`{c}}Cf}}}Ch}{{{Jb{c}}}{{C`{c}}}Ch}{{{Jd{c}}}{{C`{c}}}Ch}4{{{Cn{cFn}}}{{Af{{C`{c}}Cf}}}Ch}3{{c{Bd{{Lj{c}}}}}{{Af{{C`{c}}Cf}}}Ch}614`{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbCf}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}{{{d{If}}}{{Af{{Cn{c}}Cf}}}Db}{{{d{{Gd{c}}}}{d{Bn}}}{{Af{{Ij{{C`{Df}}{Ln{DfLl}}}}Cf}}}M`}1{{{d{If}}{d{Hf}}}{{Af{{Cn{c}}Cf}}}Db}{{{d{{C`{c}}}}{d{{C`{c}}}}}{{Bd{Ad}}}{MbCh}}{{{d{Fl}}{d{Fl}}}{{Bd{Ad}}}}{{{d{Fn}}{d{Fn}}}{{Bd{Ad}}}}{{{d{{Cn{ce}}}}{d{{Cn{ce}}}}}{{Bd{Ad}}}ChDb}{{{d{c}}}KdCh}00{{{C`{Dj}}{d{c}}}{{Af{Md{C`{Dj}}}}}{{Ed{Dj}}}}0`{{{d{{Cn{ce}}}}}AjChDb}{{{d{{C`{c}}}}}{{Af{AbCf}}}Ch}{{{d{{Cn{ce}}}}}{{Af{AbHh}}}ChDb}{{{d{{C`{c}}}}{d{jMf}}e}{{Af{AbCf}}}{ChCj}{{Kf{c}}}}{{{d{{Cn{ce}}}}g}{{Af{{Dn{{Dn{f}}}}Cf}}}{CjCh}Db{{Kf{c}}}}0{{{d{{C`{c}}}}}{{Af{HbCf}}}{ChCj}}{{{d{{C`{c}}}}}Hb{ChCj}}{{{d{{Cn{ce}}}}}KdChDb}{{{d{{C`{c}}}}e}AfChBh}{{{d{{Cn{ce}}}}g}AfChDbBh}{{}Mh}00{{{d{{Cn{ce}}}}{d{{Ln{Fhc}}}}}{{Cn{ce}}}ChDb}`{{{d{c}}}e{}{}}000{{{d{c}}}Mj{}}0{{{d{{C`{Df}}}}{d{{Ln{DfLl}}}}}Mj}{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbCf}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}0{{{d{{C`{c}}}}{d{ji}}}{{Af{{Ml{g}}}}}ChCh{}{{Mn{ceg}}}}{{{d{{Cn{ce}}}}{d{jk}}}{{Af{{Ml{i}}}}}ChDbCh{}{{Mn{cgi}}}}{c{{Af{e}}}{}{}}0000000`{{{d{c}}}Bl{}}000={ce{}{}}000{{{d{{Cn{ce}}}}}AjChDb}{{{d{Bn}}}{{Af{MjId}}}}{{{d{Bn}}}{{Af{{N`{f}}Id}}}}``````````````{{{d{c}}}{{d{e}}}{}{}}{{{d{jc}}}{{d{je}}}{}{}}{{{d{Id}}{d{jAl}}}An}0{CfId}{NbId}{NdId}{NfId}{cc{}}{NhId}{NjId}{NlId}>{{{d{c}}}Mj{}}{c{{Af{e}}}{}{}}0{{{d{c}}}Bl{}}{ce{}{}}```````````````````````````````````>>>>>>>======={{{d{Nn}}}Nn}{{{d{O`}}}O`}{{{d{Ob}}}Ob}{{{d{Ib}}}Ib}{{{d{Od}}}Od}{{{d{Hn}}}Hn}{{{d{c}}{d{je}}}Ab{}{}}00000``{{}Od}{{{d{Nn}}{d{Nn}}}Aj}{{{d{O`}}{d{O`}}}Aj}{{{d{Ob}}{d{Ob}}}Aj}{{{d{Ib}}{d{Ib}}}Aj}{{{d{Od}}{d{Od}}}Aj}{{{d{Nd}}{d{Nd}}}Aj}{{{d{Nn}}{d{jAl}}}An}{{{d{O`}}{d{jAl}}}An}{{{d{Ob}}{d{jAl}}}An}{{{d{Ib}}{d{jAl}}}An}{{{d{Od}}{d{jAl}}}An}{{{d{Nd}}{d{jAl}}}An}0{{{d{Hn}}{d{jAl}}}An}{cc{}}00{AjOb}1{O`Ib}222{{{d{Ib}}{d{{Ln{Mj{Dn{Kd}}}}}}}{{Af{OdNd}}}}{{{d{Nn}}{d{jc}}}AbB`}{{{d{Od}}{d{jc}}}AbB`}{{{d{O`}}}Mj}`{ce{}{}}000000{{{d{O`}}}Aj}{{{d{Ob}}}Aj}{{{d{Od}}}Aj}`{{{d{Od}}{d{Od}}}{{Bd{Ad}}}}{{{d{Ib}}}Aj}`{{{d{Nn}}c}AfBh}{{{d{O`}}c}AfBh}{{{d{Ob}}c}AfBh}{{{d{Ib}}c}AfBh}{{{d{Od}}c}AfBh}`{{{d{c}}}e{}{}}00000{{{d{c}}}Mj{}}{c{{Af{e}}}{}{}}0000000000000{{{d{c}}}Bl{}}000000>>>>>>>``````````````````````````````````````{{{d{c}}}{{d{e}}}{}{}}00000000000{{{d{jc}}}{{d{je}}}{}{}}00000000000{{OfCb}{{Af{OhId}}}}{{{Oj{c}}Cb}{{Af{OhId}}}{{Ol{Fl}}}}{{{On{c}}Cb}{{Af{OhId}}}{{Ol{Fn}}}}{{{A@`{c}}Cb}{{Af{OhId}}}{{Ol{Fn}}}}{{{A@b{c}}Cb}{{Af{OhId}}}{{Ol{A@d}}}}{{{A@f{c}}Cb}{{Af{OhId}}}{{A@h{Fl}}}}{{{A@j{c}}Cb}{{Af{OhId}}}{{A@h{Fl}}}}{{{A@l{c}}Cb}{{Af{OhId}}}{{A@h{Fn}}}}{{{A@n{c}}Cb}{{Af{OhId}}}{{A@h{Fn}}}}{{{AA`{c}}Cb}{{Af{OhId}}}{{A@h{Fn}}}}{{{AAb{c}}Cb}{{Af{OhId}}}{{A@h{Fn}}}}{{{AAd{c}}Cb}{{Af{OhId}}}{{A@h{A@d}}}}{{{AAf{c}}Cb}{{Af{OhId}}}{{A@h{A@d}}}}{cc{}}00000000000{ce{}{}}00000000000{{Oh{d{{Gd{I`}}}}Cb}{{Af{{Ij{KlKn}}Id}}}}{{c{d{{Gd{I`}}}}Cb}{{Af{{Ij{{C`{Df}}{Ln{DfLl}}}}Id}}}{}}00000000000{c{{Af{e}}}{}{}}00000000000000000000000{{{d{c}}}Bl{}}00000000000444444444444```````````````````````````````````````````{{}AAh}{{}Cl}{{DfDh}{{Af{DjDl}}}}{{{d{c}}}{{d{e}}}{}{}}00000000000{{{d{jc}}}{{d{je}}}{}{}}00000000000{{{d{{AAj{ce}}}}{d{g}}}{{Eb{{E`{c}}}}}{CjCh}Db{{Ed{c}}}}{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbEh}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}00000{{{d{c}}}{{Af{AbEh}}}Ch}{{{d{{D`{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbEh}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}{{{d{{h{{Dn{f}}}}}}}{{Af{AbEh}}}}{{{d{{AAl{ce}}}}}{{AAl{ce}}}G`Db}{{{d{Cl}}}Cl}{{{d{AAn}}}AAn}{{{d{{AAj{ce}}}}}{{AAj{ce}}}{G`Ch}{G`Db}}{{{d{Df}}}Df}{{{d{Ll}}}Ll}{{{d{AB`}}}AB`}{{{d{ABb}}}ABb}{{{d{ABd}}}ABd}{{{d{c}}{d{je}}}Ab{}{}}00000000{{{d{{AAj{ce}}}}{d{{AAj{ce}}}}}Ad{GbCh}{GbDb}}{{{d{Df}}{d{Df}}}Ad}{{{d{AB`}}{d{AB`}}}Ad}{{{d{ABd}}{d{ABd}}}Ad}`{{}AAn}{{{d{{AAl{ce}}}}}{{d{g}}}{}Db{}}{{DfDh}{{Af{DjDl}}}}{c{{Af{Df}}}Ah}{{{d{{AAj{ce}}}}}Hb{CjCh}Db}{{{d{Cl}}{d{Cl}}}Aj}{{{d{{AAj{ce}}}}{d{{AAj{ce}}}}}Aj{HdCh}{HdDb}}{{{d{Df}}{d{Df}}}Aj}{{{d{Ll}}{d{Ll}}}Aj}{{{d{AB`}}{d{AB`}}}Aj}{{{d{ABb}}{d{ABb}}}Aj}{{{d{ABd}}{d{ABd}}}Aj}{{{d{{ABf{c}}}}{d{jAl}}}An{ABhDb}}{{{d{Cl}}{d{jAl}}}An}{{{d{AAn}}{d{jAl}}}An}{{{d{Nl}}{d{jAl}}}An}0{{{d{{AAj{ce}}}}{d{jAl}}}{{Af{AbIl}}}ChDb}0{{{d{Df}}{d{jAl}}}{{Af{AbIl}}}}0{{{d{Ll}}{d{jAl}}}{{Af{AbIl}}}}0{{{d{AB`}}{d{jAl}}}{{Af{AbIl}}}}{{{d{ABb}}{d{jAl}}}{{Af{AbIl}}}}{{{d{ABd}}{d{jAl}}}{{Af{AbIl}}}}{{{d{{AAj{ce}}}}g}AjChDb{{J`{{d{c}}}{{In{Aj}}}}}}{ABj{{ABl{c}}}Db}{ABn{{ABl{c}}}Db}{cc{}}0000{CfNl}1{NhNl}2{DjDf}33333{{DfAAh}{{ABf{c}}}Db}{{LlAAh}{{ABf{c}}}Db}{{{d{Bn}}}{{Af{Df}}}}{{{d{Bn}}}{{Af{Ll}}}}{{{d{Kb}}}{{Af{{AAj{ce}}Cf}}}{GnCh}Db}{{{d{Df}}}{{Bd{AC`}}}}{{{d{Df}}}{{Dn{AC`}}}}{c{{Af{{AAl{{ACh{}{{ACb{e}}{ACd{c}}{ACf{g}}}}i}}g}}}{}{{ACj{{h{f}}}}ACl}ABhDb}{{}{{Af{{AAl{ACnc}}e}}}Db{}}{{ce}{{Af{{AAl{{ACh{}{{ACb{e}}{ACd{c}}{ACf{g}}}}i}}g}}}{}{{ACj{{h{f}}}}ACl}ABhDb}{c{{Af{{AAl{ACne}}g}}}{}Db{}}{{{d{{ABl{c}}}}}AjDb}{{{d{Df}}}Aj}{{{d{{AAj{ce}}}}{d{jg}}}Ab{KhCh}{KhDb}B`}{{{d{Df}}{d{jc}}}AbB`}{{{d{AB`}}{d{jc}}}AbB`}{{{d{ABd}}{d{jc}}}AbB`}{ce{}{}}00000000000{DfAD`}{Ol{{Af{{ABf{c}}Nl}}}Db}{{A@h{Bd{ADb}}AC`}{{Af{{ABf{c}}Nl}}}Db}{{{AAl{ec}}}{{Af{{ABf{c}}Nl}}}Db{{Ol{c}}}}{{{AAl{ec}}{Bd{ADb}}AC`}{{Af{{ABf{c}}Nl}}}Db{{A@h{c}}}}{{{ABf{c}}}{{Af{{ABf{c}}Nl}}}Db}{Df{{Af{{ABf{c}}Nl}}}Db}{Ll{{Af{{ABf{c}}Nl}}}Db}{A@h{{Af{{ABl{c}}Nl}}}Db}{{{ABl{c}}}{{Af{{ABl{c}}Nl}}}Db}{{{AAl{ec}}}{{Af{{ABl{c}}Nl}}}Db{{A@h{c}}}}{{{AAl{ce}}}c{}Db}{Df{{Dn{Df}}}}{Ll{{Dn{Ll}}}}{{{ABl{c}}Cb}{{Bd{ABj}}}Db}{{{ABl{c}}Cb{d{{Gd{e}}}}}ABnDbM`}{{{d{Df}}}Aj}{{}Aj}{{{d{Cl}}}Aj}2{{{d{Ll}}}Aj}212133```{{{d{{AAj{ce}}}}}{{Af{{Ld{c}}Cf}}}ChDb}{{}AAh}{{{d{Df}}}ADd}{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Bd{Kd}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}{{{d{{AAj{ce}}}}}KdChDb}0{{{d{AAh}}{d{AAh}}}AAh}{{}{{d{Bn}}}}{{Kd{Dn{c}}}{{Af{{AAj{ce}}Cf}}}ChDb}{{{d{Df}}}Kd}``{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbCf}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}{{{ABf{c}}AAh}{{ABf{c}}}Db}{{{d{{AAj{ce}}}}{d{{AAj{ce}}}}}{{Bd{Ad}}}{MbCh}{MbDb}}{{{d{Df}}{d{Df}}}{{Bd{Ad}}}}{{{d{AB`}}{d{AB`}}}{{Bd{Ad}}}}{{{d{ABd}}{d{ABd}}}{{Bd{Ad}}}}{{{d{c}}}KdCh}`{{{d{{AAj{ce}}}}}{{Af{AbCf}}}ChDb}{{{d{{AAj{ce}}}}g}{{Af{{Dn{{Dn{f}}}}Cf}}}{CjCh}Db{{Kf{c}}}}={{{d{Df}}c}AfBh}{{}Mh}{{{d{{AAj{ce}}}}}{{D`{ce}}}{CjCh}Db}{{}AAh}{{{d{c}}}e{}{}}00000000{{{d{Ll}}{d{{Gd{c}}}}}{{Af{DfADf}}}M`}{{{d{c}}}Mj{}}000??{{{d{{AAj{ce}}}}{d{jk}}}{{Af{{AAj{ge}}{Ml{i}}}}}ChDbCh{}{{Mn{cgi}}}}{c{{Af{e}}}{}{}}00000000000000000000000{{{d{c}}}Bl{}}00000000000{ce{}{}}00000000000`{{{d{ADh}}}{{Bd{ADj}}}}{{{d{ADh}}}{{Bd{ADl}}}}{{{d{ADh}}Kd}{{Bd{Bj}}}}`````````````````````````````{{ADnADn}ADn}{{{d{jAE`}}bAEb{AEf{AEd}}}Ab}`{{{d{AE`}}}{{Ln{b{`{{AEj{}{{AEh{{Ij{DhHb}}}}}}G`}}}}}}{{{d{jAE`}}{d{AEl}}Dh}{{Af{AbAEn}}}}{{{d{jAE`}}{d{AEl}}DhAF`}{{Af{AbAFb}}}}{{{d{jAE`}}c}Ab{{AFf{}{{AEh{{Ij{{d{AFd}}H`}}}}}}}}{{{d{jAE`}}c}{{Af{AbAEn}}}{{AFj{AFh}}}}{{{d{AE`}}}{{d{{AFn{AFl}}}}}}{{{d{AE`}}}ADn}{{{d{c}}}{{d{e}}}{}{}}00000000{{{d{jc}}}{{d{je}}}{}{}}00000000{{{d{jAE`}}AG`}{{Af{{AGd{AGb}}AGf}}}}{{{d{jAE`}}}{{AGd{AGb}}}}{{{d{AE`}}{d{AFd}}}{{Af{ADjAGh}}}}{{{d{AE`}}{d{AFd}}}{{Af{ADlAGh}}}}{{{d{jAE`}}{d{AFd}}}Ab}``{{{d{AE`}}}AGj}{{{d{ADn}}}ADn}{{{d{AFh}}}AFh}{{{d{c}}{d{je}}}Ab{}{}}0`{{{d{jAE`}}}{{AGl{Aj}}}}`{{}ADn}{{}AFh}{{{d{AGn}}}{{d{c}}}{}}{{{d{AE`}}b}{{Bd{Dh}}}}{{{d{AE`}}{d{If}}}{{Bd{{Ij{bDh}}}}}}{{{d{AE`}}b}Mj}{c{{Af{ADn}}}Ah}{{{d{ADn}}{d{ADn}}}Aj}{{{d{AGn}}{d{AGn}}}Aj}``{{{d{AE`}}{d{jAH`}}AHb}{{Af{AjAHd}}}}{{{d{ADn}}{d{jAl}}}{{Af{AbIl}}}}0{{{d{AE`}}{d{jAl}}}An}{{{d{AFh}}{d{jAl}}}An}{{{d{AGn}}{d{jAl}}}An}0{{{d{AHf}}{d{jAl}}}An}0{{{d{AHh}}{d{jAl}}}An}0{{{d{AHj}}{d{jAl}}}An}0{{{d{AHl}}{d{jAl}}}An}0{{{d{AHn}}{d{jAl}}}An}0{cc{}}0{AI`AFh}1{{{AIb{b}}}AFh}222222{{{d{AE`}}b}{{d{Kl}}}}{{{d{AE`}}l{Bd{AId}}Aj}{{Af{AIfAIh}}}}{{{d{AE`}}b}{{AEf{Hl}}}}{{{d{AE`}}AG`}{{Bd{{AIj{{AEf{AFd}}AFl}}}}}}{{{d{AE`}}Bb}{{Bd{l}}}}````{{{d{jAE`}}AF`}{{Af{AjAIl}}}}{{{d{jAE`}}AFdAIn}{{Af{AjAHl}}}}{{{d{jAE`}}BbBj}Ab}{ce{}{}}00000000{{{d{AJ`}}{d{If}}}Aj}{{{d{AE`}}{d{If}}}Aj}`{{{d{AE`}}}{{`{{AEj{}{{AEh{{Ij{{d{b}}{d{Kl}}}}}}}}}}}}`{{{d{AE`}}}AJb}{{{d{AE`}}}{{`{{AEj{}{{AEh{l}}}}}}}}0{{{d{AE`}}b}{{`{{AJd{}{{AEh{AGn}}}}}}}}{c{{Af{AE`AHh}}}{{AJh{AJf}}AJjAJl}}{{{d{AE`}}}{{d{AJn}}}}{{{d{jAE`}}bDh}Aj}{{{d{AE`}}}Cb}`{{cceCb}{{Af{AE`AHf}}}Kj{{AJh{AJf}}AJjAJl}}{{ccCb}{{Af{AE`Id}}}Kj}{{ccCbAK`}{{Af{AE`Id}}}Kj}{{cceCb}{{Af{AE`AHj}}}Kj{{AJh{AJf}}AJjAJl}}{{cceCbAK`}{{Af{AE`AHj}}}Kj{{AJh{AJf}}AJjAJl}}{{cceCbAK`}{{Af{AE`AHf}}}Kj{{AJh{AJf}}AJjAJl}}{{{d{AE`}}b}Dh}{{{d{jAE`}}b}{{AGl{AGn}}}}{{{d{AE`}}bDh}AGn}{{{d{AE`}}b}{{Af{{Bd{Ib}}Id}}}}{{{d{AE`}}b}{{d{Kl}}}}{{{d{jAE`}}bDh}{{AGl{{`{{AEj{}{{AEh{AGn}}}}}}}}}}4{{{d{AE`}}}{{d{{Gd{I`}}}}}}{{{d{AE`}}{d{AFd}}}{{Ij{ADjADj}}}}{{{d{ADn}}c}AfBh}{{{d{AE`}}{d{jAH`}}AHb}{{Af{AjAHd}}}}`{{{d{AE`}}}{{d{{AKb{b}}}}}}{{{d{AE`}}}{{d{AJf}}}}{{{d{AE`}}}{{AKd{b}}}}{{{d{AE`}}}AKf}{{{d{c}}}e{}{}}0{{{d{c}}}Mj{}}000000{{{d{ADn}}}ADj}{{{d{AE`}}}{{`{{AEj{}{{AEh{{AIj{{AEf{AFd}}AFl}}}}}}}}}}`1{c{{Af{e}}}{}{}}00000000000000000`{{{d{AE`}}}{{d{{AFn{AFl}}}}}}{{{d{c}}}Bl{}}00000000{{{d{AE`}}b}{{`{{AEj{}{{AEh{{Ij{DhHb}}}}}}G`}}}}{{{d{jAE`}}bDh}Aj}`{ce{}{}}00000000{{c{Bd{c}}Cb{d{{Gd{I`}}}}}{{Af{MjId}}}Kj}```````````````````````{{{d{c}}}{{d{e}}}{}{}}00000{{{d{jc}}}{{d{je}}}{}{}}00000{{{d{AKh}}}AKh}{{{d{AKj}}}AKj}{{{d{AKl}}}AKl}{{{d{c}}{d{je}}}Ab{}{}}00{{{d{AKn}}{Dn{n}}{Dn{n}}ADlH`{d{If}}}{{Af{AL`ALb}}}}{{{d{AKh}}{Dn{n}}{Dn{n}}ADlH`{d{If}}}{{Af{AL`ALb}}}}{{{d{AKj}}{Dn{n}}{Dn{n}}ADlH`{d{If}}}{{Af{AL`ALb}}}}{{{d{AKl}}{Dn{n}}{Dn{n}}ADlH`{d{If}}}{{Af{AL`ALb}}}}{{H`ADl{d{If}}}ALd}{{}AKh}{{}AKj}{{}AKl}``{{{d{ALb}}{d{jAl}}}An}0{{{d{ALd}}{d{jAl}}}An}{{{d{AL`}}{d{jAl}}}An}{{{d{AKh}}{d{jAl}}}An}{{{d{AKj}}{d{jAl}}}An}{{{d{AKl}}{d{jAl}}}An}{cc{}}00000{ce{}{}}00000{{{d{AL`}}}H`}{H`AKl}`1{{{d{c}}}e{}{}}00{{{d{c}}}Mj{}}{c{{Af{e}}}{}{}}00000000000{{{d{c}}}Bl{}}00000666666``````````````````````````````````````{{{d{c}}}{{d{e}}}{}{}}00{{{d{jc}}}{{d{je}}}{}{}}00{{{d{ALf}}}ALf}{{{d{c}}{d{je}}}Ab{}{}}{{{d{ALf}}{d{jAl}}}An}0{{{d{AIh}}{d{jAl}}}An}0{{{d{AGf}}{d{jAl}}}An}0>{ALfAIh}?{IdAIh}{ALhAIh}{NdAIh}{ALbAIh}{cc{}}{ce{}{}}00{{{d{c}}}e{}{}}{{{d{c}}}Mj{}}00{c{{Af{e}}}{}{}}00000{{{d{c}}}Bl{}}00444``````````{{{d{c}}}{{d{e}}}{}{}}{{{d{jc}}}{{d{je}}}{}{}}{{{d{ALj}}}{{Bd{Mj}}}}{{{d{ALj}}}Mj}{c{{Af{ALj}}}Ah}{{{d{AE`}}{d{Bn}}Aj}{{Af{ALj{d{Bn}}}}}}{{{d{ALj}}{d{jAl}}}An}0<{{{d{Bn}}}{{Af{ALjc}}}{}}<``{{{d{ALj}}c}AfBh};::9=```````````````````````````````````{{{d{jHl}}ALlAEb{AEf{AEd}}}{{Bd{{AEf{AEd}}}}}}``{{{d{Hl}}{d{{Gd{I`}}}}}Kn}`::::::::99999999{{Kn{d{{C`{Df}}}}{d{{Gd{I`}}}}}Hl}{{{d{ALl}}}ALl}{{{d{ALn}}}ALn}{{{d{{AM`{c}}}}}{{AM`{c}}}{G`AMbABhG`}}{{{d{AEb}}}AEb}{{{d{Hl}}}Hl}{{{d{AHb}}}AHb}{{{d{AMd}}}AMd}{{{d{c}}{d{je}}}Ab{}{}}000000{{{d{ALl}}{d{ALl}}}Ad}{{{d{AEb}}{d{AEb}}}Ad}{{}AEb}{{}Hl}{{}AHb}{{}AMd}{{{d{{AM`{c}}}}}{{d{e}}}{AMbABhG`}{}}{{{d{AMf}}}{{Bd{Ll}}}}{{{d{{AM`{{AMh{ABj}}}}}}}{{Bd{Ll}}}}{{{d{{AM`{AMj}}}}}{{Bd{Ll}}}}{{{d{{AM`{{AMl{ABj}}}}}}}{{Bd{Ll}}}}{{{d{ALl}}{d{ALl}}}Aj}{{{d{ALn}}{d{ALn}}}Aj}{{{d{AEb}}{d{AEb}}}Aj}{{{d{AMd}}{d{AMd}}}Aj}{{{d{Hl}}ALl}{{Bd{{d{{AEf{AEd}}}}}}}}{{{d{ALl}}{d{jAl}}}An}{{{d{AHd}}{d{jAl}}}An}0{{{d{ALn}}{d{jAl}}}An}{{{d{{AM`{c}}}}{d{jAl}}}An{ABhAMbABhG`}}{{{d{AEb}}{d{jAl}}}An}{{{d{Hl}}{d{jAl}}}An}{{{d{AHb}}{d{jAl}}}An}{{{d{AMd}}{d{jAl}}}An}{ADdALl}{FhALl}{cc{}}{AMnAHd}1111111{{{d{ALl}}{d{jc}}}AbB`}{{{d{AMf}}{d{{Gd{I`}}}}}ALl}{{{d{{AM`{AMj}}}}{d{{Gd{I`}}}}}ALl}{{{d{{AM`{{AMl{ABj}}}}}}{d{{Gd{I`}}}}}ALl}{{{d{{AM`{{AMh{ABj}}}}}}{d{{Gd{I`}}}}}ALl}{{{d{Hl}}}{{Dn{{d{ALl}}}}}}{ce{}{}}0000000{{cALn}{{AM`{c}}}{AMbABhG`}}{{}Hl}{{{d{ALl}}{d{ALl}}}{{Bd{Ad}}}}{{{d{AEb}}{d{AEb}}}{{Bd{Ad}}}}{{{d{jHl}}ALlAEb}{{Bd{{AEf{AEd}}}}}}``{{{d{AN`}}{d{jAH`}}Kd{d{AHb}}{d{{Gd{I`}}}}}{{Af{AbAHd}}}}{{{d{{AM`{{AMh{ABj}}}}}}{d{jAH`}}Kd{d{AHb}}{d{{Gd{I`}}}}}{{Af{AbAHd}}}}{{{d{{AM`{{AMl{ABj}}}}}}{d{jAH`}}Kd{d{AHb}}{d{{Gd{I`}}}}}{{Af{AbAHd}}}}{{{d{{AM`{AMj}}}}{d{jAH`}}Kd{d{AHb}}{d{{Gd{I`}}}}}{{Af{AbAHd}}}}{{{d{AEd}}{d{jAH`}}{d{AHb}}{d{{Gd{I`}}}}}{{Af{AbAHd}}}}{{{d{c}}{d{jAH`}}{d{AHb}}{d{{Gd{I`}}}}}{{Af{AbAHd}}}{}}`{{{d{Hl}}}{{Dn{{d{{AEf{AEd}}}}}}}}`{{{d{c}}}e{}{}}000000{{{d{c}}}Mj{}}``{c{{Af{e}}}{}{}}000000000000000{{{d{c}}}Bl{}}0000000{ce{}{}}0000000````````````````{{{d{j{AGd{c}}}}{d{e}}}{{d{j{AGd{c}}}}}{}{{ANd{ANb}}}}{{{d{j{AGd{c}}}}BbAIfKd}{{Af{{d{j{AGd{c}}}}ANf}}}{}}{{{d{j{AGd{c}}}}BbAIfKdBf}{{Af{{d{j{AGd{c}}}}ANf}}}{}}{{{d{j{AGd{c}}}}}{{d{j{AGd{c}}}}}{}}{{{d{j{AGd{c}}}}HbADj}{{d{j{AGd{c}}}}}{}}{{{d{j{AGd{c}}}}Bb}{{d{j{AGd{c}}}}}{}}{{{d{j{AGd{c}}}}Bb}{{Af{{d{j{AGd{c}}}}ANh}}}{}}{{{d{j{AGd{c}}}}{d{{h{Bb}}}}}{{Af{{d{j{AGd{c}}}}ANh}}}{}}{{{d{j{AGd{c}}}}Aj}{{d{j{AGd{c}}}}}{}}{{{d{c}}}{{d{e}}}{}{}}0000{{{d{jc}}}{{d{je}}}{}{}}0000{{{d{j{AGd{c}}}}ANj}{{d{j{AGd{c}}}}}{}}{{{d{{AGd{c}}}}}{{AGd{c}}}G`}{{{d{ANl}}}ANl}{{{d{ANj}}}ANj}{{{d{c}}{d{je}}}Ab{}{}}00{{{d{ANl}}{d{ANl}}}Ad}{{{d{ANj}}{d{ANj}}}Ad}{{{AGd{c}}e}{{AGd{e}}}{}AKn}{{{d{j{AGd{c}}}}Dh}{{d{j{AGd{c}}}}}{}}{{}ANl}{{}ANj}{{{d{j{AGd{c}}}}}{{d{j{AGd{c}}}}}{}}{{{d{j{AGd{c}}}}Hb}{{d{j{AGd{c}}}}}{}}11{{{d{j{AGd{c}}}}Bf}{{d{j{AGd{c}}}}}{}}{{{d{ANl}}{d{ANl}}}Aj}{{{d{ANj}}{d{ANj}}}Aj}{{{d{j{AGd{c}}}}ADj}{{d{j{AGd{c}}}}}{}}{{{d{j{AGd{c}}}}ADl}{{d{j{AGd{c}}}}}{}}{{{AGd{c}}}{{Af{AH`AIh}}}AKn}{{{d{{AGd{c}}}}{d{jAl}}}AnABh}{{{d{ANh}}{d{jAl}}}An}0{{{d{ANf}}{d{jAl}}}An}0{{{d{ANl}}{d{jAl}}}An}{{{d{ANj}}{d{jAl}}}An}{cc{}}0000{{{d{ANl}}{d{jc}}}AbB`}{{{d{ANj}}{d{jc}}}AbB`}?{ce{}{}}0000{{{d{j{AGd{c}}}}}{{d{j{AGd{c}}}}}{}}{{{d{j{AGd{c}}}}ANn}{{d{j{AGd{c}}}}}{}}11{{{d{j{AGd{c}}}}ANl}{{d{j{AGd{c}}}}}{}}{{{d{ANl}}{d{ANl}}}{{Bd{Ad}}}}{{{d{ANj}}{d{ANj}}}{{Bd{Ad}}}}{{{d{j{AGd{c}}}}{Ln{Mj{Dn{Kd}}}}b}{{d{j{AGd{c}}}}}{}}{{{d{j{AGd{c}}}}{Dn{{Ij{HbADj}}}}}{{d{j{AGd{c}}}}}{}}{{{d{j{AGd{c}}}}AId}{{d{j{AGd{c}}}}}{}}{{{d{ANl}}{d{jAFd}}}Ab}{{{d{c}}}e{}{}}00{{{d{c}}}Mj{}}0{c{{Af{e}}}{}{}}000000000{{{d{c}}}Bl{}}0000{{{d{j{AGd{c}}}}{Dn{Bb}}}{{d{j{AGd{c}}}}}{}}{{{d{j{AGd{c}}}}AO`}{{d{j{AGd{c}}}}}{}}?????``","D":"FH`","p":[[6,"KeychainKind",0,1723],[1,"reference"],[1,"u8"],[1,"slice"],[0,"mut"],[5,"LocalOutput",0,1723],[5,"WeightedUtxo",0,1723],[6,"Utxo",0,1723],[1,"unit"],[6,"Ordering",1724],[6,"Result",1725],[10,"Deserializer",1726],[1,"bool"],[5,"Formatter",1727],[8,"Result",1727],[10,"Hasher",1728],[5,"OutPoint",1729],[6,"Option",1730],[5,"Sequence",1729],[10,"Serializer",1731],[5,"TxOut",1729],[5,"TypeId",1732],[1,"str"],[6,"Descriptor",100,1733],[6,"Network",1734],[5,"Address",1735],[6,"Error",1736],[10,"MiniscriptKey",1736],[10,"ToPublicKey",1736],[6,"ScriptContextEnum",691],[5,"Miniscript",100,1737],[6,"Terminal",1738],[10,"ScriptContext",691,1739],[6,"Tree",1740],[6,"DescriptorPublicKey",691,1741],[1,"u32"],[5,"DefiniteDescriptorKey",1741],[6,"ConversionError",1741],[5,"Vec",1742],[6,"Placeholder",1743],[5,"Satisfaction",1743],[10,"AssetProvider",1744],[17,"Key"],[6,"ScriptContextError",1739],[17,"Sha256"],[5,"Hash",1745],[17,"Hash256"],[5,"Hash",1746],[17,"Ripemd160"],[5,"Hash",1747],[17,"Hash160"],[5,"Hash",1748],[10,"ParseableKey",1738],[6,"Legacy",100,1739],[6,"Segwitv0",100,1739],[10,"Clone",1749],[10,"Ord",1724],[5,"Secp256k1",1750],[5,"PublicKey",1751],[10,"Verification",1752],[6,"DescriptorType",1733],[5,"DescriptorId",1753],[10,"FromStr",1754],[1,"u64"],[5,"ScriptBuf",1755],[10,"PartialEq",1724],[5,"ExtParams",1756],[6,"AnalysisError",1756],[10,"ExtractPolicy",100],[5,"SignersContainer",1426],[6,"BuildSatisfaction",384],[6,"All",1757],[5,"Policy",384],[6,"Error",352],[5,"Script",1758],[5,"Range",1759],[1,"tuple"],[5,"Error",1727],[17,"Output"],[10,"FnMut",1760],[5,"Wpkh",1761],[5,"Wsh",1761],[5,"Pkh",1762],[5,"Tr",1763],[5,"Bare",1762],[5,"Sh",1764],[5,"Type",1765],[5,"ExtData",1766],[5,"Tree",1767],[1,"usize"],[10,"Satisfier",1743],[10,"Hash",1728],[10,"IntoWalletDescriptor",100],[8,"ExtendedDescriptor",100],[8,"KeyMap",691,1733],[5,"Iter",1768],[5,"PkIter",1768],[6,"Policy",1769],[6,"LiftError",1770],[6,"BareCtx",1739],[6,"TapTree",1763],[6,"DescriptorSecretKey",691,1741],[5,"BTreeMap",1771],[10,"Signing",1752],[10,"PartialOrd",1724],[5,"Plan",1744],[5,"TxIn",1729],[6,"SigType",1739],[5,"String",1772],[6,"TranslateErr",1736],[10,"Translator",1736],[1,"array"],[6,"HexToBytesError",1773],[6,"PolicyError",384],[6,"Error",1751],[6,"Error",1774],[6,"Error",1775],[6,"KeyError",691],[6,"PkOrF",384],[6,"SatisfiableItem",384],[6,"Satisfaction",384],[5,"Condition",384],[10,"DescriptorTemplate",555],[8,"DescriptorTemplateOut",555],[5,"P2Pkh",555],[10,"IntoDescriptorKey",691],[5,"P2Wpkh_P2Sh",555],[5,"P2Wpkh",555],[5,"P2TR",555],[6,"Tap",1739],[5,"Bip44",555],[10,"DerivableKey",691],[5,"Bip44Public",555],[5,"Bip49",555],[5,"Bip49Public",555],[5,"Bip84",555],[5,"Bip84Public",555],[5,"Bip86",555],[5,"Bip86Public",555],[8,"ValidNetworks",691],[5,"SortedMultiVec",691,1776],[5,"GeneratedKey",691],[5,"PrivateKeyGenerateOptions",691],[5,"SinglePub",691,1741],[5,"SinglePriv",691,1741],[6,"SinglePubKey",691,1741],[6,"DescriptorKey",691],[10,"Debug",1727],[5,"Xpriv",1774],[6,"ExtendedKey",691],[5,"Xpub",1774],[5,"DerivationPath",1774],[17,"Entropy"],[17,"Options"],[17,"Error"],[10,"GeneratableKey",691],[10,"AsMut",1777],[10,"Default",1778],[10,"GeneratableDefaultOptions",691],[5,"Assets",1744],[8,"KeySource",1774],[5,"Fingerprint",1774],[5,"DescriptorKeyParseError",1741],[10,"PsbtUtils",989],[5,"Amount",1779],[5,"FeeRate",1780],[5,"Balance",993,1781],[5,"Wallet",993],[5,"SignerOrdering",1426],[10,"TransactionSigner",1426],[5,"Arc",1782],[17,"Item"],[10,"Iterator",1783],[5,"Block",1784],[5,"CannotConnectError",1785],[5,"BlockId",1786],[6,"ApplyHeaderError",1785],[5,"Transaction",1729],[10,"IntoIterator",1787],[5,"Update",993],[10,"Into",1777],[5,"ConfirmationTimeHeightAnchor",1786],[5,"TxGraph",1788],[5,"Txid",1789],[8,"DefaultCoinSelectionAlgorithm",1226],[5,"TxBuilder",1606],[6,"BuildFeeBumpError",1325],[6,"CalculateFeeError",1788],[5,"CheckPointIter",1785],[8,"Result",1790],[5,"AddressInfo",993],[5,"Psbt",1791],[5,"SignOptions",1426],[6,"SignerError",1426],[6,"NewError",993],[6,"LoadError",993],[6,"NewOrLoadError",993],[6,"InsertTxError",993],[6,"ApplyBlockError",993],[5,"SyncResult",1792],[5,"FullScanResult",1792],[5,"PsbtSighashType",1793],[5,"Input",1793],[6,"CreateTxError",1325],[5,"CanonicalTx",1788],[5,"AlterCheckPointError",1785],[6,"ConfirmationTime",1786],[10,"IsDust",993,1794],[5,"CheckPoint",1785],[10,"DoubleEndedIterator",1795],[8,"ChangeSet",993],[10,"PersistBackend",1796],[10,"Send",1797],[10,"Sync",1797],[5,"LocalChain",1785],[5,"BlockHash",1789],[5,"KeychainTxOutIndex",1798],[5,"FullScanRequest",1792],[5,"SyncRequest",1792],[5,"LargestFirstCoinSelection",1226],[5,"OldestFirstCoinSelection",1226],[5,"BranchAndBoundCoinSelection",1226],[10,"CoinSelectionAlgorithm",1226],[5,"CoinSelectionResult",1226],[6,"Error",1226],[6,"Excess",1226],[6,"MiniscriptPsbtError",1325],[6,"Error",1799],[5,"FullyNodedExport",1403],[6,"SignerId",1426],[6,"SignerContext",1426],[5,"SignerWrapper",1426],[10,"Sized",1797],[6,"TapLeavesOptions",1426],[10,"SignerCommon",1426],[5,"DescriptorMultiXKey",1741],[5,"PrivateKey",1751],[5,"DescriptorXKey",1741],[6,"Error",1800],[10,"InputSigner",1426],[5,"PushBytes",1801],[10,"AsRef",1777],[6,"AddForeignUtxoError",1606],[6,"AddUtxoError",1606],[6,"ChangeSpendPolicy",1606],[6,"TxOrdering",1606],[6,"LockTime",1802],[1,"i32"],[15,"Foreign",97],[8,"DerivedDescriptor",100],[15,"PsbtTimelocks",531],[15,"Complete",534],[15,"Partial",534],[15,"PartialComplete",534],[15,"Sha256Preimage",545],[15,"Hash256Preimage",545],[15,"Ripemd160Preimage",545],[15,"Hash160Preimage",545],[15,"Thresh",545],[15,"Multisig",545],[15,"AbsoluteTimelock",545],[15,"RelativeTimelock",545],[10,"ExtScriptContext",691],[15,"UnexpectedConnectedToHash",1216],[15,"ConfirmationHeightCannotBeGreaterThanTip",1218],[15,"LoadedGenesisDoesNotMatch",1220],[15,"LoadedNetworkDoesNotMatch",1220],[15,"LoadedDescriptorDoesNotMatch",1220],[15,"InsufficientFunds",1318],[15,"Change",1320],[15,"NoChange",1320],[15,"RbfSequenceCsv",1397],[15,"LockTime",1397],[15,"FeeTooLow",1397],[15,"FeeRateTooLow",1397],[8,"WalletExport",1403],[15,"Tap",1605],[15,"InvalidTxid",1721]],"r":[[2,100],[4,1723],[6,1723],[7,1426],[8,1606],[9,1723],[10,993],[11,1723],[70,993],[71,100],[104,1733],[106,1741],[112,1739],[113,1737],[118,384],[119,1739],[120,1739],[153,350],[694,1741],[695,1741],[710,1733],[720,1739],[725,1741],[726,1741],[727,1741],[728,1776],[995,1781],[1003,1794]],"b":[[191,"impl-Descriptor%3CDefiniteDescriptorKey%3E"],[192,"impl-Descriptor%3CDescriptorPublicKey%3E"],[211,"impl-Display-for-Descriptor%3CPk%3E"],[212,"impl-Debug-for-Descriptor%3CPk%3E"],[215,"impl-Debug-for-Miniscript%3CPk,+Ctx%3E"],[216,"impl-Display-for-Miniscript%3CPk,+Ctx%3E"],[219,"impl-From%3CWpkh%3CPk%3E%3E-for-Descriptor%3CPk%3E"],[221,"impl-From%3CWsh%3CPk%3E%3E-for-Descriptor%3CPk%3E"],[222,"impl-From%3CPkh%3CPk%3E%3E-for-Descriptor%3CPk%3E"],[223,"impl-From%3CTr%3CPk%3E%3E-for-Descriptor%3CPk%3E"],[224,"impl-From%3CBare%3CPk%3E%3E-for-Descriptor%3CPk%3E"],[225,"impl-From%3CSh%3CPk%3E%3E-for-Descriptor%3CPk%3E"],[368,"impl-Display-for-Error"],[369,"impl-Debug-for-Error"],[370,"impl-From%3CError%3E-for-Error"],[371,"impl-From%3CHexToBytesError%3E-for-Error"],[372,"impl-From%3CPolicyError%3E-for-Error"],[373,"impl-From%3CError%3E-for-Error"],[375,"impl-From%3CError%3E-for-Error"],[376,"impl-From%3CError%3E-for-Error"],[377,"impl-From%3CKeyError%3E-for-Error"],[459,"impl-Display-for-PolicyError"],[460,"impl-Debug-for-PolicyError"],[809,"impl-Debug-for-KeyError"],[810,"impl-Display-for-KeyError"],[811,"impl-Debug-for-SortedMultiVec%3CPk,+Ctx%3E"],[812,"impl-Display-for-SortedMultiVec%3CPk,+Ctx%3E"],[813,"impl-Debug-for-DescriptorPublicKey"],[814,"impl-Display-for-DescriptorPublicKey"],[815,"impl-Debug-for-DescriptorSecretKey"],[816,"impl-Display-for-DescriptorSecretKey"],[821,"impl-From%3CXpriv%3E-for-ExtendedKey%3CCtx%3E"],[822,"impl-From%3CXpub%3E-for-ExtendedKey%3CCtx%3E"],[828,"impl-From%3CError%3E-for-KeyError"],[830,"impl-From%3CError%3E-for-KeyError"],[870,"impl-IntoDescriptorKey%3CCtx%3E-for-GeneratedKey%3CK,+Ctx%3E"],[871,"impl-DerivableKey%3CCtx%3E-for-GeneratedKey%3CK,+Ctx%3E"],[1077,"impl-Display-for-Balance"],[1078,"impl-Debug-for-Balance"],[1081,"impl-Display-for-AddressInfo"],[1082,"impl-Debug-for-AddressInfo"],[1083,"impl-Debug-for-NewError"],[1084,"impl-Display-for-NewError"],[1085,"impl-Debug-for-LoadError"],[1086,"impl-Display-for-LoadError"],[1087,"impl-Display-for-NewOrLoadError"],[1088,"impl-Debug-for-NewOrLoadError"],[1089,"impl-Display-for-InsertTxError"],[1090,"impl-Debug-for-InsertTxError"],[1091,"impl-Debug-for-ApplyBlockError"],[1092,"impl-Display-for-ApplyBlockError"],[1095,"impl-From%3CSyncResult%3E-for-Update"],[1097,"impl-From%3CFullScanResult%3CKeychainKind%3E%3E-for-Update"],[1267,"impl-Debug-for-Error"],[1268,"impl-Display-for-Error"],[1364,"impl-Display-for-MiniscriptPsbtError"],[1365,"impl-Debug-for-MiniscriptPsbtError"],[1366,"impl-Debug-for-CreateTxError"],[1367,"impl-Display-for-CreateTxError"],[1368,"impl-Debug-for-BuildFeeBumpError"],[1369,"impl-Display-for-BuildFeeBumpError"],[1371,"impl-From%3CMiniscriptPsbtError%3E-for-CreateTxError"],[1373,"impl-From%3CError%3E-for-CreateTxError"],[1374,"impl-From%3CError%3E-for-CreateTxError"],[1375,"impl-From%3CPolicyError%3E-for-CreateTxError"],[1376,"impl-From%3CError%3E-for-CreateTxError"],[1413,"impl-Debug-for-FullyNodedExport"],[1414,"impl-Display-for-FullyNodedExport"],[1505,"impl-SignerCommon-for-SignerWrapper%3CDescriptorMultiXKey%3CXpriv%3E%3E"],[1506,"impl-SignerCommon-for-SignerWrapper%3CPrivateKey%3E"],[1507,"impl-SignerCommon-for-SignerWrapper%3CDescriptorXKey%3CXpriv%3E%3E"],[1514,"impl-Display-for-SignerError"],[1515,"impl-Debug-for-SignerError"],[1522,"impl-From%3CFingerprint%3E-for-SignerId"],[1523,"impl-From%3CHash%3E-for-SignerId"],[1535,"impl-SignerCommon-for-SignerWrapper%3CPrivateKey%3E"],[1536,"impl-SignerCommon-for-SignerWrapper%3CDescriptorXKey%3CXpriv%3E%3E"],[1537,"impl-SignerCommon-for-SignerWrapper%3CDescriptorMultiXKey%3CXpriv%3E%3E"],[1555,"impl-InputSigner-for-SignerWrapper%3CDescriptorMultiXKey%3CXpriv%3E%3E"],[1556,"impl-InputSigner-for-SignerWrapper%3CDescriptorXKey%3CXpriv%3E%3E"],[1557,"impl-InputSigner-for-SignerWrapper%3CPrivateKey%3E"],[1664,"impl-Debug-for-AddUtxoError"],[1665,"impl-Display-for-AddUtxoError"],[1666,"impl-Debug-for-AddForeignUtxoError"],[1667,"impl-Display-for-AddForeignUtxoError"]],"c":"OjAAAAEAAAAAAAUAEAAAAL8AAQENAR0DdAN9BQ==","e":"OzAAAAEAAHsDgAADAAAACAABAAsAAAAOABMAJgAJADUAAQA+AAAAQQAAAEUADwBXAAMAXQADAGoAAAB3AAAAigABAI0AAACPAAcAmgAAAJwAAQCfAAAAogABAKUAAQCpAAEArAABAK8AAQCyAAsAwwADAMgAAwDRAAEA1AAIAN4ABADoAAAA9QADAAABAAAGAQEACgEBABEBAQAnAQMALAEBADoBAQA9AQEAQQEFAEwBBwBVAQMAWgEDAG8BBwB4AQIAfAEEAKQBGQDAAQ4A0gEAANQBAADZAQEA6AEAAOsBBADxASIAOgIXAFMCCwB3AjwA4gIXAAQDFQAbAwEAHgMAACADFwA9AwAAPwMAAEEDAABJAwEAVAMDAGQDAABnAwQAbQMBAH0DAQCCAwAAiwMAAJADAwCZAwAAnQMIAKcDAwCuAy8A/wMAAAcEAAAJBBEAIwQDACoEAgAwBAIANgQPAEgEAABKBAAAgwQAAIoECACXBBEAqwQIALcECADYBBEA6wQCAO8EAgD0BAYACwUbAE0FDQBcBQAAXgUDAGYFDwCABQEAhAUAAIYFAQCJBQAAjQUFALsFDwDMBRQA4gUGAOoFCgD2BQAA/gUAAAAGAgAOBgEAFAYCABgGAAAcBgcAJgYfAF8GCQBqBgcAdAYBAHsGAQCABgYAjAYBAJkGAQCfBhMAtQYEAA=="}],\ +["bdk_testenv",{"t":"FEEEONNEOENNNNNNNNNNNNNNNNNNN","n":["TestEnv","anyhow","bitcoincore_rpc","bitcoind","bitcoind","borrow","borrow_mut","electrsd","electrsd","electrum_client","electrum_client","from","genesis_hash","into","invalidate_blocks","make_checkpoint_tip","mine_blocks","mine_empty_block","new","reorg","reorg_empty_blocks","reset_electrsd","rpc_client","send","try_from","try_into","type_id","vzip","wait_until_electrum_sees_block"],"q":[[0,"bdk_testenv"],[29,"electrum_client::api"],[30,"bitcoin::blockdata::block"],[31,"anyhow"],[32,"bdk_chain::local_chain"],[33,"bitcoin::address"],[34,"core::option"],[35,"alloc::vec"],[36,"bitcoincore_rpc::client"],[37,"bitcoin_units::amount"],[38,"bitcoin::blockdata::transaction"],[39,"core::result"],[40,"core::any"]],"i":[0,0,0,0,3,3,3,0,3,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],"f":"`````{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}```{{{b{f}}}{{b{{`{h}}}}}}{cc{}}{{{b{f}}}{{l{j}}}}{ce{}{}}{{{b{f}}n}{{l{A`}}}}{{{b{f}}}Ab}{{{b{f}}n{Af{Ad}}}{{l{{Ah{j}}}}}}{{{b{f}}}{{l{{Aj{nj}}}}}}{{}{{l{f}}}}{{{b{f}}n}{{l{{Ah{j}}}}}}{{{b{f}}n}{{l{{Ah{{Aj{nj}}}}}}}}{f{{l{f}}}}{{{b{f}}}{{b{{`{Al}}}}}}{{{b{f}}{b{{Ad{An}}}}B`}{{l{Bb}}}}{c{{Bd{e}}}{}{}}0{{{b{c}}}Bf{}}<{{{b{f}}}{{l{A`}}}}","D":"An","p":[[1,"reference"],[0,"mut"],[5,"TestEnv",0],[10,"ElectrumApi",29],[5,"BlockHash",30],[8,"Result",31],[1,"usize"],[1,"unit"],[5,"CheckPoint",32],[5,"Address",33],[6,"Option",34],[5,"Vec",35],[1,"tuple"],[10,"RpcApi",36],[6,"NetworkChecked",33],[5,"Amount",37],[5,"Txid",38],[6,"Result",39],[5,"TypeId",40]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAA4ABAAAAAAAAgAIABYAAAAZAAMA"}],\ +["bdk_tmp_plan",{"t":"FKPPPPFFGGFFPPPGPPONNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNNNNOOONNNNNNNNNNNNNNNNNNNNOOOOOONNNNNNNNOONHNNNNOOOOOOONONNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNOOOOOOOO","n":["Assets","CanDerive","Complete","DerivationError","Incomplete","Legacy","Plan","PlanKey","PlanState","RequiredSignatures","Requirements","SatisfactionMaterial","Segwitv0","SigHashP2wpkh","SigHashTaproot","SigningError","TapKey","TapScript","asset_key","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","can_derive","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default","default","default","default","derivation_hint","descriptor_key","ecdsa_sigs","expected_weight","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","hash160","hash160_images","hash160_preimages","hash256","hash256_images","hash256_preimages","into","into","into","into","into","into","into","into","keys","max_locktime","min_version","plan_satisfaction","required_locktime","required_sequence","requirements","requires_hash_preimages","ripemd160","ripemd160_images","ripemd160_preimages","schnorr_sigs","sha256","sha256_images","sha256_preimages","sign_with_keymap","signatures","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_complete","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","txo_age","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","witness_version","final_script_sig","final_script_witness","keys","keys","leaf_hash","merkle_root","plan_key","plan_keys"],"q":[[0,"bdk_tmp_plan"],[151,"bdk_tmp_plan::PlanState"],[153,"bdk_tmp_plan::RequiredSignatures"],[159,"miniscript::descriptor::key"],[160,"bitcoin::bip32"],[161,"core::option"],[162,"bdk_tmp_plan::requirements"],[163,"core::clone"],[164,"bdk_tmp_plan::template"],[165,"core::fmt"],[166,"bitcoin::crypto::sighash"],[167,"miniscript::descriptor"],[168,"bitcoin::blockdata::locktime::absolute"],[169,"bitcoin::blockdata::transaction"],[170,"secp256k1"],[171,"core::result"],[172,"core::borrow"],[173,"secp256k1::context"],[174,"alloc::string"],[175,"core::any"],[176,"bitcoin::blockdata::script::witness_version"]],"i":[0,0,42,10,42,9,0,0,0,0,0,0,9,10,10,0,9,9,11,42,7,9,10,11,12,13,14,42,7,9,10,11,12,13,14,3,7,9,10,11,12,13,14,7,9,10,11,12,13,14,7,9,13,14,11,11,13,12,7,9,10,10,11,12,13,14,42,7,9,10,10,10,10,11,12,13,14,14,7,13,14,7,13,42,7,9,10,11,12,13,14,14,14,12,0,12,12,12,7,14,7,13,13,14,7,13,9,7,7,9,10,11,12,13,14,10,12,42,7,9,10,11,12,13,14,42,7,9,10,11,12,13,14,14,42,7,9,10,11,12,13,14,42,7,9,10,11,12,13,14,12,45,45,46,47,48,49,49,48],"f":"```````````````````{{{b{c}}}{{b{e}}}{}{}}0000000{{{b{dc}}}{{b{de}}}{}{}}0000000{{{b{f}}{b{h}}}{{l{j}}}}{{{b{{n{c}}}}}{{n{c}}}A`}{{{b{{Ab{c}}}}}{{Ab{c}}}A`}{{{b{Ad}}}Ad}{{{b{{Af{c}}}}}{{Af{c}}}A`}{{{b{{Ah{c}}}}}{{Ah{c}}}A`}{{{b{Aj}}}Aj}{{{b{{Al{c}}}}}{{Al{c}}}A`}{{{b{c}}{b{de}}}An{}{}}000000{{}{{n{c}}}{}}{{}{{Ab{c}}}{}}{{}Aj}{{}{{Al{c}}}{}}```{{{b{{Ah{c}}}}}B`A`}{{{b{{n{c}}}}{b{dBb}}}BdBf}{{{b{{Ab{c}}}}{b{dBb}}}BdBf}{{{b{Ad}}{b{dBb}}}Bd}0{{{b{{Af{c}}}}{b{dBb}}}BdBf}{{{b{{Ah{c}}}}{b{dBb}}}BdBf}{{{b{Aj}}{b{dBb}}}Bd}{{{b{{Al{c}}}}{b{dBb}}}BdBf}{cc{}}000{BhAd}{BjAd}{BlAd}3333``````{ce{}{}}0000000``{{{b{{Ah{c}}}}}{{l{Bn}}}A`}{{{b{{C`{h}}}}{b{{Al{c}}}}}{{l{{Ah{c}}}}}{fA`}}{{{b{{Ah{c}}}}}{{l{Cb}}}A`}{{{b{{Ah{c}}}}}{{l{Cd}}}A`}{{{b{{Ah{c}}}}}{{n{c}}}A`}{{{b{{n{c}}}}}Cf{}}```````{{{b{{Ab{Ch}}}}B`{b{Cj}}{b{{Cl{c}}}}{l{Cn}}{l{D`}}{b{d{Db{e}}}}{b{dAj}}{b{{Dd{g}}}}}{{Df{CfAd}}}{{Dj{Dh}}}{{Dj{Dl}}}{DnE`}}`{{{b{c}}}e{}{}}000000{{{b{c}}}Eb{}}{{{b{{Ah{c}}}}{b{Aj}}}{{Ed{c}}}A`}{c{{Df{e}}}{}{}}000000000000000`{{{b{c}}}Ef{}}0000000<<<<<<<<{{{b{{Ah{c}}}}}{{l{Eh}}}A`}````````","D":"Fl","p":[[1,"reference"],[0,"mut"],[10,"CanDerive",0],[5,"DefiniteDescriptorKey",159],[5,"DerivationPath",160],[6,"Option",161],[5,"Requirements",0,162],[10,"Clone",163],[6,"RequiredSignatures",0,162],[6,"SigningError",0,162],[5,"PlanKey",0,164],[5,"Plan",0],[5,"SatisfactionMaterial",0],[5,"Assets",0],[1,"unit"],[1,"usize"],[5,"Formatter",165],[8,"Result",165],[10,"Debug",165],[6,"P2wpkhError",166],[6,"TaprootError",166],[6,"Error",160],[1,"u32"],[6,"Descriptor",167],[6,"LockTime",168],[5,"Sequence",169],[1,"bool"],[6,"DescriptorPublicKey",159],[8,"KeyMap",167],[6,"Prevouts",166],[6,"TapSighashType",166],[6,"EcdsaSighashType",166],[5,"SighashCache",166],[5,"Secp256k1",170],[6,"Result",171],[5,"TxOut",169],[10,"Borrow",172],[5,"Transaction",169],[10,"Signing",173],[10,"Verification",173],[5,"String",174],[6,"PlanState",0],[5,"TypeId",175],[6,"WitnessVersion",176],[15,"Complete",151],[15,"Legacy",153],[15,"Segwitv0",153],[15,"TapScript",153],[15,"TapKey",153]],"r":[[7,164],[9,162],[10,162],[15,162]],"b":[[60,"impl-Display-for-SigningError"],[61,"impl-Debug-for-SigningError"],[70,"impl-From%3CP2wpkhError%3E-for-SigningError"],[71,"impl-From%3CTaprootError%3E-for-SigningError"],[72,"impl-From%3CError%3E-for-SigningError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAGkAEAABAAEABAABAA4AAgAUACIAOwAHAEcAAgBOAAAAUQAAAFwAAQBfAAAAYgAAAGQAAABoAAAAawAAAG0AKQCaAAEA"}],\ +["bdk_wallet",{"t":"PPEPGPFEEGEFNNDNNNNNNNNENNNNNNNNNOOCQNNNNNNNNNNQNNNNNNNNNNOOCDNONCONNNEENNNNNNNNNNNNNONNNNOHNNNNCOOOPPPIGEGIKTIKRGFPPPPEKGPPPPTIPPPPPPPPPPNNNNNNNNNNNNNNNNNENNNNNNNNNNNNNMNNMNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNCNONMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNMNNNNNNMNNNNNNNNNNNNNNNNONNNNNNNNNMNNNNCNNNNNNNNNNNMNNNCNNNNNNNNNNNNNNNNNNNONNNNNNNNNNHHPPGPPPPPPPPPPPNNNNNNNNNNNNNNNNNNPPPGPFIPPIPPPPPPPPPPPGFGPPPPPGGPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNONNONNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOFFFFFFFFKIFFFFNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPKGGGRRKGPKKFKPPPRGIPPPPPRPFPKGPPPFFGFPIPPPHMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMMNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNNNNNNMNNNNNNMNNNNNNNNNNNNNNNNNNNOONHNMNNHNMNNOONNNNNNMNNNNNMNHNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNKMMMFGFPIPPPPGKGPPPPPPGGPPPPPPPFFNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNCNONNNNNNNNNCCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOONNNNNNNNNNNNMNONONNNNNNNNONNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNONNNNNNNNNHOOOOOOOOOOPPFPKFIGGPFPFNNNNNNNNNNNNNNNNNNMNNNHNNNOONNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOGPPGPPPPPPPGPPPPPPPPPPPPPPPPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOFIOONNNNNNNNNNNOONNNNNNPPPPPPPKPPPPPPPPPPPPPPPPFKGGGFFFPGKPPNOONONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNNNOOMNNNMNONONNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOGGPPPGPPPPPFGPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOO","n":["External","Foreign","HdKeyPaths","Internal","KeychainKind","Local","LocalOutput","SignOptions","TxBuilder","Utxo","Wallet","WeightedUtxo","as_byte","as_ref","bitcoin","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","chain","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","confirmation_time","derivation_index","descriptor","descriptor","deserialize","deserialize","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fragment","from","from","from","from","hash","hash","into","into","into","into","is_spent","keychain","keys","miniscript","outpoint","outpoint","partial_cmp","psbt","satisfaction_weight","sequence","serialize","serialize","signer","template","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","txout","txout","type_id","type_id","type_id","type_id","utxo","version","vzip","vzip","vzip","vzip","wallet","outpoint","psbt_input","sequence","Bare","Bare","Bare","DerivedDescriptor","Descriptor","DescriptorError","DescriptorPublicKey","ExtendedDescriptor","ExtractPolicy","FALSE","HdKeyPaths","IntoWalletDescriptor","Key","Legacy","Miniscript","MultiXPub","Pkh","Pkh","Pkh","Policy","ScriptContext","Segwitv0","Sh","Sh","Sh","Single","TRUE","TapKeyOrigins","Tr","Tr","Tr","Wpkh","Wpkh","Wpkh","Wsh","Wsh","Wsh","XPub","address","as_enum","as_enum","as_inner","as_node","at_derivation_index","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","branches","build_template","build_template_mall","calc_checksum","check_global_consensus_validity","check_global_consensus_validity","check_global_consensus_validity","check_global_policy_validity","check_global_policy_validity","check_global_validity","check_local_consensus_validity","check_local_consensus_validity","check_local_consensus_validity","check_local_policy_validity","check_local_policy_validity","check_local_policy_validity","check_local_validity","check_pk","check_pk","check_pk","check_terminal_non_malleable","check_terminal_non_malleable","check_terminal_non_malleable","check_witness","check_witness","check_witness","checksum","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","contains_raw_pkh","derive","derived_descriptor","derived_descriptor","desc_type","descriptor_id","deserialize","deserialize","dust_value","encode","eq","eq","eq","eq","error","explicit_script","ext","ext_check","extract_policy","extract_policy","extract_policy","find_derivation_index_for_spk","fmt","fmt","fmt","fmt","fmt","fmt","for_each_key","for_each_key","from","from","from","from","from","from","from","from","from","from","from_ast","from_components_unchecked","from_str","from_str","from_str_ext","from_str_insane","from_tree","from_tree","get_nth_child","get_nth_pk","get_satisfaction","get_satisfaction_mall","has_mixed_timelocks","has_repeated_keys","has_wildcard","hash","hash","hash","hash","into","into","into","into","into_inner","into_single_descriptors","into_wallet_descriptor","into_wallet_descriptor","is_deriveable","is_multipath","is_non_malleable","iter","iter_pk","lift","lift","lift_check","max_satisfaction_size","max_satisfaction_size","max_satisfaction_size","max_satisfaction_size","max_satisfaction_weight","max_satisfaction_witness_elements","max_weight_to_satisfy","name_str","name_str","name_str","new_bare","new_pk","new_pkh","new_sh","new_sh_sortedmulti","new_sh_with_wpkh","new_sh_with_wsh","new_sh_wpkh","new_sh_wsh","new_sh_wsh_sortedmulti","new_tr","new_wpkh","new_wsh","new_wsh_sortedmulti","node","other_top_level_checks","parse","parse_descriptor","parse_insane","parse_with_ext","partial_cmp","partial_cmp","partial_cmp","partial_cmp","pk_len","pk_len","pk_len","plan","plan_mall","policy","requires_sig","sanity_check","sanity_check","satisfy","satisfy","satisfy_malleable","script_code","script_pubkey","script_size","serialize","serialize","sig_type","sig_type","sig_type","substitute_raw_pkh","template","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string_with_secret","top_level_checks","top_level_type_check","translate_pk","translate_pk","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","ty","type_id","type_id","type_id","type_id","unsigned_script_sig","vzip","vzip","vzip","vzip","within_resource_limits","calc_checksum","calc_checksum_bytes","Base58","Bip32","Error","ExternalAndInternalAreTheSame","HardenedDerivationXpub","Hex","InvalidDescriptorCharacter","InvalidDescriptorChecksum","InvalidHdKeyPath","Key","Miniscript","MultiPath","Pk","Policy","borrow","borrow_mut","fmt","fmt","from","from","from","from","from","from","from","from","into","to_string","try_from","try_into","type_id","vzip","AbsoluteTimelock","AddOnLeaf","AddOnPartialComplete","BuildSatisfaction","Complete","Condition","ConditionMap","EcdsaSignature","Fingerprint","FoldedConditionMap","Hash160Preimage","Hash256Preimage","IncompatibleConditions","IndexOutOfRange","MixedTimelockUnits","Multisig","None","None","NotEnoughItemsSelected","Partial","PartialComplete","PkOrF","Policy","PolicyError","Psbt","PsbtTimelocks","Pubkey","RelativeTimelock","Ripemd160Preimage","Satisfaction","SatisfiableItem","SchnorrSignature","Sha256Preimage","Thresh","XOnlyPubkey","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","contribution","csv","default","eq","eq","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","get_condition","hash","hash","id","id","into","into","into","into","into","into","into","is_leaf","is_leaf","is_null","item","partial_cmp","requires_path","satisfaction","serialize","serialize","serialize","serialize","serialize","timelock","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","current_height","input_max_height","psbt","condition","conditions","conditions","items","items","m","m","n","n","sorted","sorted","hash","hash","hash","hash","items","keys","threshold","threshold","value","value","Bip44","Bip44Public","Bip49","Bip49Public","Bip84","Bip84Public","Bip86","Bip86Public","DescriptorTemplate","DescriptorTemplateOut","P2Pkh","P2TR","P2Wpkh","P2Wpkh_P2Sh","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","build","build","build","build","build","build","build","build","build","build","build","build","from","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","into","into","into","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","into_wallet_descriptor","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","Bip32","DerivableKey","DescriptorKey","DescriptorPublicKey","DescriptorSecretKey","Entropy","Error","ExtScriptContext","ExtendedKey","FullKey","GeneratableDefaultOptions","GeneratableKey","GeneratedKey","IntoDescriptorKey","InvalidChecksum","InvalidNetwork","InvalidScriptContext","Key","KeyError","KeyMap","Legacy","Message","Miniscript","MultiXPrv","MultiXPub","Options","Private","PrivateKeyGenerateOptions","Public","ScriptContext","ScriptContextEnum","Segwitv0","Single","Single","SinglePriv","SinglePub","SinglePubKey","SortedMultiVec","Tap","ValidNetworks","XOnly","XPrv","XPub","any_network","as_enum","at_derivation_index","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build_template","check_global_consensus_validity","check_global_policy_validity","check_global_validity","check_local_consensus_validity","check_local_policy_validity","check_local_validity","check_pk","check_terminal_non_malleable","check_witness","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","compressed","default","deref","derive","deserialize","encode","eq","eq","eq","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","for_each_key","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_public","from_secret","from_str","from_str","from_tree","full_derivation_path","full_derivation_paths","generate","generate_default","generate_with_entropy","generate_with_entropy_default","has_secret","has_wildcard","hash","hash","hash","hash","into","into","into","into","into","into","into","into","into","into","into","into","into_assets","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_descriptor_key","into_extended_key","into_extended_key","into_extended_key","into_key","into_single_keys","into_single_keys","into_xprv","into_xpub","is_deriveable","is_legacy","is_legacy","is_multipath","is_multipath","is_segwit_v0","is_segwit_v0","is_taproot","is_taproot","is_uncompressed","is_x_only_key","k","key","key","lift","mainnet_network","master_fingerprint","max_satisfaction_size","max_satisfaction_size","max_satisfaction_witness_elements","merge_networks","n","name_str","new","num_der_paths","origin","origin","other_top_level_checks","override_valid_networks","partial_cmp","partial_cmp","partial_cmp","partial_cmp","pk_len","pks","sanity_check","satisfy","script_size","serialize","sig_type","sorted_node","test_networks","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_public","to_string","to_string","to_string","to_string","top_level_checks","top_level_type_check","translate_pk","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","PsbtUtils","fee_amount","fee_rate","get_utxo_for","AddressInfo","ApplyBlockError","Balance","CannotConnect","ChangeSet","ConfirmationHeightCannotBeGreaterThanTip","Descriptor","Descriptor","Descriptor","InsertTxError","IsDust","LoadError","LoadedDescriptorDoesNotMatch","LoadedGenesisDoesNotMatch","LoadedNetworkDoesNotMatch","MissingDescriptor","MissingGenesis","MissingNetwork","NewError","NewOrLoadError","NonEmptyDatabase","NotInitialized","NotInitialized","Persist","Persist","Persist","UnexpectedConnectedToHash","Update","Wallet","add","add_signer","address","all_unbounded_spk_iters","apply_block","apply_block_connected_to","apply_unconfirmed_txs","apply_update","as_ref","balance","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","build_fee_bump","build_tx","calculate_fee","calculate_fee_rate","cancel_tx","chain","chain","checkpoints","clone","clone","clone_into","clone_into","coin_selection","commit","confirmed","default","default","deref","derivation_index","derivation_of_spk","descriptor_checksum","deserialize","eq","eq","error","export","finalize_psbt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","get_descriptor_for_keychain","get_psbt_input","get_signers","get_tx","get_utxo","graph","immature","index","indexed_tx_graph","insert_checkpoint","insert_tx","insert_txout","into","into","into","into","into","into","into","into","into","is_dust","is_mine","keychain","keychains","last_active_indices","latest_checkpoint","list_output","list_unspent","list_unused_addresses","load","local_chain","mark_used","network","network","new","new_no_persist","new_no_persist_with_genesis_hash","new_or_load","new_or_load_with_genesis_hash","new_with_genesis_hash","next_derivation_index","next_unused_address","peek_address","policies","public_descriptor","reveal_addresses_to","reveal_next_address","secp_ctx","sent_and_received","serialize","sign","signer","spk_index","staged","start_full_scan","start_sync_with_revealed_spks","to_owned","to_owned","to_string","to_string","to_string","to_string","to_string","to_string","to_string","total","transactions","trusted_pending","trusted_spendable","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tx_builder","tx_graph","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unbounded_spk_iter","unmark_used","untrusted_pending","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","wallet_name_from_descriptor","connected_to_hash","expected_hash","tip_height","tx_height","expected","expected","got","got","got","keychain","BnBNoExactMatch","BnBTotalTriesExceeded","BranchAndBoundCoinSelection","Change","CoinSelectionAlgorithm","CoinSelectionResult","DefaultCoinSelectionAlgorithm","Error","Excess","InsufficientFunds","LargestFirstCoinSelection","NoChange","OldestFirstCoinSelection","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","coin_select","coin_select","coin_select","coin_select","decide_change","default","default","default","excess","fee_amount","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","into","into","into","into","into","into","local_selected_amount","new","selected","selected_amount","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","available","needed","amount","change_fee","dust_threshold","fee","remaining_amount","BuildFeeBumpError","CoinSelection","Conversion","CreateTxError","Descriptor","FeeRateTooLow","FeeRateUnavailable","FeeTooLow","IrreplaceableTransaction","LockTime","MiniscriptPsbt","MiniscriptPsbtError","MissingKeyOrigin","MissingNonWitnessUtxo","NoRecipients","NoUtxosSelected","OutputBelowDustLimit","OutputUpdate","Persist","Policy","Psbt","RbfSequence","RbfSequenceCsv","SpendingPolicyRequired","TransactionConfirmed","TransactionNotFound","UnknownUtxo","UnknownUtxo","UtxoUpdate","Version0","Version1Csv","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","into","into","into","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","csv","rbf","requested","required","required","required","FullyNodedExport","WalletExport","blockheight","blockheight","borrow","borrow_mut","change_descriptor","descriptor","deserialize","export_wallet","fmt","fmt","from","from_str","into","label","label","serialize","to_string","try_from","try_into","type_id","vzip","All","Dummy","Exclude","External","Fingerprint","Include","InputIndexOutOfRange","InputSigner","InvalidKey","InvalidNonWitnessUtxo","InvalidSighash","Legacy","MiniscriptPsbt","MissingHdKeypath","MissingKey","MissingNonWitnessUtxo","MissingWitnessScript","MissingWitnessUtxo","NonStandardSighash","None","PkHash","Segwitv0","SighashP2wpkh","SighashTaproot","SignOptions","SignerCommon","SignerContext","SignerError","SignerId","SignerOrdering","SignerWrapper","SignersContainer","Tap","TapLeavesOptions","TransactionSigner","TxInputsIndexError","UserCanceled","add_external","allow_all_sighashes","allow_grinding","as_key_map","assume_height","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","default","default","default","default","deref","descriptor_secret_key","descriptor_secret_key","descriptor_secret_key","descriptor_secret_key","eq","eq","eq","eq","find","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","hash","id","id","id","id","ids","into","into","into","into","into","into","into","into","new","new","partial_cmp","partial_cmp","remove","remove_partial_sigs","remove_taproot_extras","sign_input","sign_input","sign_input","sign_input","sign_transaction","sign_transaction","sign_with_tap_internal_key","signers","tap_leaves_options","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","trust_witness_utxo","try_finalize","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","is_internal_key","AddForeignUtxoError","AddUtxoError","Bip69Lexicographic","ChangeAllowed","ChangeForbidden","ChangeSpendPolicy","InvalidOutpoint","InvalidTxid","MissingUtxo","OnlyChange","Shuffle","TxBuilder","TxOrdering","UnknownUtxo","Untouched","add_data","add_foreign_utxo","add_foreign_utxo_with_sequence","add_global_xpubs","add_recipient","add_unspendable","add_utxo","add_utxos","allow_dust","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","change_policy","clone","clone","clone","clone_into","clone_into","clone_into","cmp","cmp","coin_selection","current_height","default","default","do_not_spend_change","drain_to","drain_wallet","enable_rbf","enable_rbf_with_sequence","eq","eq","fee_absolute","fee_rate","finish","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","hash","hash","include_output_redeem_witness_script","into","into","into","into","into","manually_selected_only","nlocktime","only_spend_change","only_witness_utxo","ordering","partial_cmp","partial_cmp","policy_path","set_recipients","sighash","sort_tx","to_owned","to_owned","to_owned","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","unspendable","version","vzip","vzip","vzip","vzip","vzip","foreign_utxo","input_txid"],"q":[[0,"bdk_wallet"],[97,"bdk_wallet::Utxo"],[100,"bdk_wallet::descriptor"],[352,"bdk_wallet::descriptor::checksum"],[354,"bdk_wallet::descriptor::error"],[386,"bdk_wallet::descriptor::policy"],[533,"bdk_wallet::descriptor::policy::BuildSatisfaction"],[536,"bdk_wallet::descriptor::policy::Satisfaction"],[547,"bdk_wallet::descriptor::policy::SatisfiableItem"],[557,"bdk_wallet::descriptor::template"],[693,"bdk_wallet::keys"],[992,"bdk_wallet::psbt"],[996,"bdk_wallet::wallet"],[1219,"bdk_wallet::wallet::ApplyBlockError"],[1221,"bdk_wallet::wallet::InsertTxError"],[1223,"bdk_wallet::wallet::NewOrLoadError"],[1229,"bdk_wallet::wallet::coin_selection"],[1321,"bdk_wallet::wallet::coin_selection::Error"],[1323,"bdk_wallet::wallet::coin_selection::Excess"],[1328,"bdk_wallet::wallet::error"],[1400,"bdk_wallet::wallet::error::CreateTxError"],[1406,"bdk_wallet::wallet::export"],[1429,"bdk_wallet::wallet::signer"],[1612,"bdk_wallet::wallet::signer::SignerContext"],[1613,"bdk_wallet::wallet::tx_builder"],[1728,"bdk_wallet::wallet::tx_builder::AddForeignUtxoError"],[1730,"bdk_wallet::types"],[1731,"core::cmp"],[1732,"core::result"],[1733,"serde::de"],[1734,"core::fmt"],[1735,"core::hash"],[1736,"bitcoin::blockdata::transaction"],[1737,"core::option"],[1738,"serde::ser"],[1739,"core::any"],[1740,"miniscript::descriptor"],[1741,"bitcoin::network"],[1742,"bitcoin::address"],[1743,"miniscript"],[1744,"miniscript::miniscript"],[1745,"miniscript::miniscript::decode"],[1746,"miniscript::miniscript::context"],[1747,"miniscript::iter::tree"],[1748,"miniscript::descriptor::key"],[1749,"alloc::vec"],[1750,"miniscript::miniscript::satisfy"],[1751,"miniscript::plan"],[1752,"bitcoin_hashes::sha256"],[1753,"miniscript::miniscript::hash256"],[1754,"bitcoin_hashes::ripemd160"],[1755,"bitcoin_hashes::hash160"],[1756,"core::clone"],[1757,"secp256k1"],[1758,"bitcoin::crypto::key"],[1759,"secp256k1::context"],[1760,"bdk_chain::descriptor_ext"],[1761,"miniscript::blanket_traits"],[1762,"bitcoin::blockdata::script::owned"],[1763,"miniscript::miniscript::analyzable"],[1764,"secp256k1::context::alloc_only"],[1765,"bitcoin::blockdata::script::borrowed"],[1766,"core::ops::range"],[1767,"core::ops::function"],[1768,"miniscript::descriptor::tr"],[1769,"miniscript::descriptor::bare"],[1770,"miniscript::descriptor::sh"],[1771,"miniscript::descriptor::segwitv0"],[1772,"miniscript::miniscript::types"],[1773,"miniscript::miniscript::types::extra_props"],[1774,"miniscript::expression"],[1775,"miniscript::miniscript::iter"],[1776,"miniscript::policy::semantic"],[1777,"miniscript::policy"],[1778,"bitcoin_units::weight"],[1779,"alloc::collections::btree::map"],[1780,"alloc::string"],[1781,"bitcoin::bip32"],[1782,"hex_conservative::error"],[1783,"base58ck::error"],[1784,"miniscript::descriptor::sortedmulti"],[1785,"core::str::traits"],[1786,"core::convert"],[1787,"core::default"],[1788,"bitcoin_units::amount"],[1789,"bitcoin_units::fee_rate"],[1790,"bdk_chain::keychain"],[1791,"alloc::sync"],[1792,"core::iter::traits::iterator"],[1793,"bitcoin::blockdata::block"],[1794,"bdk_chain::local_chain"],[1795,"bdk_chain::chain_data"],[1796,"core::iter::traits::collect"],[1797,"bdk_chain::tx_graph"],[1798,"anyhow"],[1799,"bitcoin::psbt"],[1800,"bdk_chain::spk_client"],[1801,"bitcoin::psbt::map::input"],[1802,"bdk_wallet::wallet::utils"],[1803,"core::iter::traits::double_ended"],[1804,"bdk_persist::persist"],[1805,"core::marker"],[1806,"bdk_chain::keychain::txout_index"],[1807,"bitcoin::psbt::error"],[1808,"bitcoin::crypto::sighash"],[1809,"bitcoin::blockdata::script::push_bytes::primitive"],[1810,"bitcoin::blockdata::locktime::absolute"]],"i":[1,8,0,1,0,8,0,0,0,0,0,0,1,1,0,1,6,7,8,1,6,7,8,0,1,6,7,8,1,6,7,8,1,6,6,0,0,1,6,1,6,7,8,1,6,7,8,0,1,6,7,8,1,6,1,6,7,8,6,6,0,0,8,6,1,0,7,8,1,6,0,0,1,6,7,8,1,6,7,8,1,6,7,8,8,6,1,6,7,8,7,0,1,6,7,8,0,253,253,253,94,254,24,0,0,0,0,0,0,31,0,0,33,0,0,35,94,254,24,0,0,0,94,254,24,35,31,0,94,254,24,94,254,24,94,254,24,35,24,54,55,31,31,24,24,54,55,31,24,54,55,31,31,31,31,0,33,54,55,33,55,33,33,54,55,33,54,55,33,33,54,55,33,54,55,33,54,55,0,24,54,55,31,24,54,55,31,24,54,55,31,31,24,24,24,24,24,24,31,24,31,24,54,55,31,0,24,31,31,69,24,31,24,24,24,54,55,31,31,24,31,24,24,24,24,24,24,24,54,55,31,31,31,24,31,31,31,24,31,31,31,24,24,31,31,24,24,54,55,31,24,54,55,31,31,24,93,94,24,24,31,31,31,24,31,31,33,54,55,31,24,31,24,33,54,55,24,24,24,24,24,24,24,24,24,24,24,24,24,24,31,33,31,24,31,31,24,54,55,31,33,54,55,24,24,0,31,24,31,24,31,31,24,24,31,24,31,33,54,55,31,0,24,54,55,31,24,31,24,33,33,24,31,24,54,55,31,24,54,55,31,31,24,54,55,31,24,24,54,55,31,31,0,0,74,74,0,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,121,115,115,0,122,0,0,121,120,0,121,121,115,115,115,121,122,71,115,122,122,0,0,0,71,71,120,121,121,0,0,121,121,121,120,120,121,122,73,123,115,71,120,121,122,73,123,115,71,120,121,122,73,123,71,120,121,122,73,123,71,73,123,123,120,121,122,73,123,115,120,121,122,73,123,115,115,71,120,121,122,122,73,73,123,115,71,73,120,123,121,73,120,121,122,73,123,115,71,121,122,123,73,123,73,73,120,121,122,73,123,123,120,121,122,73,123,71,115,120,121,122,73,123,115,71,120,121,122,73,123,115,71,120,121,122,73,123,115,71,120,121,122,73,123,115,71,255,255,255,256,257,258,257,258,257,258,257,258,257,258,259,260,261,262,263,264,264,263,265,266,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126,128,129,130,132,134,135,136,137,138,139,140,126,128,129,130,132,134,135,136,137,138,139,140,124,126,128,129,130,132,134,135,136,137,138,139,140,126,128,129,130,132,134,135,136,137,138,139,140,126,128,129,130,132,134,135,136,137,138,139,140,125,126,128,129,130,132,134,135,136,137,138,139,140,126,128,129,130,132,134,135,136,137,138,139,140,126,128,129,130,132,134,135,136,137,138,139,140,126,128,129,130,132,134,135,136,137,138,139,140,126,128,129,130,132,134,135,136,137,138,139,140,114,0,0,0,0,158,158,0,0,147,0,0,0,0,114,114,114,33,0,0,30,114,114,103,35,158,151,0,151,0,0,30,35,103,0,0,0,0,30,0,147,103,35,0,267,35,151,143,148,30,144,114,142,35,103,145,146,147,151,143,148,30,144,114,142,35,103,145,146,147,142,33,33,33,33,33,33,33,33,33,143,30,144,142,35,103,145,146,147,143,30,144,142,35,103,145,146,147,142,35,145,147,144,144,143,35,35,142,30,142,35,103,145,146,147,148,30,144,114,114,142,142,35,35,103,103,145,146,147,142,151,151,151,143,148,30,144,114,114,114,142,35,35,103,145,146,147,148,148,35,103,142,35,35,158,161,158,161,151,35,142,35,145,147,151,143,148,30,144,114,142,35,103,145,146,147,35,127,133,143,143,148,35,103,133,151,143,143,35,103,151,151,35,267,30,35,103,267,30,267,30,35,35,142,145,146,142,0,35,33,142,142,0,142,33,142,35,145,146,33,148,142,35,145,147,33,142,142,142,142,35,33,142,0,143,30,144,142,35,103,145,146,147,103,114,142,35,103,33,33,142,151,143,148,30,144,114,142,35,103,145,146,147,151,143,148,30,144,114,142,35,103,145,146,147,151,143,148,30,144,114,142,35,103,145,146,147,151,143,148,30,144,114,142,35,103,145,146,147,0,166,166,166,0,0,0,201,0,200,197,198,199,0,0,0,199,199,199,198,198,198,0,0,197,198,199,197,198,199,201,0,0,169,170,193,170,170,170,170,170,170,170,169,170,182,193,197,198,199,200,201,169,170,182,193,197,198,199,200,201,170,170,170,170,170,213,182,170,169,182,169,182,0,170,169,169,182,193,170,170,170,169,169,193,0,0,170,169,169,170,182,193,193,197,197,198,198,199,199,200,200,201,201,169,170,182,182,182,193,197,198,199,200,201,170,170,170,170,170,182,169,193,213,170,170,170,169,170,182,193,197,198,199,200,201,210,170,193,170,182,170,170,170,170,170,170,170,170,213,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,169,170,0,170,170,170,170,169,182,169,193,197,198,199,200,201,169,170,169,169,169,170,182,193,197,198,199,200,201,169,170,182,193,197,198,199,200,201,0,170,169,170,182,193,197,198,199,200,201,170,170,169,169,170,182,193,197,198,199,200,201,0,268,268,269,269,270,271,270,271,272,272,227,227,0,228,0,0,0,0,0,227,0,228,0,227,228,226,222,223,224,227,228,226,222,223,224,222,223,224,222,223,224,225,222,223,224,0,222,223,224,226,226,227,227,228,226,222,223,224,227,228,226,222,223,224,227,228,226,222,223,224,226,224,226,226,222,223,224,227,227,228,226,222,223,224,227,228,226,222,223,224,227,228,226,222,223,224,227,228,226,222,223,224,273,273,274,275,275,274,275,0,206,229,0,206,206,189,206,189,206,206,0,206,206,206,206,206,229,206,206,206,206,206,206,189,189,206,189,229,206,206,229,206,189,229,206,189,229,229,229,229,206,206,189,189,229,206,206,206,206,206,206,189,229,206,189,229,229,206,189,229,206,189,229,206,189,229,206,189,229,206,189,276,276,277,277,278,279,0,0,280,231,231,231,231,231,231,231,231,231,231,231,231,280,231,231,231,231,231,231,231,236,232,236,196,232,236,196,0,196,196,196,233,196,196,196,196,196,196,196,236,232,233,196,196,0,0,0,0,0,0,0,0,233,0,0,196,196,70,195,195,70,195,232,196,233,234,171,70,195,236,232,196,233,234,171,70,195,236,70,232,233,234,171,70,195,236,232,233,234,171,70,195,236,232,171,171,70,195,236,234,237,234,234,234,232,233,171,236,70,232,196,196,233,234,171,70,195,236,232,232,232,196,196,196,196,233,234,171,70,195,236,232,237,234,234,234,70,232,196,233,234,171,70,195,236,234,70,232,171,70,195,195,244,234,234,234,172,234,195,70,195,232,233,234,171,70,195,236,196,195,195,232,196,233,234,171,70,195,236,232,196,233,234,171,70,195,236,232,196,233,234,171,70,195,236,232,196,233,234,171,70,195,236,281,0,0,250,249,249,0,247,247,247,249,250,0,0,248,250,188,188,188,188,188,188,188,188,188,188,248,247,250,249,188,248,247,250,249,188,188,250,249,188,250,249,250,249,188,188,250,249,188,188,188,188,188,250,249,188,188,188,188,248,248,247,247,250,249,188,248,247,250,249,250,249,188,188,248,247,250,249,188,188,188,188,188,250,249,188,188,188,250,188,250,249,248,247,188,248,247,250,249,188,248,247,250,249,188,248,247,250,249,188,188,188,248,247,250,249,282,282],"f":"````````````{{{d{b}}}f}{{{d{b}}}{{d{{h{f}}}}}}`{{{d{c}}}{{d{e}}}{}{}}000{{{d{jc}}}{{d{je}}}{}{}}000`{{{d{b}}}b}{{{d{l}}}l}{{{d{n}}}n}{{{d{A`}}}A`}{{{d{c}}{d{je}}}Ab{}{}}000{{{d{b}}{d{b}}}Ad}````{c{{Af{b}}}Ah}{c{{Af{l}}}Ah}{{{d{b}}{d{b}}}Aj}{{{d{l}}{d{l}}}Aj}{{{d{n}}{d{n}}}Aj}{{{d{A`}}{d{A`}}}Aj}{{{d{b}}{d{jAl}}}An}{{{d{l}}{d{jAl}}}An}{{{d{n}}{d{jAl}}}An}{{{d{A`}}{d{jAl}}}An}`{cc{}}000{{{d{b}}{d{jc}}}AbB`}{{{d{l}}{d{jc}}}AbB`}{ce{}{}}000````{{{d{A`}}}Bb}`{{{d{b}}{d{b}}}{{Bd{Ad}}}}``{{{d{A`}}}{{Bd{Bf}}}}{{{d{b}}c}AfBh}{{{d{l}}c}AfBh}``{{{d{c}}}e{}{}}000{c{{Af{e}}}{}{}}0000000{{{d{A`}}}{{d{Bj}}}}`{{{d{c}}}Bl{}}000`{{}{{d{Bn}}}}::::``````````````````````````````````````````{{{d{{C`{c}}}}Cb}{{Af{CdCf}}}{ChCj}}{{}Cl}0{{{d{{Cn{ce}}}}}{{d{{D`{ce}}}}}ChDb}{{{d{{d{{Cn{ce}}}}}}}{{Dd{{d{{Cn{ce}}}}}}}ChDb}{{{d{{C`{Df}}}}Dh}{{Af{{C`{Dj}}Dl}}}}{{{d{c}}}{{d{e}}}{}{}}000{{{d{jc}}}{{d{je}}}{}{}}000{{{d{{Cn{ce}}}}}{{Dn{{d{{Cn{ce}}}}}}}ChDb}{{{d{{Cn{ce}}}}{d{g}}}{{Eb{{E`{c}}}}}{CjCh}Db{{Ed{c}}}}0`{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbEh}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}{{{d{{Cn{cFl}}}}}{{Af{AbEh}}}Ch}{{{d{{Cn{cFn}}}}}{{Af{AbEh}}}Ch}2022102102{{{d{c}}}{{Af{AbEh}}}Ch}00{{{d{{D`{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbEh}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}{{{d{{D`{cFl}}}}}{{Af{AbEh}}}Ch}{{{d{{D`{cFn}}}}}{{Af{AbEh}}}Ch}{{{d{{h{{Dn{f}}}}}}}{{Af{AbEh}}}}00`{{{d{{C`{c}}}}}{{C`{c}}}{G`Ch}}{{{d{Fl}}}Fl}{{{d{Fn}}}Fn}{{{d{{Cn{ce}}}}}{{Cn{ce}}}{G`Ch}{G`Db}}{{{d{c}}{d{je}}}Ab{}{}}000{{{d{{C`{c}}}}{d{{C`{c}}}}}Ad{GbCh}}{{{d{Fl}}{d{Fl}}}Ad}{{{d{Fn}}{d{Fn}}}Ad}{{{d{{Cn{ce}}}}{d{{Cn{ce}}}}}AdChDb}{{{d{{Cn{ce}}}}}AjChDb}{{{d{{C`{Df}}}}Dh}{{Af{{C`{Dj}}Dl}}}}{{{d{{C`{Df}}}}{d{{Gd{c}}}}Dh}{{Af{{C`{Gf}}Dl}}}Gh}{{{d{{C`{Dj}}}}{d{{Gd{c}}}}}{{Af{{C`{Gf}}Dl}}}Gh}{{{d{{C`{c}}}}}GjCh}{{{d{{C`{Df}}}}}Gl}{c{{Af{{C`{e}}}}}AhGn}{c{{Af{{Cn{eg}}}}}AhGnDb}{{{d{{C`{Df}}}}}H`}{{{d{{Cn{ce}}}}}Hb{CjCh}Db}{{{d{{C`{c}}}}{d{{C`{c}}}}}Aj{HdCh}}{{{d{Fl}}{d{Fl}}}Aj}{{{d{Fn}}{d{Fn}}}Aj}{{{d{{Cn{ce}}}}{d{{Cn{ce}}}}}AjChDb}`{{{d{{C`{c}}}}}{{Af{HbCf}}}{ChCj}}`{{{d{{Cn{ce}}}}{d{Hf}}}{{Af{AbHh}}}ChDb}{{{d{Hj}}{d{Hl}}Hn{d{{Gd{I`}}}}}{{Af{{Bd{Ib}}Id}}}}{{{d{{C`{Df}}}}{d{Hl}}Hn{d{{Gd{I`}}}}}{{Af{{Bd{Ib}}Id}}}}{{{d{{Cn{Dfc}}}}{d{Hl}}Hn{d{{Gd{I`}}}}}{{Af{{Bd{Ib}}Id}}}Db}{{{d{{C`{Df}}}}{d{{Gd{c}}}}{d{If}}{Ih{Dh}}}{{Af{{Bd{{Ij{Dh{C`{Gf}}}}}}Dl}}}Gh}{{{d{{C`{c}}}}{d{jAl}}}{{Af{AbIl}}}Ch}0{{{d{Fl}}{d{jAl}}}{{Af{AbIl}}}}{{{d{Fn}}{d{jAl}}}{{Af{AbIl}}}}{{{d{{Cn{ce}}}}{d{jAl}}}{{Af{AbIl}}}ChDb}0{{{d{{C`{c}}}}e}AjCh{{J`{{d{c}}}{{In{Aj}}}}}}{{{d{{Cn{ce}}}}g}AjChDb{{J`{{d{c}}}{{In{Aj}}}}}}{{{Jb{c}}}{{C`{c}}}Ch}{{{Jd{c}}}{{C`{c}}}Ch}{{{Jf{c}}}{{C`{c}}}Ch}{{{Jh{c}}}{{C`{c}}}Ch}{{{Jj{c}}}{{C`{c}}}Ch}{{{Jl{c}}}{{C`{c}}}Ch}{cc{}}000{{{D`{ce}}}{{Af{{Cn{ce}}Cf}}}ChDb}{{{D`{ce}}JnK`}{{Cn{ce}}}ChDb}{{{d{Bn}}}{{Af{{C`{c}}Cf}}}Gn}{{{d{Bn}}}{{Af{{Cn{ce}}Cf}}}GnDb}{{{d{Bn}}{d{Hf}}}{{Af{{Cn{ce}}Cf}}}GnDb}1{{{d{Kb}}}{{Af{{C`{c}}Cf}}}Gn}{{{d{Kb}}}{{Af{{Cn{ce}}Cf}}}GnDb}{{{d{{Cn{ce}}}}Kd}{{Bd{{d{{Cn{ce}}}}}}}ChDb}{{{d{{Cn{ce}}}}Kd}{{Bd{c}}}ChDb}{{{d{{C`{c}}}}e}{{Af{{Ij{{Dn{{Dn{f}}}}Hb}}Cf}}}{ChCj}{{Kf{c}}}}0{{{d{{Cn{ce}}}}}AjChDb}0{{{d{{C`{Df}}}}}Aj}{{{d{{C`{c}}}}{d{je}}}Ab{KhCh}B`}{{{d{Fl}}{d{jc}}}AbB`}{{{d{Fn}}{d{jc}}}AbB`}{{{d{{Cn{ce}}}}{d{jg}}}AbChDbB`}{ce{}{}}000{{{Cn{ce}}}{{D`{ce}}}ChDb}{{{C`{Df}}}{{Af{{Dn{{C`{Df}}}}Cf}}}}{{Kj{d{{Gd{I`}}}}Cb}{{Af{{Ij{KlKn}}Id}}}}{{Kl{d{{Gd{I`}}}}Cb}{{Af{{Ij{KlKn}}Id}}}}99:{{{d{{Cn{ce}}}}}{{L`{ce}}}ChDb}{{{d{{Cn{ce}}}}}{{Lb{ce}}}ChDb}{{{d{{C`{c}}}}}{{Af{{Ld{c}}Cf}}}Ch}{{{d{{Cn{ce}}}}}{{Af{{Ld{c}}Cf}}}ChDb}{{{d{{Cn{ce}}}}}{{Af{AbLf}}}ChDb}{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Bd{Kd}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}{{{d{{Cn{cFl}}}}}{{Bd{Kd}}}Ch}{{{d{{Cn{cFn}}}}}{{Bd{Kd}}}Ch}{{{d{{Cn{ce}}}}}{{Af{KdCf}}}ChDb}{{{d{{C`{c}}}}}{{Af{KdCf}}}Ch}1{{{d{{C`{c}}}}}{{Af{LhCf}}}Ch}{{}{{d{Bn}}}}00{{{Cn{cLj}}}{{Af{{C`{c}}Cf}}}Ch}{c{{C`{c}}}Ch}{c{{Af{{C`{c}}Cf}}}Ch}{{{Cn{cFl}}}{{Af{{C`{c}}Cf}}}Ch}{{Kd{Dn{c}}}{{Af{{C`{c}}Cf}}}Ch}{{{Jl{c}}}{{C`{c}}}Ch}{{{Jj{c}}}{{C`{c}}}Ch}4{{{Cn{cFn}}}{{Af{{C`{c}}Cf}}}Ch}3{{c{Bd{{Ll{c}}}}}{{Af{{C`{c}}Cf}}}Ch}614`{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbCf}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}{{{d{If}}}{{Af{{Cn{c}}Cf}}}Db}{{{d{{Gd{c}}}}{d{Bn}}}{{Af{{Ij{{C`{Df}}{M`{DfLn}}}}Cf}}}Mb}1{{{d{If}}{d{Hf}}}{{Af{{Cn{c}}Cf}}}Db}{{{d{{C`{c}}}}{d{{C`{c}}}}}{{Bd{Ad}}}{MdCh}}{{{d{Fl}}{d{Fl}}}{{Bd{Ad}}}}{{{d{Fn}}{d{Fn}}}{{Bd{Ad}}}}{{{d{{Cn{ce}}}}{d{{Cn{ce}}}}}{{Bd{Ad}}}ChDb}{{{d{c}}}KdCh}00{{{C`{Dj}}{d{c}}}{{Af{Mf{C`{Dj}}}}}{{Ed{Dj}}}}0`{{{d{{Cn{ce}}}}}AjChDb}{{{d{{C`{c}}}}}{{Af{AbCf}}}Ch}{{{d{{Cn{ce}}}}}{{Af{AbHh}}}ChDb}{{{d{{C`{c}}}}{d{jMh}}e}{{Af{AbCf}}}{ChCj}{{Kf{c}}}}{{{d{{Cn{ce}}}}g}{{Af{{Dn{{Dn{f}}}}Cf}}}{CjCh}Db{{Kf{c}}}}0{{{d{{C`{c}}}}}{{Af{HbCf}}}{ChCj}}{{{d{{C`{c}}}}}Hb{ChCj}}{{{d{{Cn{ce}}}}}KdChDb}{{{d{{C`{c}}}}e}AfChBh}{{{d{{Cn{ce}}}}g}AfChDbBh}{{}Mj}00{{{d{{Cn{ce}}}}{d{{M`{Fhc}}}}}{{Cn{ce}}}ChDb}`{{{d{c}}}e{}{}}000{{{d{c}}}Ml{}}0{{{d{{C`{Df}}}}{d{{M`{DfLn}}}}}Ml}{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbCf}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}0{{{d{{C`{c}}}}{d{ji}}}{{Af{{Mn{g}}}}}ChCh{}{{N`{ceg}}}}{{{d{{Cn{ce}}}}{d{jk}}}{{Af{{Mn{i}}}}}ChDbCh{}{{N`{cgi}}}}{c{{Af{e}}}{}{}}0000000`{{{d{c}}}Bl{}}000={ce{}{}}000{{{d{{Cn{ce}}}}}AjChDb}{{{d{Bn}}}{{Af{MlId}}}}{{{d{Bn}}}{{Af{{Nb{f}}Id}}}}``````````````{{{d{c}}}{{d{e}}}{}{}}{{{d{jc}}}{{d{je}}}{}{}}{{{d{Id}}{d{jAl}}}An}0{NdId}{NfId}{NhId}{NjId}{CfId}{NlId}{cc{}}{NnId}>{{{d{c}}}Ml{}}{c{{Af{e}}}{}{}}0{{{d{c}}}Bl{}}{ce{}{}}```````````````````````````````````>>>>>>>======={{{d{O`}}}O`}{{{d{Ob}}}Ob}{{{d{Od}}}Od}{{{d{Ib}}}Ib}{{{d{Of}}}Of}{{{d{Hn}}}Hn}{{{d{c}}{d{je}}}Ab{}{}}00000``{{}Of}{{{d{O`}}{d{O`}}}Aj}{{{d{Ob}}{d{Ob}}}Aj}{{{d{Od}}{d{Od}}}Aj}{{{d{Ib}}{d{Ib}}}Aj}{{{d{Of}}{d{Of}}}Aj}{{{d{Nf}}{d{Nf}}}Aj}{{{d{O`}}{d{jAl}}}An}{{{d{Ob}}{d{jAl}}}An}{{{d{Od}}{d{jAl}}}An}{{{d{Ib}}{d{jAl}}}An}{{{d{Of}}{d{jAl}}}An}{{{d{Nf}}{d{jAl}}}An}0{{{d{Hn}}{d{jAl}}}An}{cc{}}0{AjOd}1{ObIb}2222{{{d{Ib}}{d{{M`{Ml{Dn{Kd}}}}}}}{{Af{OfNf}}}}{{{d{O`}}{d{jc}}}AbB`}{{{d{Of}}{d{jc}}}AbB`}{{{d{Ob}}}Ml}`{ce{}{}}000000{{{d{Ob}}}Aj}{{{d{Od}}}Aj}{{{d{Of}}}Aj}`{{{d{Of}}{d{Of}}}{{Bd{Ad}}}}{{{d{Ib}}}Aj}`{{{d{O`}}c}AfBh}{{{d{Ob}}c}AfBh}{{{d{Od}}c}AfBh}{{{d{Ib}}c}AfBh}{{{d{Of}}c}AfBh}`{{{d{c}}}e{}{}}00000{{{d{c}}}Ml{}}{c{{Af{e}}}{}{}}0000000000000{{{d{c}}}Bl{}}000000>>>>>>>``````````````````````````````````````{{{d{c}}}{{d{e}}}{}{}}00000000000{{{d{jc}}}{{d{je}}}{}{}}00000000000{{OhCb}{{Af{OjId}}}}{{{Ol{c}}Cb}{{Af{OjId}}}{{On{Fl}}}}{{{A@`{c}}Cb}{{Af{OjId}}}{{On{Fn}}}}{{{A@b{c}}Cb}{{Af{OjId}}}{{On{Fn}}}}{{{A@d{c}}Cb}{{Af{OjId}}}{{On{A@f}}}}{{{A@h{c}}Cb}{{Af{OjId}}}{{A@j{Fl}}}}{{{A@l{c}}Cb}{{Af{OjId}}}{{A@j{Fl}}}}{{{A@n{c}}Cb}{{Af{OjId}}}{{A@j{Fn}}}}{{{AA`{c}}Cb}{{Af{OjId}}}{{A@j{Fn}}}}{{{AAb{c}}Cb}{{Af{OjId}}}{{A@j{Fn}}}}{{{AAd{c}}Cb}{{Af{OjId}}}{{A@j{Fn}}}}{{{AAf{c}}Cb}{{Af{OjId}}}{{A@j{A@f}}}}{{{AAh{c}}Cb}{{Af{OjId}}}{{A@j{A@f}}}}{cc{}}00000000000{ce{}{}}00000000000{{Oj{d{{Gd{I`}}}}Cb}{{Af{{Ij{KlKn}}Id}}}}{{c{d{{Gd{I`}}}}Cb}{{Af{{Ij{{C`{Df}}{M`{DfLn}}}}Id}}}{}}00000000000{c{{Af{e}}}{}{}}00000000000000000000000{{{d{c}}}Bl{}}00000000000444444444444```````````````````````````````````````````{{}AAj}{{}Cl}{{DfDh}{{Af{DjDl}}}}{{{d{c}}}{{d{e}}}{}{}}00000000000{{{d{jc}}}{{d{je}}}{}{}}00000000000{{{d{{AAl{ce}}}}{d{g}}}{{Eb{{E`{c}}}}}{CjCh}Db{{Ed{c}}}}{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbEh}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}00000{{{d{c}}}{{Af{AbEh}}}Ch}{{{d{{D`{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbEh}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}{{{d{{h{{Dn{f}}}}}}}{{Af{AbEh}}}}{{{d{{AAn{ce}}}}}{{AAn{ce}}}G`Db}{{{d{Cl}}}Cl}{{{d{AB`}}}AB`}{{{d{{AAl{ce}}}}}{{AAl{ce}}}{G`Ch}{G`Db}}{{{d{Df}}}Df}{{{d{Ln}}}Ln}{{{d{ABb}}}ABb}{{{d{ABd}}}ABd}{{{d{ABf}}}ABf}{{{d{c}}{d{je}}}Ab{}{}}00000000{{{d{{AAl{ce}}}}{d{{AAl{ce}}}}}Ad{GbCh}{GbDb}}{{{d{Df}}{d{Df}}}Ad}{{{d{ABb}}{d{ABb}}}Ad}{{{d{ABf}}{d{ABf}}}Ad}`{{}AB`}{{{d{{AAn{ce}}}}}{{d{g}}}{}Db{}}{{DfDh}{{Af{DjDl}}}}{c{{Af{Df}}}Ah}{{{d{{AAl{ce}}}}}Hb{CjCh}Db}{{{d{Cl}}{d{Cl}}}Aj}{{{d{{AAl{ce}}}}{d{{AAl{ce}}}}}Aj{HdCh}{HdDb}}{{{d{Df}}{d{Df}}}Aj}{{{d{Ln}}{d{Ln}}}Aj}{{{d{ABb}}{d{ABb}}}Aj}{{{d{ABd}}{d{ABd}}}Aj}{{{d{ABf}}{d{ABf}}}Aj}{{{d{{ABh{c}}}}{d{jAl}}}An{ABjDb}}{{{d{Cl}}{d{jAl}}}An}{{{d{AB`}}{d{jAl}}}An}{{{d{Nd}}{d{jAl}}}An}0{{{d{{AAl{ce}}}}{d{jAl}}}{{Af{AbIl}}}ChDb}0{{{d{Df}}{d{jAl}}}{{Af{AbIl}}}}0{{{d{Ln}}{d{jAl}}}{{Af{AbIl}}}}0{{{d{ABb}}{d{jAl}}}{{Af{AbIl}}}}{{{d{ABd}}{d{jAl}}}{{Af{AbIl}}}}{{{d{ABf}}{d{jAl}}}{{Af{AbIl}}}}{{{d{{AAl{ce}}}}g}AjChDb{{J`{{d{c}}}{{In{Aj}}}}}}{ABl{{ABn{c}}}Db}{cc{}}{AC`{{ABn{c}}}Db}1111{CfNd}{NhNd}33{DjDf}44444{{DfAAj}{{ABh{c}}}Db}{{LnAAj}{{ABh{c}}}Db}{{{d{Bn}}}{{Af{Df}}}}{{{d{Bn}}}{{Af{Ln}}}}{{{d{Kb}}}{{Af{{AAl{ce}}Cf}}}{ACbCh}Db}{{{d{Df}}}{{Bd{ACd}}}}{{{d{Df}}}{{Dn{ACd}}}}{c{{Af{{AAn{{ACl{}{{ACf{e}}{ACh{c}}{ACj{g}}}}i}}g}}}{}{{ACn{{h{f}}}}AD`}ABjDb}{{}{{Af{{AAn{ADbc}}e}}}Db{}}{{ce}{{Af{{AAn{{ACl{}{{ACf{e}}{ACh{c}}{ACj{g}}}}i}}g}}}{}{{ACn{{h{f}}}}AD`}ABjDb}{c{{Af{{AAn{ADbe}}g}}}{}Db{}}{{{d{{ABn{c}}}}}AjDb}{{{d{Df}}}Aj}{{{d{{AAl{ce}}}}{d{jg}}}Ab{KhCh}{KhDb}B`}{{{d{Df}}{d{jc}}}AbB`}{{{d{ABb}}{d{jc}}}AbB`}{{{d{ABf}}{d{jc}}}AbB`}{ce{}{}}00000000000{DfADd}{On{{Af{{ABh{c}}Nd}}}Db}{{A@j{Bd{ADf}}ACd}{{Af{{ABh{c}}Nd}}}Db}{{{AAn{ec}}{Bd{ADf}}ACd}{{Af{{ABh{c}}Nd}}}Db{{A@j{c}}}}{{{AAn{ec}}}{{Af{{ABh{c}}Nd}}}Db{{On{c}}}}{{{ABh{c}}}{{Af{{ABh{c}}Nd}}}Db}{Df{{Af{{ABh{c}}Nd}}}Db}{Ln{{Af{{ABh{c}}Nd}}}Db}{A@j{{Af{{ABn{c}}Nd}}}Db}{{{ABn{c}}}{{Af{{ABn{c}}Nd}}}Db}{{{AAn{ec}}}{{Af{{ABn{c}}Nd}}}Db{{A@j{c}}}}{{{AAn{ce}}}c{}Db}{Df{{Dn{Df}}}}{Ln{{Dn{Ln}}}}{{{ABn{c}}Cb}{{Bd{AC`}}}Db}{{{ABn{c}}Cb{d{{Gd{e}}}}}ABlDbMb}{{{d{Df}}}Aj}{{}Aj}{{{d{Cl}}}Aj}2{{{d{Ln}}}Aj}212133{{{d{{AAl{ce}}}}}KdChDb}``{{{d{{AAl{ce}}}}}{{Af{{Ld{c}}Cf}}}ChDb}{{}AAj}{{{d{Df}}}ADh}{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Bd{Kd}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}44{{{d{AAj}}{d{AAj}}}AAj}5{{}{{d{Bn}}}}{{Kd{Dn{c}}}{{Af{{AAl{ce}}Cf}}}ChDb}{{{d{Df}}}Kd}``{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbCf}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}{{{ABh{c}}AAj}{{ABh{c}}}Db}{{{d{{AAl{ce}}}}{d{{AAl{ce}}}}}{{Bd{Ad}}}{MdCh}{MdDb}}{{{d{Df}}{d{Df}}}{{Bd{Ad}}}}{{{d{ABb}}{d{ABb}}}{{Bd{Ad}}}}{{{d{ABf}}{d{ABf}}}{{Bd{Ad}}}}{{{d{c}}}KdCh}{{{d{{AAl{ce}}}}}{{d{{h{c}}}}}ChDb}{{{d{{AAl{ce}}}}}{{Af{AbCf}}}ChDb}{{{d{{AAl{ce}}}}g}{{Af{{Dn{{Dn{f}}}}Cf}}}{CjCh}Db{{Kf{c}}}}{{{d{{AAl{ce}}}}}KdChDb}{{{d{Df}}c}AfBh}{{}Mj}{{{d{{AAl{ce}}}}}{{D`{ce}}}{CjCh}Db}{{}AAj}{{{d{c}}}e{}{}}00000000{{{d{Ln}}{d{{Gd{c}}}}}{{Af{DfADj}}}Mb}{{{d{c}}}Ml{}}000{{{d{{Cn{c{Db{}{{Ef{e}}}}}}}}}{{Af{AbCf}}}Ch{{Fj{}{{Ej{El}}{En{F`}}{Fb{Fd}}{Ff{Fh}}}}ChChChCh}}0{{{d{{AAl{ce}}}}{d{jk}}}{{Af{{AAl{ge}}{Mn{i}}}}}ChDbCh{}{{N`{cgi}}}}{c{{Af{e}}}{}{}}00000000000000000000000{{{d{c}}}Bl{}}00000000000{ce{}{}}00000000000`{{{d{ADl}}}{{Bd{ADn}}}}{{{d{ADl}}}{{Bd{AE`}}}}{{{d{ADl}}Kd}{{Bd{Bj}}}}`````````````````````````````{{AEbAEb}AEb}{{{d{jAEd}}bAEf{AEj{AEh}}}Ab}`{{{d{AEd}}}{{M`{b{`{{AEn{}{{AEl{{Ij{DhHb}}}}}}G`}}}}}}{{{d{jAEd}}{d{AF`}}Dh}{{Af{AbAFb}}}}{{{d{jAEd}}{d{AF`}}DhAFd}{{Af{AbAFf}}}}{{{d{jAEd}}c}Ab{{AFj{}{{AEl{{Ij{{d{AFh}}H`}}}}}}}}{{{d{jAEd}}c}{{Af{AbAFb}}}{{AFn{AFl}}}}{{{d{AEd}}}{{d{{AGb{AG`}}}}}}{{{d{AEd}}}AEb}{{{d{c}}}{{d{e}}}{}{}}00000000{{{d{jc}}}{{d{je}}}{}{}}00000000{{{d{jAEd}}AGd}{{Af{{AGh{AGf}}AGj}}}}{{{d{jAEd}}}{{AGh{AGf}}}}{{{d{AEd}}{d{AFh}}}{{Af{ADnAGl}}}}{{{d{AEd}}{d{AFh}}}{{Af{AE`AGl}}}}{{{d{jAEd}}{d{AFh}}}Ab}``{{{d{AEd}}}AGn}{{{d{AEb}}}AEb}{{{d{AFl}}}AFl}{{{d{c}}{d{je}}}Ab{}{}}0`{{{d{jAEd}}}{{AH`{Aj}}}}`{{}AEb}{{}AFl}{{{d{AHb}}}{{d{c}}}{}}{{{d{AEd}}b}{{Bd{Dh}}}}{{{d{AEd}}{d{If}}}{{Bd{{Ij{bDh}}}}}}{{{d{AEd}}b}Ml}{c{{Af{AEb}}}Ah}{{{d{AEb}}{d{AEb}}}Aj}{{{d{AHb}}{d{AHb}}}Aj}``{{{d{AEd}}{d{jAHd}}AHf}{{Af{AjAHh}}}}{{{d{AEb}}{d{jAl}}}{{Af{AbIl}}}}0{{{d{AEd}}{d{jAl}}}An}{{{d{AFl}}{d{jAl}}}An}{{{d{AHb}}{d{jAl}}}An}0{{{d{AHj}}{d{jAl}}}An}0{{{d{AHl}}{d{jAl}}}An}0{{{d{AHn}}{d{jAl}}}An}0{{{d{AI`}}{d{jAl}}}An}0{{{d{AIb}}{d{jAl}}}An}0{cc{}}0{{{AId{b}}}AFl}1{AIfAFl}222222{{{d{AEd}}b}{{d{Kl}}}}{{{d{AEd}}l{Bd{AIh}}Aj}{{Af{AIjAIl}}}}{{{d{AEd}}b}{{AEj{Hl}}}}{{{d{AEd}}AGd}{{Bd{{AIn{{AEj{AFh}}AG`}}}}}}{{{d{AEd}}Bb}{{Bd{l}}}}````{{{d{jAEd}}AFd}{{Af{AjAJ`}}}}{{{d{jAEd}}AFhAJb}{{Af{AjAI`}}}}{{{d{jAEd}}BbBj}Ab}{ce{}{}}00000000{{{d{AJd}}{d{If}}}Aj}{{{d{AEd}}{d{If}}}Aj}`{{{d{AEd}}}{{`{{AEn{}{{AEl{{Ij{{d{b}}{d{Kl}}}}}}}}}}}}`{{{d{AEd}}}AJf}{{{d{AEd}}}{{`{{AEn{}{{AEl{l}}}}}}}}0{{{d{AEd}}b}{{`{{AJh{}{{AEl{AHb}}}}}}}}{c{{Af{AEdAHl}}}{{AJl{AJj}}AJnAK`}}{{{d{AEd}}}{{d{AKb}}}}{{{d{jAEd}}bDh}Aj}{{{d{AEd}}}Cb}`{{cceCb}{{Af{AEdAHj}}}Kj{{AJl{AJj}}AJnAK`}}{{ccCb}{{Af{AEdId}}}Kj}{{ccCbAKd}{{Af{AEdId}}}Kj}{{cceCb}{{Af{AEdAHn}}}Kj{{AJl{AJj}}AJnAK`}}{{cceCbAKd}{{Af{AEdAHn}}}Kj{{AJl{AJj}}AJnAK`}}{{cceCbAKd}{{Af{AEdAHj}}}Kj{{AJl{AJj}}AJnAK`}}{{{d{AEd}}b}Dh}{{{d{jAEd}}b}{{AH`{AHb}}}}{{{d{AEd}}bDh}AHb}{{{d{AEd}}b}{{Af{{Bd{Ib}}Id}}}}{{{d{AEd}}b}{{d{Kl}}}}{{{d{jAEd}}bDh}{{AH`{{`{{AEn{}{{AEl{AHb}}}}}}}}}}4{{{d{AEd}}}{{d{{Gd{I`}}}}}}{{{d{AEd}}{d{AFh}}}{{Ij{ADnADn}}}}{{{d{AEb}}c}AfBh}{{{d{AEd}}{d{jAHd}}AHf}{{Af{AjAHh}}}}`{{{d{AEd}}}{{d{{AKf{b}}}}}}{{{d{AEd}}}{{d{AJj}}}}{{{d{AEd}}}{{AKh{b}}}}{{{d{AEd}}}AKj}{{{d{c}}}e{}{}}0{{{d{c}}}Ml{}}000000{{{d{AEb}}}ADn}{{{d{AEd}}}{{`{{AEn{}{{AEl{{AIn{{AEj{AFh}}AG`}}}}}}}}}}`1{c{{Af{e}}}{}{}}00000000000000000`{{{d{AEd}}}{{d{{AGb{AG`}}}}}}{{{d{c}}}Bl{}}00000000{{{d{AEd}}b}{{`{{AEn{}{{AEl{{Ij{DhHb}}}}}}G`}}}}{{{d{jAEd}}bDh}Aj}`{ce{}{}}00000000{{c{Bd{c}}Cb{d{{Gd{I`}}}}}{{Af{MlId}}}Kj}```````````````````````{{{d{c}}}{{d{e}}}{}{}}00000{{{d{jc}}}{{d{je}}}{}{}}00000{{{d{AKl}}}AKl}{{{d{AKn}}}AKn}{{{d{AL`}}}AL`}{{{d{c}}{d{je}}}Ab{}{}}00{{{d{ALb}}{Dn{n}}{Dn{n}}AE`H`{d{If}}}{{Af{ALdALf}}}}{{{d{AKl}}{Dn{n}}{Dn{n}}AE`H`{d{If}}}{{Af{ALdALf}}}}{{{d{AKn}}{Dn{n}}{Dn{n}}AE`H`{d{If}}}{{Af{ALdALf}}}}{{{d{AL`}}{Dn{n}}{Dn{n}}AE`H`{d{If}}}{{Af{ALdALf}}}}{{H`AE`{d{If}}}ALh}{{}AKl}{{}AKn}{{}AL`}``{{{d{ALf}}{d{jAl}}}An}0{{{d{ALh}}{d{jAl}}}An}{{{d{ALd}}{d{jAl}}}An}{{{d{AKl}}{d{jAl}}}An}{{{d{AKn}}{d{jAl}}}An}{{{d{AL`}}{d{jAl}}}An}{cc{}}00000{ce{}{}}00000{{{d{ALd}}}H`}{H`AL`}`1{{{d{c}}}e{}{}}00{{{d{c}}}Ml{}}{c{{Af{e}}}{}{}}00000000000{{{d{c}}}Bl{}}00000666666``````````````````````````````````````{{{d{c}}}{{d{e}}}{}{}}00{{{d{jc}}}{{d{je}}}{}{}}00{{{d{ALj}}}ALj}{{{d{c}}{d{je}}}Ab{}{}}{{{d{ALj}}{d{jAl}}}An}0{{{d{AIl}}{d{jAl}}}An}0{{{d{AGj}}{d{jAl}}}An}0>{NfAIl}?{ALfAIl}{ALlAIl}{IdAIl}{ALjAIl}{cc{}}{ce{}{}}00{{{d{c}}}e{}{}}{{{d{c}}}Ml{}}00{c{{Af{e}}}{}{}}00000{{{d{c}}}Bl{}}00444``````````{{{d{c}}}{{d{e}}}{}{}}{{{d{jc}}}{{d{je}}}{}{}}{{{d{ALn}}}{{Bd{Ml}}}}{{{d{ALn}}}Ml}{c{{Af{ALn}}}Ah}{{{d{AEd}}{d{Bn}}Aj}{{Af{ALn{d{Bn}}}}}}{{{d{ALn}}{d{jAl}}}An}0<{{{d{Bn}}}{{Af{ALnc}}}{}}<``{{{d{ALn}}c}AfBh};::9=`````````````````````````````````````{{{d{jHl}}AM`AEf{AEj{AEh}}}{{Bd{{AEj{AEh}}}}}}``{{{d{Hl}}{d{{Gd{I`}}}}}Kn}`::::::::99999999{{Kn{d{{C`{Df}}}}{d{{Gd{I`}}}}}Hl}{{{d{AM`}}}AM`}{{{d{AMb}}}AMb}{{{d{{AMd{c}}}}}{{AMd{c}}}{G`AMfABjG`}}{{{d{AEf}}}AEf}{{{d{Hl}}}Hl}{{{d{AHf}}}AHf}{{{d{AMh}}}AMh}{{{d{c}}{d{je}}}Ab{}{}}000000{{{d{AM`}}{d{AM`}}}Ad}{{{d{AEf}}{d{AEf}}}Ad}{{}AEf}{{}Hl}{{}AHf}{{}AMh}{{{d{{AMd{c}}}}}{{d{e}}}{AMfABjG`}{}}{{{d{AMj}}}{{Bd{Ln}}}}{{{d{{AMd{AMl}}}}}{{Bd{Ln}}}}{{{d{{AMd{{AMn{AC`}}}}}}}{{Bd{Ln}}}}{{{d{{AMd{{AN`{AC`}}}}}}}{{Bd{Ln}}}}{{{d{AM`}}{d{AM`}}}Aj}{{{d{AMb}}{d{AMb}}}Aj}{{{d{AEf}}{d{AEf}}}Aj}{{{d{AMh}}{d{AMh}}}Aj}{{{d{Hl}}AM`}{{Bd{{d{{AEj{AEh}}}}}}}}{{{d{AM`}}{d{jAl}}}An}{{{d{AHh}}{d{jAl}}}An}0{{{d{AMb}}{d{jAl}}}An}{{{d{{AMd{c}}}}{d{jAl}}}An{ABjAMfABjG`}}{{{d{AEf}}{d{jAl}}}An}{{{d{Hl}}{d{jAl}}}An}{{{d{AHf}}{d{jAl}}}An}{{{d{AMh}}{d{jAl}}}An}{FhAM`}{ADhAM`}{cc{}}{ANbAHh}{ANdAHh}{ANfAHh}3333333{{{d{AM`}}{d{jc}}}AbB`}{{{d{AMj}}{d{{Gd{I`}}}}}AM`}{{{d{{AMd{AMl}}}}{d{{Gd{I`}}}}}AM`}{{{d{{AMd{{AMn{AC`}}}}}}{d{{Gd{I`}}}}}AM`}{{{d{{AMd{{AN`{AC`}}}}}}{d{{Gd{I`}}}}}AM`}{{{d{Hl}}}{{Dn{{d{AM`}}}}}}{ce{}{}}0000000{{cAMb}{{AMd{c}}}{AMfABjG`}}{{}Hl}{{{d{AM`}}{d{AM`}}}{{Bd{Ad}}}}{{{d{AEf}}{d{AEf}}}{{Bd{Ad}}}}{{{d{jHl}}AM`AEf}{{Bd{{AEj{AEh}}}}}}``{{{d{ANh}}{d{jAHd}}Kd{d{AHf}}{d{{Gd{I`}}}}}{{Af{AbAHh}}}}{{{d{{AMd{{AMn{AC`}}}}}}{d{jAHd}}Kd{d{AHf}}{d{{Gd{I`}}}}}{{Af{AbAHh}}}}{{{d{{AMd{{AN`{AC`}}}}}}{d{jAHd}}Kd{d{AHf}}{d{{Gd{I`}}}}}{{Af{AbAHh}}}}{{{d{{AMd{AMl}}}}{d{jAHd}}Kd{d{AHf}}{d{{Gd{I`}}}}}{{Af{AbAHh}}}}{{{d{AEh}}{d{jAHd}}{d{AHf}}{d{{Gd{I`}}}}}{{Af{AbAHh}}}}{{{d{c}}{d{jAHd}}{d{AHf}}{d{{Gd{I`}}}}}{{Af{AbAHh}}}{}}`{{{d{Hl}}}{{Dn{{d{{AEj{AEh}}}}}}}}`{{{d{c}}}e{}{}}000000{{{d{c}}}Ml{}}``{c{{Af{e}}}{}{}}000000000000000{{{d{c}}}Bl{}}0000000{ce{}{}}0000000````````````````{{{d{j{AGh{c}}}}{d{e}}}{{d{j{AGh{c}}}}}{}{{ANl{ANj}}}}{{{d{j{AGh{c}}}}BbAIjKd}{{Af{{d{j{AGh{c}}}}ANn}}}{}}{{{d{j{AGh{c}}}}BbAIjKdBf}{{Af{{d{j{AGh{c}}}}ANn}}}{}}{{{d{j{AGh{c}}}}}{{d{j{AGh{c}}}}}{}}{{{d{j{AGh{c}}}}HbADn}{{d{j{AGh{c}}}}}{}}{{{d{j{AGh{c}}}}Bb}{{d{j{AGh{c}}}}}{}}{{{d{j{AGh{c}}}}Bb}{{Af{{d{j{AGh{c}}}}AO`}}}{}}{{{d{j{AGh{c}}}}{d{{h{Bb}}}}}{{Af{{d{j{AGh{c}}}}AO`}}}{}}{{{d{j{AGh{c}}}}Aj}{{d{j{AGh{c}}}}}{}}{{{d{c}}}{{d{e}}}{}{}}0000{{{d{jc}}}{{d{je}}}{}{}}0000{{{d{j{AGh{c}}}}AOb}{{d{j{AGh{c}}}}}{}}{{{d{{AGh{c}}}}}{{AGh{c}}}G`}{{{d{AOd}}}AOd}{{{d{AOb}}}AOb}{{{d{c}}{d{je}}}Ab{}{}}00{{{d{AOd}}{d{AOd}}}Ad}{{{d{AOb}}{d{AOb}}}Ad}{{{AGh{c}}e}{{AGh{e}}}{}ALb}{{{d{j{AGh{c}}}}Dh}{{d{j{AGh{c}}}}}{}}{{}AOd}{{}AOb}{{{d{j{AGh{c}}}}}{{d{j{AGh{c}}}}}{}}{{{d{j{AGh{c}}}}Hb}{{d{j{AGh{c}}}}}{}}11{{{d{j{AGh{c}}}}Bf}{{d{j{AGh{c}}}}}{}}{{{d{AOd}}{d{AOd}}}Aj}{{{d{AOb}}{d{AOb}}}Aj}{{{d{j{AGh{c}}}}ADn}{{d{j{AGh{c}}}}}{}}{{{d{j{AGh{c}}}}AE`}{{d{j{AGh{c}}}}}{}}{{{AGh{c}}}{{Af{AHdAIl}}}ALb}{{{d{{AGh{c}}}}{d{jAl}}}AnABj}{{{d{AO`}}{d{jAl}}}An}0{{{d{ANn}}{d{jAl}}}An}0{{{d{AOd}}{d{jAl}}}An}{{{d{AOb}}{d{jAl}}}An}{cc{}}0000{{{d{AOd}}{d{jc}}}AbB`}{{{d{AOb}}{d{jc}}}AbB`}?{ce{}{}}0000{{{d{j{AGh{c}}}}}{{d{j{AGh{c}}}}}{}}{{{d{j{AGh{c}}}}AOf}{{d{j{AGh{c}}}}}{}}11{{{d{j{AGh{c}}}}AOd}{{d{j{AGh{c}}}}}{}}{{{d{AOd}}{d{AOd}}}{{Bd{Ad}}}}{{{d{AOb}}{d{AOb}}}{{Bd{Ad}}}}{{{d{j{AGh{c}}}}{M`{Ml{Dn{Kd}}}}b}{{d{j{AGh{c}}}}}{}}{{{d{j{AGh{c}}}}{Dn{{Ij{HbADn}}}}}{{d{j{AGh{c}}}}}{}}{{{d{j{AGh{c}}}}AIh}{{d{j{AGh{c}}}}}{}}{{{d{AOd}}{d{jAFh}}}Ab}{{{d{c}}}e{}{}}00{{{d{c}}}Ml{}}0{c{{Af{e}}}{}{}}000000000{{{d{c}}}Bl{}}0000{{{d{j{AGh{c}}}}{Dn{Bb}}}{{d{j{AGh{c}}}}}{}}{{{d{j{AGh{c}}}}AOh}{{d{j{AGh{c}}}}}{}}?????``","D":"FHj","p":[[6,"KeychainKind",0,1730],[1,"reference"],[1,"u8"],[1,"slice"],[0,"mut"],[5,"LocalOutput",0,1730],[5,"WeightedUtxo",0,1730],[6,"Utxo",0,1730],[1,"unit"],[6,"Ordering",1731],[6,"Result",1732],[10,"Deserializer",1733],[1,"bool"],[5,"Formatter",1734],[8,"Result",1734],[10,"Hasher",1735],[5,"OutPoint",1736],[6,"Option",1737],[5,"Sequence",1736],[10,"Serializer",1738],[5,"TxOut",1736],[5,"TypeId",1739],[1,"str"],[6,"Descriptor",100,1740],[6,"Network",1741],[5,"Address",1742],[6,"Error",1743],[10,"MiniscriptKey",1743],[10,"ToPublicKey",1743],[6,"ScriptContextEnum",693],[5,"Miniscript",100,1744],[6,"Terminal",1745],[10,"ScriptContext",693,1746],[6,"Tree",1747],[6,"DescriptorPublicKey",693,1748],[1,"u32"],[5,"DefiniteDescriptorKey",1748],[6,"ConversionError",1748],[5,"Vec",1749],[6,"Placeholder",1750],[5,"Satisfaction",1750],[10,"AssetProvider",1751],[17,"Key"],[6,"ScriptContextError",1746],[17,"Sha256"],[5,"Hash",1752],[17,"Hash256"],[5,"Hash",1753],[17,"Ripemd160"],[5,"Hash",1754],[17,"Hash160"],[5,"Hash",1755],[10,"ParseableKey",1745],[6,"Legacy",100,1746],[6,"Segwitv0",100,1746],[10,"Clone",1756],[10,"Ord",1731],[5,"Secp256k1",1757],[5,"PublicKey",1758],[10,"Verification",1759],[6,"DescriptorType",1740],[5,"DescriptorId",1760],[10,"FromStrKey",1761],[1,"u64"],[5,"ScriptBuf",1762],[10,"PartialEq",1731],[5,"ExtParams",1763],[6,"AnalysisError",1763],[10,"ExtractPolicy",100],[5,"SignersContainer",1429],[6,"BuildSatisfaction",386],[6,"All",1764],[5,"Policy",386],[6,"Error",354],[5,"Script",1765],[5,"Range",1766],[1,"tuple"],[5,"Error",1734],[17,"Output"],[10,"FnMut",1767],[5,"Tr",1768],[5,"Bare",1769],[5,"Sh",1770],[5,"Pkh",1769],[5,"Wsh",1771],[5,"Wpkh",1771],[5,"Type",1772],[5,"ExtData",1773],[5,"Tree",1774],[1,"usize"],[10,"Satisfier",1750],[10,"Hash",1735],[10,"IntoWalletDescriptor",100],[8,"ExtendedDescriptor",100],[8,"KeyMap",693,1740],[5,"Iter",1775],[5,"PkIter",1775],[6,"Policy",1776],[6,"LiftError",1777],[5,"Weight",1778],[6,"BareCtx",1746],[6,"TapTree",1768],[6,"DescriptorSecretKey",693,1748],[5,"BTreeMap",1779],[10,"Signing",1759],[10,"PartialOrd",1731],[5,"Plan",1751],[5,"TxIn",1736],[6,"SigType",1746],[5,"String",1780],[6,"TranslateErr",1743],[10,"Translator",1743],[1,"array"],[6,"KeyError",693],[6,"PolicyError",386],[6,"Error",1781],[6,"ParsePublicKeyError",1758],[6,"HexToBytesError",1782],[6,"Error",1783],[6,"PkOrF",386],[6,"SatisfiableItem",386],[6,"Satisfaction",386],[5,"Condition",386],[10,"DescriptorTemplate",557],[8,"DescriptorTemplateOut",557],[5,"P2Pkh",557],[10,"IntoDescriptorKey",693],[5,"P2Wpkh_P2Sh",557],[5,"P2Wpkh",557],[5,"P2TR",557],[6,"Tap",1746],[5,"Bip44",557],[10,"DerivableKey",693],[5,"Bip44Public",557],[5,"Bip49",557],[5,"Bip49Public",557],[5,"Bip84",557],[5,"Bip84Public",557],[5,"Bip86",557],[5,"Bip86Public",557],[8,"ValidNetworks",693],[5,"SortedMultiVec",693,1784],[5,"GeneratedKey",693],[5,"PrivateKeyGenerateOptions",693],[5,"SinglePub",693,1748],[5,"SinglePriv",693,1748],[6,"SinglePubKey",693,1748],[6,"DescriptorKey",693],[10,"Debug",1734],[5,"Xpub",1781],[6,"ExtendedKey",693],[5,"Xpriv",1781],[10,"FromStr",1785],[5,"DerivationPath",1781],[17,"Entropy"],[17,"Options"],[17,"Error"],[10,"GeneratableKey",693],[10,"AsMut",1786],[10,"Default",1787],[10,"GeneratableDefaultOptions",693],[5,"Assets",1751],[8,"KeySource",1781],[5,"Fingerprint",1781],[5,"DescriptorKeyParseError",1748],[10,"PsbtUtils",992],[5,"Amount",1788],[5,"FeeRate",1789],[5,"Balance",996,1790],[5,"Wallet",996],[5,"SignerOrdering",1429],[10,"TransactionSigner",1429],[5,"Arc",1791],[17,"Item"],[10,"Iterator",1792],[5,"Block",1793],[5,"CannotConnectError",1794],[5,"BlockId",1795],[6,"ApplyHeaderError",1794],[5,"Transaction",1736],[10,"IntoIterator",1796],[5,"Update",996],[10,"Into",1786],[5,"ConfirmationTimeHeightAnchor",1795],[5,"TxGraph",1797],[5,"Txid",1736],[8,"DefaultCoinSelectionAlgorithm",1229],[5,"TxBuilder",1613],[6,"BuildFeeBumpError",1328],[6,"CalculateFeeError",1797],[5,"CheckPointIter",1794],[8,"Result",1798],[5,"AddressInfo",996],[5,"Psbt",1799],[5,"SignOptions",1429],[6,"SignerError",1429],[6,"NewError",996],[6,"LoadError",996],[6,"NewOrLoadError",996],[6,"InsertTxError",996],[6,"ApplyBlockError",996],[5,"FullScanResult",1800],[5,"SyncResult",1800],[5,"PsbtSighashType",1801],[5,"Input",1801],[6,"CreateTxError",1328],[5,"CanonicalTx",1797],[5,"AlterCheckPointError",1794],[6,"ConfirmationTime",1795],[10,"IsDust",996,1802],[5,"CheckPoint",1794],[10,"DoubleEndedIterator",1803],[8,"ChangeSet",996],[10,"PersistBackend",1804],[10,"Send",1805],[10,"Sync",1805],[5,"LocalChain",1794],[5,"BlockHash",1793],[5,"KeychainTxOutIndex",1806],[5,"FullScanRequest",1800],[5,"SyncRequest",1800],[5,"LargestFirstCoinSelection",1229],[5,"OldestFirstCoinSelection",1229],[5,"BranchAndBoundCoinSelection",1229],[10,"CoinSelectionAlgorithm",1229],[5,"CoinSelectionResult",1229],[6,"Error",1229],[6,"Excess",1229],[6,"MiniscriptPsbtError",1328],[6,"Error",1807],[5,"FullyNodedExport",1406],[6,"SignerId",1429],[6,"SignerContext",1429],[5,"SignerWrapper",1429],[10,"Sized",1805],[6,"TapLeavesOptions",1429],[10,"SignerCommon",1429],[5,"PrivateKey",1758],[5,"DescriptorMultiXKey",1748],[5,"DescriptorXKey",1748],[6,"TaprootError",1808],[6,"P2wpkhError",1808],[5,"InputsIndexError",1736],[10,"InputSigner",1429],[5,"PushBytes",1809],[10,"AsRef",1786],[6,"AddForeignUtxoError",1613],[6,"AddUtxoError",1613],[6,"ChangeSpendPolicy",1613],[6,"TxOrdering",1613],[6,"LockTime",1810],[1,"i32"],[15,"Foreign",97],[8,"DerivedDescriptor",100],[15,"PsbtTimelocks",533],[15,"Complete",536],[15,"Partial",536],[15,"PartialComplete",536],[15,"Sha256Preimage",547],[15,"Hash256Preimage",547],[15,"Ripemd160Preimage",547],[15,"Hash160Preimage",547],[15,"Thresh",547],[15,"Multisig",547],[15,"AbsoluteTimelock",547],[15,"RelativeTimelock",547],[10,"ExtScriptContext",693],[15,"UnexpectedConnectedToHash",1219],[15,"ConfirmationHeightCannotBeGreaterThanTip",1221],[15,"LoadedGenesisDoesNotMatch",1223],[15,"LoadedNetworkDoesNotMatch",1223],[15,"LoadedDescriptorDoesNotMatch",1223],[15,"InsufficientFunds",1321],[15,"Change",1323],[15,"NoChange",1323],[15,"RbfSequenceCsv",1400],[15,"LockTime",1400],[15,"FeeTooLow",1400],[15,"FeeRateTooLow",1400],[8,"WalletExport",1406],[15,"Tap",1612],[15,"InvalidTxid",1728]],"r":[[2,100],[4,1730],[6,1730],[7,1429],[8,1613],[9,1730],[10,996],[11,1730],[70,996],[71,100],[104,1740],[106,1748],[113,1746],[114,1744],[119,386],[120,1746],[121,1746],[155,352],[696,1748],[697,1748],[712,1740],[722,1746],[727,1748],[728,1748],[729,1748],[730,1784],[998,1790],[1006,1802]],"b":[[193,"impl-Descriptor%3CDescriptorPublicKey%3E"],[194,"impl-Descriptor%3CDefiniteDescriptorKey%3E"],[213,"impl-Display-for-Descriptor%3CPk%3E"],[214,"impl-Debug-for-Descriptor%3CPk%3E"],[217,"impl-Debug-for-Miniscript%3CPk,+Ctx%3E"],[218,"impl-Display-for-Miniscript%3CPk,+Ctx%3E"],[221,"impl-From%3CTr%3CPk%3E%3E-for-Descriptor%3CPk%3E"],[222,"impl-From%3CBare%3CPk%3E%3E-for-Descriptor%3CPk%3E"],[223,"impl-From%3CSh%3CPk%3E%3E-for-Descriptor%3CPk%3E"],[224,"impl-From%3CPkh%3CPk%3E%3E-for-Descriptor%3CPk%3E"],[225,"impl-From%3CWsh%3CPk%3E%3E-for-Descriptor%3CPk%3E"],[226,"impl-From%3CWpkh%3CPk%3E%3E-for-Descriptor%3CPk%3E"],[370,"impl-Debug-for-Error"],[371,"impl-Display-for-Error"],[372,"impl-From%3CKeyError%3E-for-Error"],[373,"impl-From%3CPolicyError%3E-for-Error"],[374,"impl-From%3CError%3E-for-Error"],[375,"impl-From%3CParsePublicKeyError%3E-for-Error"],[376,"impl-From%3CError%3E-for-Error"],[377,"impl-From%3CHexToBytesError%3E-for-Error"],[379,"impl-From%3CError%3E-for-Error"],[461,"impl-Display-for-PolicyError"],[462,"impl-Debug-for-PolicyError"],[811,"impl-Display-for-KeyError"],[812,"impl-Debug-for-KeyError"],[813,"impl-Display-for-SortedMultiVec%3CPk,+Ctx%3E"],[814,"impl-Debug-for-SortedMultiVec%3CPk,+Ctx%3E"],[815,"impl-Debug-for-DescriptorPublicKey"],[816,"impl-Display-for-DescriptorPublicKey"],[817,"impl-Display-for-DescriptorSecretKey"],[818,"impl-Debug-for-DescriptorSecretKey"],[823,"impl-From%3CXpub%3E-for-ExtendedKey%3CCtx%3E"],[825,"impl-From%3CXpriv%3E-for-ExtendedKey%3CCtx%3E"],[830,"impl-From%3CError%3E-for-KeyError"],[831,"impl-From%3CError%3E-for-KeyError"],[872,"impl-DerivableKey%3CCtx%3E-for-GeneratedKey%3CK,+Ctx%3E"],[873,"impl-IntoDescriptorKey%3CCtx%3E-for-GeneratedKey%3CK,+Ctx%3E"],[1080,"impl-Debug-for-Balance"],[1081,"impl-Display-for-Balance"],[1084,"impl-Debug-for-AddressInfo"],[1085,"impl-Display-for-AddressInfo"],[1086,"impl-Display-for-NewError"],[1087,"impl-Debug-for-NewError"],[1088,"impl-Debug-for-LoadError"],[1089,"impl-Display-for-LoadError"],[1090,"impl-Display-for-NewOrLoadError"],[1091,"impl-Debug-for-NewOrLoadError"],[1092,"impl-Debug-for-InsertTxError"],[1093,"impl-Display-for-InsertTxError"],[1094,"impl-Debug-for-ApplyBlockError"],[1095,"impl-Display-for-ApplyBlockError"],[1098,"impl-From%3CFullScanResult%3CKeychainKind%3E%3E-for-Update"],[1100,"impl-From%3CSyncResult%3E-for-Update"],[1270,"impl-Display-for-Error"],[1271,"impl-Debug-for-Error"],[1367,"impl-Debug-for-MiniscriptPsbtError"],[1368,"impl-Display-for-MiniscriptPsbtError"],[1369,"impl-Display-for-CreateTxError"],[1370,"impl-Debug-for-CreateTxError"],[1371,"impl-Debug-for-BuildFeeBumpError"],[1372,"impl-Display-for-BuildFeeBumpError"],[1374,"impl-From%3CPolicyError%3E-for-CreateTxError"],[1376,"impl-From%3CError%3E-for-CreateTxError"],[1377,"impl-From%3CError%3E-for-CreateTxError"],[1378,"impl-From%3CError%3E-for-CreateTxError"],[1379,"impl-From%3CMiniscriptPsbtError%3E-for-CreateTxError"],[1416,"impl-Display-for-FullyNodedExport"],[1417,"impl-Debug-for-FullyNodedExport"],[1510,"impl-SignerCommon-for-SignerWrapper%3CPrivateKey%3E"],[1511,"impl-SignerCommon-for-SignerWrapper%3CDescriptorMultiXKey%3CXpriv%3E%3E"],[1512,"impl-SignerCommon-for-SignerWrapper%3CDescriptorXKey%3CXpriv%3E%3E"],[1519,"impl-Display-for-SignerError"],[1520,"impl-Debug-for-SignerError"],[1527,"impl-From%3CHash%3E-for-SignerId"],[1528,"impl-From%3CFingerprint%3E-for-SignerId"],[1530,"impl-From%3CTaprootError%3E-for-SignerError"],[1531,"impl-From%3CP2wpkhError%3E-for-SignerError"],[1532,"impl-From%3CInputsIndexError%3E-for-SignerError"],[1542,"impl-SignerCommon-for-SignerWrapper%3CPrivateKey%3E"],[1543,"impl-SignerCommon-for-SignerWrapper%3CDescriptorMultiXKey%3CXpriv%3E%3E"],[1544,"impl-SignerCommon-for-SignerWrapper%3CDescriptorXKey%3CXpriv%3E%3E"],[1562,"impl-InputSigner-for-SignerWrapper%3CDescriptorMultiXKey%3CXpriv%3E%3E"],[1563,"impl-InputSigner-for-SignerWrapper%3CDescriptorXKey%3CXpriv%3E%3E"],[1564,"impl-InputSigner-for-SignerWrapper%3CPrivateKey%3E"],[1671,"impl-Debug-for-AddUtxoError"],[1672,"impl-Display-for-AddUtxoError"],[1673,"impl-Display-for-AddForeignUtxoError"],[1674,"impl-Debug-for-AddForeignUtxoError"]],"c":"OjAAAAEAAAAAAAUAEAAAAMEAAwEPAR8DdgOABQ==","e":"OzAAAAEAAH0DfwADAAAACAABAAsAAAAOABMAJgAJADUAAQA+AAAAQQAAAEUADwBXAAMAXQADAGoAAAB4AAAAjAABAI8AAACRAAcAnAAAAJ4AAQChAAAApAABAKcAAQCrAAEArgABALEAAQC0AAsAxQADAMoAAwDTAAEA1gANAOoAAAD3AAMAAgEAAAgBAQAMAQEAEwEBACkBAwAuAQEAPAEBAD8BAQBDAQUATgEHAFcBAwBcAQMAcQEJAHwBAAB+AQQApgEZAMIBDgDTAQAA1QEAANsBAQDqAQAA7QEEAPMBIgA8AhcAVQILAHkCPADkAhcABgMVAB0DAQAgAwAAIgMWADoDAAA/AwEAQwMAAEsDAQBWAwMAZgMAAGkDBABvAwEAfwMBAIQDAACOAwAAkwMDAJwDAACgAwgAqgMDALEDLwACBAAACgQAAAwEEQAmBAMALQQCADMEAgA5BA8ASwQAAE0EAACGBAAAjQQIAJoEEQCuBAgAugQIANsEEQDuBAIA8gQCAPcEBgAOBRsAUAUNAF8FAABhBQMAaQUPAIMFAQCHBQAAiQUBAIwFAACQBQUAwAUPANEFFADnBQYA7wUKAPsFAgAFBgAABwYCABUGAQAbBgIAHwYAACMGBwAtBh8AZgYJAHEGBwB7BgEAggYBAIcGBgCTBgEAoAYBAKYGEwC8BgQA"}],\ ["example_bitcoind_rpc_polling",{"t":"PSISSSGPSPFGSPPNNNNHNNNNNNNNNNONNNNNNNNNNNNNNHNOOOHNNNNNNNNNNNNNNNONNNOO","n":["Block","CHANNEL_BOUND","ChangeSet","DB_COMMIT_DELAY","DB_MAGIC","DB_PATH","Emission","Live","MEMPOOL_EMIT_DELAY","Mempool","RpcArgs","RpcCommands","STDOUT_PRINT_DELAY","Sync","Tip","augment_args","augment_args_for_update","augment_subcommands","augment_subcommands_for_update","await_flag","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","fallback_height","fmt","fmt","fmt","from","from","from","from_arg_matches","from_arg_matches","from_arg_matches_mut","from_arg_matches_mut","has_subcommand","into","into","into","main","new_client","rpc_cookie","rpc_password","rpc_user","start_ctrlc_handler","to_owned","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","update_from_arg_matches","update_from_arg_matches","update_from_arg_matches_mut","update_from_arg_matches_mut","url","vzip","vzip","vzip","rpc_args","rpc_args"],"q":[[0,"example_bitcoind_rpc_polling"],[70,"example_bitcoind_rpc_polling::RpcCommands"],[72,"clap::builder::command"],[73,"core::sync::atomic"],[74,"core::time"],[75,"core::fmt"],[76,"clap::parser::matches::arg_matches"],[77,"clap::error"],[78,"core::result"],[79,"anyhow"],[80,"bitcoincore_rpc::client"],[81,"alloc::sync"],[82,"core::any"]],"i":[10,0,0,0,0,0,0,8,0,10,0,0,0,8,10,7,7,8,8,0,10,7,8,10,7,8,7,8,7,8,7,10,7,8,10,7,8,7,8,7,8,8,10,7,8,0,7,7,7,7,0,7,8,10,7,8,10,7,8,10,7,8,7,8,7,8,7,10,7,8,21,22],"f":"```````````````{bb}000{{{f{d}}h}j}{{{f{c}}}{{f{e}}}{}{}}00{{{f{lc}}}{{f{le}}}{}{}}00{{{f{n}}}n}{{{f{A`}}}A`}{{{f{c}}{f{le}}}Ab{}{}}0`{{{f{Ad}}{f{lAf}}}Ah}{{{f{n}}{f{lAf}}}Ah}{{{f{A`}}{f{lAf}}}Ah}{cc{}}00{{{f{Aj}}}{{An{nAl}}}}{{{f{Aj}}}{{An{A`Al}}}}{{{f{lAj}}}{{An{nAl}}}}{{{f{lAj}}}{{An{A`Al}}}}{{{f{B`}}}j}{ce{}{}}00{{}{{Bb{Ab}}}}{{{f{n}}}{{Bb{Bd}}}}```{{}{{Bf{d}}}}{{{f{c}}}e{}{}}0{c{{An{e}}}{}{}}00000{{{f{c}}}Bh{}}00{{{f{ln}}{f{Aj}}}{{An{AbAl}}}}{{{f{lA`}}{f{Aj}}}{{An{AbAl}}}}{{{f{ln}}{f{lAj}}}{{An{AbAl}}}}{{{f{lA`}}{f{lAj}}}{{An{AbAl}}}}`:::``","D":"Bb","p":[[8,"Command",72],[5,"AtomicBool",73],[1,"reference"],[5,"Duration",74],[1,"bool"],[0,"mut"],[5,"RpcArgs",0],[6,"RpcCommands",0],[1,"unit"],[6,"Emission",0],[5,"Formatter",75],[8,"Result",75],[5,"ArgMatches",76],[5,"Error",77],[6,"Result",78],[1,"str"],[8,"Result",79],[5,"Client",80],[5,"Arc",81],[5,"TypeId",82],[15,"Sync",70],[15,"Live",70]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAADcACgAAAAEAAwAAAAUAAgAKAAIADwAPACAAAgAmAAQALgABADMADwBEAAQA"}],\ ["example_cli",{"t":"PGFPPPGGFPPFPGIIPPPPPPPIPPPGEONNNNNNNNENNNNNNNNNNNNNNNNOOENNNNNNNNNNNOOHOONONNNNNNNNNNNNNNNNNNNNNNNNNNNNHNNNOOOOHONNNNNNNNNNOONHNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOO","n":["Address","AddressCmd","Args","Balance","BranchAndBound","ChainSpecific","CoinSelectionAlgo","Commands","CreateTxChange","External","Index","Init","Internal","Keychain","KeychainChangeSet","KeychainTxGraph","LargestFirst","List","List","New","NewestFirst","Next","OldestFirst","PlannedUtxo","Send","SmallestFirst","TxOut","TxOutCmd","anyhow","args","augment_args","augment_args_for_update","augment_subcommands","augment_subcommands","augment_subcommands","augment_subcommands_for_update","augment_subcommands_for_update","augment_subcommands_for_update","bdk_file_store","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","change_descriptor","change_keychain","clap","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","command","cp_limit","create_tx","db","db_path","default","descriptor","deserialize","eq","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from_arg_matches","from_arg_matches","from_arg_matches","from_arg_matches","from_arg_matches_mut","from_arg_matches_mut","from_arg_matches_mut","from_arg_matches_mut","from_str","handle_commands","has_subcommand","has_subcommand","has_subcommand","index","index","index","index_changeset","init","init_changeset","into","into","into","into","into","into","into","into","into_app","into_app_for_update","keymap","network","partial_cmp","planned_utxos","serialize","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","update_from_arg_matches","update_from_arg_matches","update_from_arg_matches","update_from_arg_matches","update_from_arg_matches_mut","update_from_arg_matches_mut","update_from_arg_matches_mut","update_from_arg_matches_mut","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","change","addr_cmd","address","chain_specific","coin_select","txout_cmd","value","confirmed","spent","unconfirmed","unspent"],"q":[[0,"example_cli"],[176,"example_cli::AddressCmd"],[177,"example_cli::Commands"],[183,"example_cli::TxOutCmd"],[187,"clap::builder::command"],[188,"core::clone"],[189,"clap::derive"],[190,"core::cmp"],[191,"miniscript::descriptor::key"],[192,"alloc::collections::btree::map"],[193,"bitcoin::address"],[194,"bitcoin::blockdata::transaction"],[195,"core::option"],[196,"anyhow"],[197,"bdk_chain::tx_data_traits"],[198,"bdk_chain::chain_oracle"],[199,"core::result"],[200,"serde::de"],[201,"core::fmt"],[202,"clap::parser::matches::arg_matches"],[203,"clap::error"],[204,"std::sync::mutex"],[205,"bdk_persist::persist"],[206,"bitcoin::network"],[207,"core::default"],[208,"serde::ser"],[209,"core::convert"],[210,"core::ops::function"],[211,"core::marker"],[212,"bdk_tmp_plan"],[213,"alloc::vec"],[214,"alloc::string"],[215,"core::any"]],"i":[4,0,0,4,8,4,0,0,0,11,9,0,11,0,0,0,8,9,10,9,8,9,8,0,4,8,4,0,0,50,34,34,4,9,10,4,9,10,0,21,50,34,4,8,9,10,11,21,50,34,4,8,9,10,11,34,21,0,4,8,9,10,11,4,8,9,10,11,11,34,34,0,50,34,8,34,11,11,11,11,4,8,8,9,10,11,11,21,50,34,4,8,9,10,11,34,4,9,10,34,4,9,10,8,0,4,9,10,14,21,50,21,0,50,21,50,34,4,8,9,10,11,34,34,50,34,11,0,11,4,8,9,10,11,8,11,21,50,34,4,8,9,10,11,21,50,34,4,8,9,10,11,21,50,34,4,8,9,10,11,34,4,9,10,34,4,9,10,21,50,34,4,8,9,10,11,60,61,62,62,62,63,62,64,64,64,64],"f":"``````````````````````````````{bb}0000000`{{{d{c}}}{{d{e}}}{}{}}0000000{{{d{fc}}}{{d{fe}}}{}{}}0000000```{{{d{{h{ce}}}}}{{h{ce}}}{jl}{jn}}{{{d{A`}}}A`}{{{d{Ab}}}Ab}{{{d{Ad}}}Ad}{{{d{Af}}}Af}{{{d{c}}{d{fe}}}Ah{}{}}0000{{{d{Af}}{d{Af}}}Aj}``{{{d{f{Al{c}}}}{d{e}}{d{{Bb{AnB`}}}}A`BdBf}{{C`{{Bn{Bh{Bl{Bj}}}}}}}CbCd}``{{}A`}`{c{{Cf{Af}}}Ch}{{{d{Af}}{d{Af}}}Cj}{{{d{c}}{d{e}}}Cj{}{}}0{{{d{{h{ce}}}}{d{fCl}}}Cn{D`l}{D`n}}{{{d{A`}}{d{fCl}}}Cn}0{{{d{Ab}}{d{fCl}}}Cn}{{{d{Ad}}{d{fCl}}}Cn}{{{d{Af}}{d{fCl}}}Cn}0{cc{}}0000000{{{d{Db}}}{{Cf{{Dd{ce}}Df}}}ln}{{{d{Db}}}{{Cf{{h{ce}}Df}}}ln}{{{d{Db}}}{{Cf{AbDf}}}}{{{d{Db}}}{{Cf{AdDf}}}}{{{d{fDb}}}{{Cf{{Dd{ce}}Df}}}ln}{{{d{fDb}}}{{Cf{{h{ce}}Df}}}ln}{{{d{fDb}}}{{Cf{AbDf}}}}{{{d{fDb}}}{{Cf{AdDf}}}}{{{d{Dh}}}{{Cf{A`c}}}{}}{{{d{{Dj{{Al{c}}}}}}{d{{Dj{{Dl{e}}}}}}{d{{Dj{g}}}}{d{{Bb{AnB`}}}}Dnk{h{mi}}}{{C`{Ah}}}Cb{E`EbEdEf{Ej{{Eh{c}}}}}Cdn{{En{i{d{Bh}}}{{El{{C`{Ah}}}}}}}l}{{{d{Dh}}}Cj}00````{{{d{{Fb{F`}}}}{d{Dh}}}{{C`{{Fd{ceg}}}}}ln{E`EbEfEdFfFh}}`{ce{}{}}0000000{{}b}0``{{{d{Af}}{d{Af}}}{{Bl{Aj}}}}{{{d{{Al{c}}}}{d{e}}{d{{Fj{g}}}}}{{Cf{{Fn{{Fl{gc}}}}}}}CbCd{jG`}}{{{d{Af}}c}CfGb}{{{d{c}}}e{}{}}0000{{{d{c}}}Gd{}}0{c{{Cf{e}}}{}{}}000000000000000{{{d{c}}}Gf{}}0000000{{{d{f{Dd{ce}}}}{d{Db}}}{{Cf{AhDf}}}ln}{{{d{f{h{ce}}}}{d{Db}}}{{Cf{AhDf}}}ln}{{{d{fAb}}{d{Db}}}{{Cf{AhDf}}}}{{{d{fAd}}{d{Db}}}{{Cf{AhDf}}}}{{{d{f{Dd{ce}}}}{d{fDb}}}{{Cf{AhDf}}}ln}{{{d{f{h{ce}}}}{d{fDb}}}{{Cf{AhDf}}}ln}{{{d{fAb}}{d{fDb}}}{{Cf{AhDf}}}}{{{d{fAd}}{d{fDb}}}{{Cf{AhDf}}}}{ce{}{}}0000000```````````","D":"E`","p":[[8,"Command",187],[1,"reference"],[0,"mut"],[6,"Commands",0],[10,"Clone",188],[10,"Subcommand",189],[10,"Args",189],[6,"CoinSelectionAlgo",0],[6,"AddressCmd",0],[6,"TxOutCmd",0],[6,"Keychain",0],[1,"unit"],[6,"Ordering",190],[8,"KeychainTxGraph",0],[6,"DescriptorPublicKey",191],[6,"DescriptorSecretKey",191],[5,"BTreeMap",192],[5,"Address",193],[1,"u64"],[5,"Transaction",194],[5,"CreateTxChange",0],[6,"Option",195],[1,"tuple"],[8,"Result",196],[10,"Anchor",197],[10,"ChainOracle",198],[6,"Result",199],[10,"Deserializer",200],[1,"bool"],[5,"Formatter",201],[8,"Result",201],[10,"Debug",201],[5,"ArgMatches",202],[5,"Args",0],[5,"Error",203],[1,"str"],[5,"Mutex",204],[5,"Persist",205],[6,"Network",206],[10,"Default",207],[10,"Append",197],[10,"DeserializeOwned",200],[10,"Serialize",208],[8,"KeychainChangeSet",0],[10,"From",209],[17,"Output"],[10,"FnOnce",210],[1,"u8"],[1,"slice"],[5,"Init",0],[10,"Send",211],[10,"Sync",211],[5,"Assets",212],[8,"PlannedUtxo",0],[5,"Vec",213],[10,"CanDerive",212],[10,"Serializer",208],[5,"String",214],[5,"TypeId",215],[15,"List",176],[15,"Address",177],[15,"Send",177],[15,"TxOut",177],[15,"List",183]],"r":[],"b":[[81,"impl-Debug-for-CoinSelectionAlgo"],[82,"impl-Display-for-CoinSelectionAlgo"],[85,"impl-Debug-for-Keychain"],[86,"impl-Display-for-Keychain"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAJMAEQAAAAAAAgABAAUABQANAAQAFQAAABcAAQAaAAAAHAABAB8AKQBKAA0AYAAMAG4AAABwAAAAewABAH4AMgCyAAAAtAACAA=="}],\ ["example_electrum",{"t":"ISSFGPFPNNNNNNONNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNHNNNNNNNNNNNNNNNNNNNNNOOOOOOOOO","n":["ChangeSet","DB_MAGIC","DB_PATH","ElectrumArgs","ElectrumCommands","Scan","ScanOptions","Sync","augment_args","augment_args","augment_args_for_update","augment_args_for_update","augment_subcommands","augment_subcommands_for_update","batch_size","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","client","clone","clone","clone","clone_into","clone_into","clone_into","electrum_args","electrum_url","eq","fmt","fmt","fmt","from","from","from","from_arg_matches","from_arg_matches","from_arg_matches","from_arg_matches_mut","from_arg_matches_mut","from_arg_matches_mut","has_subcommand","into","into","into","into_app","into_app_for_update","main","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","update_from_arg_matches","update_from_arg_matches","update_from_arg_matches","update_from_arg_matches_mut","update_from_arg_matches_mut","update_from_arg_matches_mut","vzip","vzip","vzip","all_spks","electrum_args","electrum_args","scan_options","scan_options","stop_gap","unconfirmed","unused_spks","utxos"],"q":[[0,"example_electrum"],[71,"example_electrum::ElectrumCommands"],[80,"clap::builder::command"],[81,"bitcoin::network"],[82,"electrum_client::client"],[83,"anyhow"],[84,"core::fmt"],[85,"clap::parser::matches::arg_matches"],[86,"clap::error"],[87,"core::result"],[88,"core::any"]],"i":[0,0,0,0,0,8,0,8,4,9,4,9,8,8,9,8,4,9,8,4,9,4,8,4,9,8,4,9,8,4,9,8,4,9,8,4,9,8,4,9,8,4,9,8,8,4,9,9,9,0,8,4,9,8,4,9,8,4,9,8,4,9,8,4,9,8,4,9,8,4,9,19,20,19,20,19,20,19,19,19],"f":"````````{bb}00000`{{{d{c}}}{{d{e}}}{}{}}00{{{d{fc}}}{{d{fe}}}{}{}}00{{{d{h}}j}{{n{l}}}}{{{d{A`}}}A`}{{{d{h}}}h}{{{d{Ab}}}Ab}{{{d{c}}{d{fe}}}Ad{}{}}00{{{d{A`}}}h}`{{{d{Ab}}{d{Ab}}}Af}{{{d{A`}}{d{fAh}}}Aj}{{{d{h}}{d{fAh}}}Aj}{{{d{Ab}}{d{fAh}}}Aj}{cc{}}00{{{d{Al}}}{{B`{A`An}}}}{{{d{Al}}}{{B`{hAn}}}}{{{d{Al}}}{{B`{AbAn}}}}{{{d{fAl}}}{{B`{A`An}}}}{{{d{fAl}}}{{B`{hAn}}}}{{{d{fAl}}}{{B`{AbAn}}}}{{{d{Bb}}}Af}{ce{}{}}00{{}b}0{{}{{n{Ad}}}}{{{d{c}}}e{}{}}00{c{{B`{e}}}{}{}}00000{{{d{c}}}Bd{}}00{{{d{fA`}}{d{Al}}}{{B`{AdAn}}}}{{{d{fh}}{d{Al}}}{{B`{AdAn}}}}{{{d{fAb}}{d{Al}}}{{B`{AdAn}}}}{{{d{fA`}}{d{fAl}}}{{B`{AdAn}}}}{{{d{fh}}{d{fAl}}}{{B`{AdAn}}}}{{{d{fAb}}{d{fAl}}}{{B`{AdAn}}}};;;`````````","D":"An","p":[[8,"Command",80],[1,"reference"],[0,"mut"],[5,"ElectrumArgs",0],[6,"Network",81],[5,"Client",82],[8,"Result",83],[6,"ElectrumCommands",0],[5,"ScanOptions",0],[1,"unit"],[1,"bool"],[5,"Formatter",84],[8,"Result",84],[5,"ArgMatches",85],[5,"Error",86],[6,"Result",87],[1,"str"],[5,"TypeId",88],[15,"Sync",71],[15,"Scan",71]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAEEACAAAAAUABwAAAAkABQAQAA0AHwADACYABgAwABcASQADAA=="}],\ diff --git a/docs-rs/bdk/nightly/latest/search.desc/bdk_wallet/bdk_wallet-desc-0-.js b/docs-rs/bdk/nightly/latest/search.desc/bdk_wallet/bdk_wallet-desc-0-.js index 579098e63c..db00b697cf 100644 --- a/docs-rs/bdk/nightly/latest/search.desc/bdk_wallet/bdk_wallet-desc-0-.js +++ b/docs-rs/bdk/nightly/latest/search.desc/bdk_wallet/bdk_wallet-desc-0-.js @@ -1 +1 @@ -searchState.loadedDescShard("bdk_wallet", 0, "BDK Wallet\nExternal keychain, used for deriving recipient addresses.\nA UTXO owned by another wallet.\nInternal keychain, used for deriving change addresses.\nTypes of keychains\nA UTXO owned by the local wallet.\nAn unspent output owned by a Wallet.\nAn unspent transaction output (UTXO).\nA Utxo with its satisfaction_weight.\nReturn KeychainKind as a byte\nThe confirmation time for transaction containing this utxo\nThe derivation index for the script pubkey in the wallet\nDescriptors\nMacro to write full descriptors with code\nMacro to write descriptor fragments with code\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether this UTXO is spent or not\nType of keychain\nKey formats\nGet the location of the UTXO\nReference to a transaction output\nAdditional functions on the rust-bitcoin Psbt structure.\nThe weight of the witness data and scriptSig expressed in …\nGet the sequence number if an explicit sequence number has …\nGet the TxOut of the UTXO\nTransaction output\nThe UTXO\nGet the version of BDK at runtime\nWallet\nThe location of the output.\nThe information about the input we require to add it to a …\nThe nSequence value to set for this input.\nA raw scriptpubkey (including pay-to-pubkey) under Legacy …\nA raw scriptpubkey (including pay-to-pubkey) under Legacy …\nA raw scriptpubkey (including pay-to-pubkey) under Legacy …\nAlias for a Descriptor that contains extended derived keys\nScript descriptor\nThe descriptor pubkey, either a single pubkey or an xpub.\nAlias for a Descriptor that can contain extended keys …\nTrait implemented on Descriptors to add a method to …\nAlias for the type of maps that represent derivation paths …\nTrait for types which can be converted into an …\nThe consensus key associated with the type. Must be a …\nLegacy ScriptContext To be used as P2SH scripts For …\nThe top-level miniscript abstract syntax tree (AST).\nMultiple extended public keys.\nPay-to-PubKey-Hash\nPay-to-PubKey-Hash\nPay-to-PubKey-Hash\nThe ScriptContext for Miniscript. Additional type …\nSegwitv0 ScriptContext\nPay-to-ScriptHash(includes nested wsh/wpkh/sorted multi)\nPay-to-ScriptHash(includes nested wsh/wpkh/sorted multi)\nPay-to-ScriptHash(includes nested wsh/wpkh/sorted multi)\nSingle public key.\nAlias for the type of maps that represent taproot key …\nPay-to-Taproot\nPay-to-Taproot\nPay-to-Taproot\nPay-to-Witness-PubKey-Hash\nPay-to-Witness-PubKey-Hash\nPay-to-Witness-PubKey-Hash\nPay-to-Witness-ScriptHash with Segwitv0 context\nPay-to-Witness-ScriptHash with Segwitv0 context\nPay-to-Witness-ScriptHash with Segwitv0 context\nExtended public key (xpub).\nComputes the Bitcoin address of the descriptor, if one …\nGet a reference to the inner AstElem representing the root …\nReplaces all wildcards (i.e. /*) in the descriptor with a …\nEnumerates all child nodes of the current AST node (self) …\nAttempt to produce a non-malleable witness template given …\nAttempt to produce a malleable witness template given the …\nDepending on script Context, some of the Terminals might …\nDepending on script Context, some of the script resource …\nCheck the consensus + policy(if not disabled) rules that …\nConsensus rules at the Miniscript satisfaction time. It is …\nPolicy rules at the Miniscript satisfaction time. It is …\nCheck the consensus + policy(if not disabled) rules …\nEach context has slightly different rules on what Pks are …\nDepending on ScriptContext, fragments can be malleable. …\nCheck whether the given satisfaction is valid under the …\nDescriptor checksum\nWhether the given miniscript contains a raw pkh fragment\nDeprecated name for Self::at_derivation_index.\nConvert all the public keys in the descriptor to …\nConvert all the public keys in the descriptor to …\nGet the DescriptorType of Descriptor\nEncode as a Bitcoin script\nDescriptor errors\nComputes the the underlying script before any hashing is …\nAdditional information helpful for extra analysis.\nCheck whether the miniscript follows the given Extra …\nExtract the spending policy\nUtility method for deriving the descriptor at each index …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nAdd type information(Type and Extdata) to Miniscript based …\nCreate a new Miniscript from a Terminal node and a Type …\nParse a Miniscript from string and perform sanity checks …\nAttempt to parse an Miniscripts that don’t follow the …\nAttempt to parse an insane(scripts don’t clear sanity …\nParse an expression tree into a descriptor.\nParse an expression tree into a Miniscript. As a general …\nReturns child node with given index, if any\nReturns Option::Some with cloned n’th public key from …\nReturns satisfying non-malleable witness and scriptSig to …\nReturns a possilbly mallable satisfying non-malleable …\nWhether the miniscript contains a combination of timelocks\nWhether the miniscript has repeated Pk or Pkh\nWhether or not the descriptor has any wildcards i.e. /*.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nExtracts the AstElem representing the root of the …\nGet as many descriptors as different paths in this …\nConvert to wallet descriptor\nWhether or not the descriptor has any wildcards\nWhether this descriptor contains a key that has multiple …\nWhether the miniscript is malleable\nCreates a new Iter iterator that will iterate over all …\nCreates a new PkIter iterator that will iterate over all …\nLifting corresponds to conversion of a miniscript into a …\nDepending on script context, the size of a satifaction …\nMaximum size, in bytes, of a satisfying witness. For …\nComputes an upper bound on the weight of a satisfying …\nMaximum number of witness elements used to satisfy the …\nComputes an upper bound on the difference between a …\nLocal helper function to display error messages with …\nCreate a new bare descriptor from witness script Errors …\nCreate a new pk descriptor\nCreate a new PkH descriptor\nCreate a new sh for a given redeem script Errors when …\nCreate a new sh sortedmulti descriptor with threshold k …\nCreate a new sh wrapper for the given wpkh descriptor\nCreate a new sh wrapper for the given wsh descriptor\nCreate a new sh wrapped wpkh from Pk. Errors when …\nCreate a new sh wrapped wsh descriptor with witness script …\nCreate a new sh wrapped wsh sortedmulti descriptor from …\nCreate new tr descriptor Errors when miniscript exceeds …\nCreate a new Wpkh descriptor Will return Err if …\nCreate a new wsh descriptor from witness script Errors …\nCreate a new wsh sorted multi descriptor Errors when …\nA node in the AST.\nOther top level checks that are context specific\nAttempt to parse a Script into Miniscript representation.\nParse a descriptor that may contain secret keys\nAttempt to parse an insane(scripts don’t clear sanity …\nAttempt to parse an miniscript with extra features that …\nGet the len of public key when serialized based on context …\nReturns a plan if the provided assets are sufficient to …\nReturns a plan if the provided assets are sufficient to …\nDescriptor policy\nWhether all spend paths of miniscript require a signature\nChecks whether the descriptor is safe.\nCheck whether the underlying Miniscript is safe under the …\nAttempts to produce a non-malleable satisfying witness and …\nAttempt to produce non-malleable satisfying witness for the\nAttempt to produce a malleable satisfying witness for the …\nComputes the scriptCode of a transaction output.\nComputes the scriptpubkey of the descriptor.\nSize, in bytes of the script-pubkey. If this Miniscript is …\nThe type of signature required for satisfaction\nSubstitutes raw public keys hashes with the public keys as …\nDescriptor templates\nSerialize a descriptor to string with its secret keys\nCheck top level consensus rules.\nCheck whether the top-level is type B\nConverts a descriptor using abstract keys to one using …\nTranslates a struct from one generic to another where the …\nThe correctness and malleability type information for the …\nComputes the scriptSig that will be in place for an …\nWhether the miniscript can exceed the resource …\nCompute the checksum of a descriptor, excludes any …\nCompute the checksum bytes of a descriptor, excludes any …\nError during base58 decoding\nBIP32 error\nErrors related to the parsing and usage of descriptors\nThe provided wallet descriptors are identical\nThe descriptor contains hardened derivation steps on …\nHex decoding error\nInvalid byte found in the descriptor checksum\nThe provided descriptor doesn’t match its checksum\nInvalid HD Key path, such as having a wildcard but a …\nError thrown while working with keys\nMiniscript error\nThe descriptor contains multipath keys\nKey-related error\nError while extracting and manipulating policies\nReturns the argument unchanged.\nCalls U::from(self).\nAbsolute timeclock timestamp\nCan not add to an item that is Satisfaction::None or …\nCan not add to an item that is …\nOptions to build the satisfaction field in the policy\nCan satisfy the policy item\nAn extra condition that must be satisfied but that is out …\nType for a map of sets of Condition items keyed by each set…\nECDSA Signature for a raw public key\nAn extended key fingerprint\nType for a map of folded sets of Condition items keyed by …\nSHA256 then RIPEMD160 preimage hash\nDouble SHA256 preimage hash\nIncompatible conditions (not currently used)\nIndex out of range for an item to satisfy a …\nCan not merge CSV or timelock values unless both are less …\nMulti-signature public keys with threshold count\nCannot satisfy or contribute to the policy item\nDon’t generate satisfaction field\nNot enough items are selected to satisfy a …\nOnly a partial satisfaction of some kind of threshold …\nCan reach the threshold of some kind of threshold policy\nA unique identifier for a key\nDescriptor spending policy\nErrors that can happen while extracting and manipulating …\nAnalyze the given PSBT to check for existing signatures\nLike Psbt variant and also check for expired timelocks\nA legacy public key\nRelative timelock locktime\nRIPEMD160 preimage hash\nRepresent if and how much a policy item is satisfied by …\nAn item that needs to be satisfied\nSchnorr Signature for a raw public key\nSHA256 preimage hash\nThreshold items with threshold count\nA x-only public key\nHow the wallet’s descriptor can satisfy this policy node\nOptional CheckSequenceVerify condition\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.\nReturn the conditions that are set by the spending policy …\nReturns a unique id for the SatisfiableItem\nIdentifier for this policy node\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).\nReturns whether the SatisfiableItem is a leaf item\nReturns whether the Satisfaction is a leaf item\nReturns true if there are no extra conditions to verify\nType of this policy node\nReturn whether or not a specific path in the policy tree …\nHow much a given PSBT already satisfies this policy node …\nOptional timelock condition\nCurrent blockchain height\nThe highest confirmation height between the inputs CSV …\nGiven PSBT\nExtra conditions that also need to be satisfied\nExtra conditions that also need to be satisfied\nExtra conditions that also need to be satisfied\nThe items that can be satisfied by the descriptor or are …\nThe items that can be satisfied by the descriptor\nThreshold\nThreshold\nTotal number of items\nTotal number of items\nWhether the items are sorted in lexicographic order (used …\nWhether the items are sorted in lexicographic order (used …\nThe digest value\nThe digest value\nThe digest value\nThe digest value\nThe policy items\nThe raw public key or extended key fingerprint\nThe required threshold count\nThe required threshold count\nThe timelock value\nThe timelock value\nBIP44 template. Expands to pkh(key/44'/{0,1}'/0'/{0,1}/*)\nBIP44 public template. Expands to pkh(key/{0,1}/*)\nBIP49 template. Expands to …\nBIP49 public template. Expands to sh(wpkh(key/{0,1}/*))\nBIP84 template. Expands to wpkh(key/84'/{0,1}'/0'/{0,1}/*)\nBIP84 public template. Expands to wpkh(key/{0,1}/*)\nBIP86 template. Expands to tr(key/86'/{0,1}'/0'/{0,1}/*)\nBIP86 public template. Expands to tr(key/{0,1}/*)\nTrait for descriptor templates that can be built into a …\nType alias for the return type of DescriptorTemplate, …\nP2PKH template. Expands to a descriptor pkh(key)\nP2TR template. Expands to a descriptor tr(key)\nP2WPKH template. Expands to a descriptor wpkh(key)\nP2WPKH-P2SH template. Expands to a descriptor sh(wpkh(key))\nBuild the complete descriptor\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.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\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).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nBIP32 error\nTrait for keys that can be derived.\nContainer for public or secret keys\nThe descriptor pubkey, either a single pubkey or an xpub.\nThe descriptor secret key, either a single private key or …\nType specifying the amount of entropy required e.g. [u8;32]\nReturned error in case of failure\nTrait that adds extra useful methods to ScriptContexts\nEnum for extended keys that can be either xprv or xpub\nA bitcoin public key (compressed or uncompressed).\nTrait that allows generating a key with the default options\nTrait for keys that can be generated\nOutput of a GeneratableKey key generation\nTrait for objects that can be turned into a public or …\nThe key has an invalid checksum\nThe key is not valid for the given network\nThe key cannot exist in the given script context\nThe consensus key associated with the type. Must be a …\nErrors thrown while working with keys\nAlias type for a map of public key to secret key\nLegacy scripts\nCustom error message\nMiniscript error\nMultiple extended private keys.\nMultiple extended public keys.\nExtra options required by the generate_with_entropy\nA private extended key, aka an xprv\nOptions for generating a PrivateKey\nA public extended key, aka an xpub\nThe ScriptContext for Miniscript. Additional type …\nEnum representation of the known valid ScriptContexts\nSegwitv0 scripts\nSingle public key.\nSingle private key.\nA descriptor bitcoin::PrivateKey with optional origin …\nA descriptor SinglePubKey with optional origin information.\nSingle public key without any origin or range information.\nContents of a “sortedmulti” descriptor\nTaproot scripts\nSet of valid networks for a key\nAn xonly public key.\nExtended private key (xpriv).\nExtended public key (xpub).\nCreate a set containing mainnet, testnet, signet, and …\nReturns the ScriptContext as a ScriptContextEnum\nReplaces any wildcard (i.e. /*) in the key with a …\nAttempt to produce a witness template given the assets …\nDepending on script Context, some of the Terminals might …\nDepending on script Context, some of the script resource …\nCheck the consensus + policy(if not disabled) rules that …\nConsensus rules at the Miniscript satisfaction time. It is …\nPolicy rules at the Miniscript satisfaction time. It is …\nCheck the consensus + policy(if not disabled) rules …\nEach context has slightly different rules on what Pks are …\nDepending on ScriptContext, fragments can be malleable. …\nCheck whether the given satisfaction is valid under the …\nWhether the generated key should be “compressed” or not\nDeprecated name for Self::at_derivation_index.\nEncode as a Bitcoin script\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.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCreate an instance given a public key and a set of valid …\nCreate an instance given a secret key and a set of valid …\nParse an expression tree into a SortedMultiVec\nFull path, from the master key\nReturns a vector containing the full derivation paths from …\nGenerate a key given the options with a random entropy\nGenerate a key with the default options and a random …\nGenerate a key given the extra options and the entropy\nGenerate a key with the default options and a given entropy\nReturn whether or not the key contains the private data\nWhether or not the key has a wildcard\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).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nTurn the key into a DescriptorKey within the requested …\nConsume self and turn it into a DescriptorKey by adding …\nConsume self and turn it into an ExtendedKey\nConsumes self and returns the key\nGet as many keys as derivation paths in this key.\nGet as many keys as derivation paths in this key.\nTransform the ExtendedKey into an Xpriv for the given …\nTransform the ExtendedKey into an Xpub for the given …\nWhether or not the key has a wildcard\nReturns whether the script context is Legacy\nReturns whether the script context is …\nWhether or not this key has multiple derivation paths.\nWhether or not this key has multiple derivation paths.\nReturns whether the script context is Segwitv0\nReturns whether the script context is …\nReturns whether the script context is Tap, aka Taproot or …\nReturns whether the script context is …\nsignatures required\nThe public key.\nThe private key.\nCreate a set only containing mainnet\nThe fingerprint of the master key associated with this …\nDepending on script context, the size of a satifaction …\nMaximum size, in bytes, of a satisfying witness. In …\nMaximum number of witness elements used to satisfy the …\nCompute the intersection of two sets\nLocal helper function to display error messages with …\nCreate a new instance of SortedMultiVec given a list of …\nOrigin information (fingerprint and derivation path).\nOrigin information (fingerprint and derivation path).\nOther top level checks that are context specific\nOverride the computed set of valid networks\nGet the len of public key when serialized based on context …\npublic keys inside sorted Multi\nutility function to sanity a sorted multi vec\nAttempt to produce a satisfying witness for the witness …\nSize, in bytes of the script-pubkey. If this Miniscript is …\nThe type of signature required for satisfaction\nCreate Terminal::Multi containing sorted pubkeys\nCreate a set containing testnet and regtest\nReturns the public version of this key.\nCheck top level consensus rules.\nCheck whether the top-level is type B\nThis will panic if fpk returns an uncompressed key when …\nTrait to add functions to extract utxos and calculate fees.\nThe total transaction fee amount, sum of input amounts …\nThe transaction’s fee rate. This value will only be …\nGet the TxOut for the specified input index, if it doesn’…\nA derived address and the index it was found at. For …\nAn error that may occur when applying a block to Wallet.\nBalance, differentiated into various categories.\nOccurs when the update chain cannot connect with original …\nThe changes made to a wallet by applying an Update.\nThe error variant that occurs when the caller attempts to …\nThere was problem with the passed-in descriptor(s).\nThere was a problem with the passed-in descriptor(s).\nThere is a problem with the passed-in descriptor.\nAn error that may occur when inserting a transaction into …\nTrait to check if a value is below the dust limit. We are …\nThe error type when loading a Wallet from persistence.\nThe loaded desccriptor does not match what was provided.\nThe loaded genesis hash does not match what was provided.\nThe loaded network type does not match what was provided.\nData loaded from persistence is missing descriptor.\nData loaded from persistence is missing genesis hash.\nData loaded from persistence is missing network type.\nThe error type when constructing a fresh Wallet.\nError type for when we try load a Wallet from persistence …\nDatabase already has data.\nWallet not initialized, persistence backend is empty.\nWallet is not initialized, persistence backend is empty.\nWe were unable to write the wallet’s data to the …\nLoading data from the persistence backend failed.\nEither writing to or loading from the persistence backend …\nOccurs when the connected_to hash does not match the hash …\nAn update to Wallet.\nA Bitcoin wallet\nAdd an external signer\nAddress\nGet unbounded script pubkey iterators for both Internal …\nIntroduces a block of height to the wallet, and tries to …\nApplies relevant transactions from block of height to the …\nApply relevant unconfirmed transactions to the wallet.\nApplies an update to the wallet and stages the changes …\nReturn the balance, separated into available, …\nBump the fee of a transaction previously created with this …\nStart building a transaction.\nCalculates the fee of a given transaction. Returns …\nCalculate the FeeRate for a given transaction.\nInforms the wallet that you no longer intend to broadcast …\nChanges to the LocalChain.\nUpdate for the wallet’s internal LocalChain.\nGet all the checkpoints the wallet is currently storing …\nCoin selection\nCommits all currently staged changed to the persistence …\nConfirmed and immediately spendable balance\nThe derivation index of this wallet. It will return None …\nFinds how the wallet derived the script pubkey spk.\nReturn the checksum of the public descriptor associated to …\nErrors that can be thrown by the Wallet\nWallet export\nFinalize a PSBT, i.e., for each input determine if …\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.\nReturns the descriptor used to create addresses for a …\nget the corresponding PSBT Input for a LocalUtxo\nGet the signers\nGet a single transaction from the wallet as a CanonicalTx …\nReturns the utxo owned by this wallet corresponding to …\nUpdate for the wallet’s internal TxGraph.\nAll coinbase outputs not yet matured\nChild index of this address\nChanges to IndexedTxGraph.\nAdd a new checkpoint to the wallet’s internal view of …\nAdd a transaction to the wallet’s internal view of the …\nInserts a TxOut at OutPoint into the wallet’s …\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).\nCheck whether or not a value is below dust limit\nReturn whether or not a script is part of this wallet …\nType of keychain\nIterator over all keychains in this wallet\nContains the last active derivation indices per keychain (K…\nReturns the latest checkpoint.\nList all relevant outputs (includes both spent and …\nReturn the list of unspent outputs of this wallet\nList addresses that are revealed but unused.\nLoad Wallet from the given persistence backend.\nGet a reference to the inner LocalChain.\nMarks an address used of the given keychain at index.\nGet the Bitcoin network the wallet is using.\nStores the network type of the transaction data.\nInitialize an empty Wallet.\nCreates a wallet that does not persist data.\nCreates a wallet that does not persist data, with a custom …\nEither loads Wallet from persistence, or initializes it if …\nEither loads Wallet from persistence, or initializes it if …\nInitialize an empty Wallet with a custom genesis hash.\nThe index of the next address that you would get if you …\nGet the next unused address for the given keychain, i.e. …\nPeek an address of the given keychain at index without …\nReturn the spending policies for the wallet’s descriptor\nReturn the “public” version of the wallet’s …\nReveal addresses up to and including the target index and …\nAttempt to reveal the next address of the given keychain.\nReturn the secp256k1 context used for all signing …\nCompute the tx’s sent and received Amounts.\nSign a transaction with all the wallet’s signers, in the …\nGeneralized signers\nGet a reference to the inner KeychainTxOutIndex.\nReturns the changes that will be committed with the next …\nCreate a `FullScanRequest for this wallet.\nCreate a partial SyncRequest for this wallet for all …\nGet the whole balance visible to the wallet.\nIterate over the transactions in the wallet.\nUnconfirmed UTXOs generated by a wallet tx\nGet sum of trusted_pending and confirmed coins.\nTransaction builder\nGet a reference to the inner TxGraph.\nGet an unbounded script pubkey iterator for the given …\nUndoes the effect of mark_used and returns whether the …\nUnconfirmed UTXOs received from an external wallet\nDeterministically generate a unique name given the …\nBlock hash of connected_to.\nExpected block hash of connected_to, as derived from block.\nThe internal chain’s tip height.\nThe introduced transaction’s confirmation height.\nThe expected genesis block hash.\nThe expected network type.\nThe block hash loaded from persistence.\nThe network type loaded from persistence.\nThe descriptor loaded from persistence.\nThe keychain of the descriptor not matching\nBranch and bound coin selection tries to avoid needing a …\nBranch and bound coin selection possible attempts with …\nBranch and bound coin selection\nIt’s possible to create spendable output from excess …\nTrait for generalized coin selection algorithms\nResult of a successful coin selection\nDefault coin selection algorithm used by TxBuilder if not …\nErrors that can be thrown by the coin_selection module\nRemaining amount after performing coin selection\nWallet’s UTXO set is not enough to cover recipient’s …\nSimple and dumb coin selection\nIt’s not possible to create spendable output from excess …\nOldestFirstCoinSelection always picks the utxo with the …\nPerform the coin selection\nDecide if change can be created\nRemaining amount after deducing fees and outgoing outputs\nTotal fee amount for the selected utxos in satoshis\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nThe total value of the inputs selected from the local …\nCreate new instance with target size for change output\nList of outputs selected for use as inputs\nThe total value of the inputs selected.\nSats available for spending\nSats needed for some transaction\nEffective amount available to create change after …\nThe calculated fee for the drain TxOut with the selected …\nThreshold to consider amount as dust for this particular …\nThe deducted change output fee\nExceeding amount of current selection over outgoing value …\nError returned from Wallet::build_fee_bump\nThere was an error with coin selection\nDescriptor key conversion error\nError returned from TxBuilder::finish\nThere was a problem with the descriptors passed in\nWhen bumping a tx the fee rate requested is lower than …\nNode doesn’t have data to estimate a fee rate\nWhen bumping a tx the absolute fee requested is lower than …\nTrying to replace a tx that has a sequence >= 0xFFFFFFFE\nRequested LockTime is less than is required to spend from …\nMiniscript PSBT error\nErrors returned by miniscript when updating inconsistent …\nIn order to use the TxBuilder::add_global_xpubs option …\nMissing non_witness_utxo on foreign utxo for given OutPoint\nCannot build a tx without recipients\nmanually_selected_only option is selected but no utxo has …\nOutput created is under the dust limit, 546 satoshis\nReturn error type for …\nWe were unable to load wallet data from or write wallet …\nThere was a problem while extracting and manipulating …\nPartially signed bitcoin transaction error\nCannot enable RBF with a Sequence >= 0xFFFFFFFE\nCannot enable RBF with Sequence given a required OP_CSV\nSpending policy is not compatible with this KeychainKind\nHappens when trying to bump a transaction that is already …\nThrown when a tx is not found in the internal database\nHappens when trying to spend an UTXO that is not in the …\nHappens when trying to spend an UTXO that is not in the …\nReturn error type for PsbtExt::update_input_with_descriptor\nRequested invalid transaction version ‘0’\nRequested transaction version 1, but at least 2 is needed …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nRequired OP_CSV Sequence\nGiven RBF Sequence\nRequested LockTime\nRequired LockTime\nRequired fee absolute value Amount\nRequired fee rate\nStructure that contains the export of a wallet\nAlias for FullyNodedExport\nEarliest block to rescan when looking for the wallet’s …\nEarliest block to rescan when looking for the wallet’s …\nReturn the internal descriptor, if present\nReturn the external descriptor\nExport a wallet\nReturns the argument unchanged.\nCalls U::from(self).\nArbitrary label for the wallet\nArbitrary label for the wallet\nThe signer will sign all the leaves it has a key for.\nDummy identifier\nThe signer won’t sign the specified leaves.\nTo be used only by external libraries implementing …\nThe fingerprint of a BIP32 extended key\nThe signer won’t sign leaves other than the ones …\nInput index is out of range\nPSBT Input signer\nThe private key in use has the right fingerprint but …\nThe non_witness_utxo specified is invalid\nInvalid SIGHASH for the signing context in use\nLegacy context\nMiniscript PSBT error\nThe fingerprint and derivation path are missing from the …\nThe private key is missing for the required public key\nThe non_witness_utxo field of the transaction is required …\nThe witness_script field of the transaction is required to …\nThe witness_utxo field of the transaction is required to …\nThe psbt contains a non-SIGHASH_ALL sighash in one of its …\nThe signer won’t sign any leaf.\nBitcoin HASH160 (RIPEMD160 after SHA256) hash of an ECDSA …\nSegwit v0 context (BIP 143)\nError while computing the hash to sign\nOptions for a software signer\nCommon signer methods\nSigning context\nSigning error\nIdentifier of a signer in the SignersContainers. Used as a …\nDefines the order in which signers are called\nWrapper to pair a signer with its context\nContainer for multiple signers\nTaproot context (BIP 340)\nCustomize which taproot script-path leaves the signer …\nPSBT signer\nThe user canceled the operation\nAdds an external signer to the container for the specified …\nWhether the signer should use the sighash_type set in the …\nWhether we should grind ECDSA signature to ensure signing …\nCreate a map of public keys to secret keys\nWhether the wallet should assume a specific height has …\nBuild a new signer container from a KeyMap\nReturn the secret key for the signer\nFinds the signer with lowest ordering for a given id in …\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.\nReturn the SignerId for this signer\nReturns the list of identifiers of all the signers in the …\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).\nCreate a wrapped signer from a signer and a context\nDefault constructor\nRemoves a signer from the container and returns it\nWhether to remove partial signatures from the PSBT inputs …\nWhether to remove taproot specific fields from the PSBT on …\nSign a single psbt input\nSign all the inputs of the psbt\nWhether we should try to sign a taproot transaction with …\nReturns the list of signers in the container, sorted by …\nSpecifies which Taproot script-spend leaves we should sign …\nWhether the signer should trust the witness_utxo, if the …\nWhether to try finalizing the PSBT after the inputs are …\nWhether the signer can sign for the internal key or not\nError returned from TxBuilder::add_foreign_utxo.\nError returned from TxBuilder::add_utxo and …\nBIP69 / Lexicographic\nUse both change and non-change outputs (default)\nOnly use non-change outputs (see …\nPolicy regarding the use of change outputs when creating a …\nRequested outpoint doesn’t exist in the tx (vout greater …\nForeign utxo outpoint txid does not match PSBT input txid\nForeign utxo missing witness_utxo or non_witness_utxo\nOnly use change outputs (see TxBuilder::only_spend_change)\nRandomized (default)\nA transaction builder\nOrdering of the transaction’s inputs and outputs\nHappens when trying to spend an UTXO that is not in the …\nUnchanged\nAdd data as an output, using OP_RETURN\nAdd a foreign UTXO i.e. a UTXO not owned by this wallet.\nSame as add_foreign_utxo but allows to set the nSequence …\nFill-in the PSBT_GLOBAL_XPUB field with the extended keys …\nAdd a recipient to the internal list\nAdd a utxo to the internal list of unspendable utxos\nAdd a utxo to the internal list of utxos that must be spent\nAdd the list of outpoints to the internal list of UTXOs …\nSet whether or not the dust limit is checked.\nSet a specific ChangeSpendPolicy. See …\nChoose the coin selection algorithm\nSet the current blockchain height.\nDo not spend change outputs\nSets the address to drain excess coins to.\nSpend all the available inputs. This respects filters like …\nEnable signaling RBF\nEnable signaling RBF with a specific nSequence value\nSet an absolute fee The fee_absolute method refers to the …\nSet a custom fee rate.\nFinish building the transaction.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nFill-in the psbt::Output::redeem_script and …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nOnly spend utxos added by add_utxo.\nUse a specific nLockTime while creating the transaction\nOnly spend change outputs\nOnly Fill-in the psbt::Input::witness_utxo field when …\nChoose the ordering for inputs and outputs of the …\nSet the policy path to use while creating the transaction …\nReplace the recipients already added with a new list\nSign with a specific sig hash\nSort transaction inputs and outputs by TxOrdering variant\nReplace the internal list of unspendable utxos with a new …\nBuild a transaction with a specific version\nForeign UTXO outpoint\nPSBT input txid") \ No newline at end of file +searchState.loadedDescShard("bdk_wallet", 0, "BDK Wallet\nExternal keychain, used for deriving recipient addresses.\nA UTXO owned by another wallet.\nInternal keychain, used for deriving change addresses.\nTypes of keychains\nA UTXO owned by the local wallet.\nAn unspent output owned by a Wallet.\nAn unspent transaction output (UTXO).\nA Utxo with its satisfaction_weight.\nReturn KeychainKind as a byte\nThe confirmation time for transaction containing this utxo\nThe derivation index for the script pubkey in the wallet\nDescriptors\nMacro to write full descriptors with code\nMacro to write descriptor fragments with code\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether this UTXO is spent or not\nType of keychain\nKey formats\nGet the location of the UTXO\nReference to a transaction output\nAdditional functions on the rust-bitcoin Psbt structure.\nThe weight of the witness data and scriptSig expressed in …\nGet the sequence number if an explicit sequence number has …\nGet the TxOut of the UTXO\nTransaction output\nThe UTXO\nGet the version of BDK at runtime\nWallet\nThe location of the output.\nThe information about the input we require to add it to a …\nThe nSequence value to set for this input.\nA raw scriptpubkey (including pay-to-pubkey) under Legacy …\nA raw scriptpubkey (including pay-to-pubkey) under Legacy …\nA raw scriptpubkey (including pay-to-pubkey) under Legacy …\nAlias for a Descriptor that contains extended derived keys\nScript descriptor\nThe descriptor pubkey, either a single pubkey or an xpub.\nAlias for a Descriptor that can contain extended keys …\nTrait implemented on Descriptors to add a method to …\nThe 0 combinator.\nAlias for the type of maps that represent derivation paths …\nTrait for types which can be converted into an …\nThe consensus key associated with the type. Must be a …\nLegacy ScriptContext To be used as P2SH scripts For …\nThe top-level miniscript abstract syntax tree (AST).\nMultiple extended public keys.\nPay-to-PubKey-Hash\nPay-to-PubKey-Hash\nPay-to-PubKey-Hash\nThe ScriptContext for Miniscript. Additional type …\nSegwitv0 ScriptContext\nPay-to-ScriptHash(includes nested wsh/wpkh/sorted multi)\nPay-to-ScriptHash(includes nested wsh/wpkh/sorted multi)\nPay-to-ScriptHash(includes nested wsh/wpkh/sorted multi)\nSingle public key.\nThe 1 combinator.\nAlias for the type of maps that represent taproot key …\nPay-to-Taproot\nPay-to-Taproot\nPay-to-Taproot\nPay-to-Witness-PubKey-Hash\nPay-to-Witness-PubKey-Hash\nPay-to-Witness-PubKey-Hash\nPay-to-Witness-ScriptHash with Segwitv0 context\nPay-to-Witness-ScriptHash with Segwitv0 context\nPay-to-Witness-ScriptHash with Segwitv0 context\nExtended public key (xpub).\nComputes the Bitcoin address of the descriptor, if one …\nGet a reference to the inner AstElem representing the root …\nReplaces all wildcards (i.e. /*) in the descriptor with a …\nEnumerates all child nodes of the current AST node (self) …\nAttempt to produce a non-malleable witness template given …\nAttempt to produce a malleable witness template given the …\nDepending on script Context, some of the Terminals might …\nDepending on script Context, some of the script resource …\nCheck the consensus + policy(if not disabled) rules that …\nConsensus rules at the Miniscript satisfaction time. It is …\nPolicy rules at the Miniscript satisfaction time. It is …\nCheck the consensus + policy(if not disabled) rules …\nEach context has slightly different rules on what Pks are …\nDepending on ScriptContext, fragments can be malleable. …\nCheck whether the given satisfaction is valid under the …\nDescriptor checksum\nWhether the given miniscript contains a raw pkh fragment\nDeprecated name for Self::at_derivation_index.\nConvert all the public keys in the descriptor to …\nConvert all the public keys in the descriptor to …\nGet the DescriptorType of Descriptor\nEncode as a Bitcoin script\nDescriptor errors\nComputes the the underlying script before any hashing is …\nAdditional information helpful for extra analysis.\nCheck whether the miniscript follows the given Extra …\nExtract the spending policy\nUtility method for deriving the descriptor at each index …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nAdd type information(Type and Extdata) to Miniscript based …\nCreate a new Miniscript from a Terminal node and a Type …\nParse a Miniscript from string and perform sanity checks …\nAttempt to parse an Miniscripts that don’t follow the …\nAttempt to parse an insane(scripts don’t clear sanity …\nParse an expression tree into a descriptor.\nParse an expression tree into a Miniscript. As a general …\nReturns child node with given index, if any\nReturns Option::Some with cloned n’th public key from …\nReturns satisfying non-malleable witness and scriptSig to …\nReturns a possilbly mallable satisfying non-malleable …\nWhether the miniscript contains a combination of timelocks\nWhether the miniscript has repeated Pk or Pkh\nWhether or not the descriptor has any wildcards i.e. /*.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nExtracts the AstElem representing the root of the …\nGet as many descriptors as different paths in this …\nConvert to wallet descriptor\nWhether or not the descriptor has any wildcards\nWhether this descriptor contains a key that has multiple …\nWhether the miniscript is malleable\nCreates a new Iter iterator that will iterate over all …\nCreates a new PkIter iterator that will iterate over all …\nLifting corresponds to conversion of a miniscript into a …\nDepending on script context, the size of a satifaction …\nMaximum size, in bytes, of a satisfying witness. For …\nComputes an upper bound on the weight of a satisfying …\nMaximum number of witness elements used to satisfy the …\nComputes an upper bound on the difference between a …\nLocal helper function to display error messages with …\nCreate a new bare descriptor from witness script Errors …\nCreate a new pk descriptor\nCreate a new PkH descriptor\nCreate a new sh for a given redeem script Errors when …\nCreate a new sh sortedmulti descriptor with threshold k …\nCreate a new sh wrapper for the given wpkh descriptor\nCreate a new sh wrapper for the given wsh descriptor\nCreate a new sh wrapped wpkh from Pk. Errors when …\nCreate a new sh wrapped wsh descriptor with witness script …\nCreate a new sh wrapped wsh sortedmulti descriptor from …\nCreate new tr descriptor Errors when miniscript exceeds …\nCreate a new Wpkh descriptor Will return Err if …\nCreate a new wsh descriptor from witness script Errors …\nCreate a new wsh sorted multi descriptor Errors when …\nA node in the AST.\nOther top level checks that are context specific\nAttempt to parse a Script into Miniscript representation.\nParse a descriptor that may contain secret keys\nAttempt to parse an insane(scripts don’t clear sanity …\nAttempt to parse an miniscript with extra features that …\nGet the len of public key when serialized based on context …\nReturns a plan if the provided assets are sufficient to …\nReturns a plan if the provided assets are sufficient to …\nDescriptor policy\nWhether all spend paths of miniscript require a signature\nChecks whether the descriptor is safe.\nCheck whether the underlying Miniscript is safe under the …\nAttempts to produce a non-malleable satisfying witness and …\nAttempt to produce non-malleable satisfying witness for the\nAttempt to produce a malleable satisfying witness for the …\nComputes the scriptCode of a transaction output.\nComputes the scriptpubkey of the descriptor.\nSize, in bytes of the script-pubkey. If this Miniscript is …\nThe type of signature required for satisfaction\nSubstitutes raw public keys hashes with the public keys as …\nDescriptor templates\nSerialize a descriptor to string with its secret keys\nCheck top level consensus rules.\nCheck whether the top-level is type B\nConverts a descriptor using abstract keys to one using …\nTranslates a struct from one generic to another where the …\nThe correctness and malleability type information for the …\nComputes the scriptSig that will be in place for an …\nWhether the miniscript can exceed the resource …\nCompute the checksum of a descriptor, excludes any …\nCompute the checksum bytes of a descriptor, excludes any …\nError during base58 decoding\nBIP32 error\nErrors related to the parsing and usage of descriptors\nThe provided wallet descriptors are identical\nThe descriptor contains hardened derivation steps on …\nHex decoding error\nInvalid byte found in the descriptor checksum\nThe provided descriptor doesn’t match its checksum\nInvalid HD Key path, such as having a wildcard but a …\nError thrown while working with keys\nMiniscript error\nThe descriptor contains multipath keys\nKey-related error\nError while extracting and manipulating policies\nReturns the argument unchanged.\nCalls U::from(self).\nAbsolute timeclock timestamp\nCan not add to an item that is Satisfaction::None or …\nCan not add to an item that is …\nOptions to build the satisfaction field in the policy\nCan satisfy the policy item\nAn extra condition that must be satisfied but that is out …\nType for a map of sets of Condition items keyed by each set…\nECDSA Signature for a raw public key\nAn extended key fingerprint\nType for a map of folded sets of Condition items keyed by …\nSHA256 then RIPEMD160 preimage hash\nDouble SHA256 preimage hash\nIncompatible conditions (not currently used)\nIndex out of range for an item to satisfy a …\nCan not merge CSV or timelock values unless both are less …\nMulti-signature public keys with threshold count\nCannot satisfy or contribute to the policy item\nDon’t generate satisfaction field\nNot enough items are selected to satisfy a …\nOnly a partial satisfaction of some kind of threshold …\nCan reach the threshold of some kind of threshold policy\nA unique identifier for a key\nDescriptor spending policy\nErrors that can happen while extracting and manipulating …\nAnalyze the given PSBT to check for existing signatures\nLike Psbt variant and also check for expired timelocks\nA legacy public key\nRelative timelock locktime\nRIPEMD160 preimage hash\nRepresent if and how much a policy item is satisfied by …\nAn item that needs to be satisfied\nSchnorr Signature for a raw public key\nSHA256 preimage hash\nThreshold items with threshold count\nA x-only public key\nHow the wallet’s descriptor can satisfy this policy node\nOptional CheckSequenceVerify condition\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.\nReturn the conditions that are set by the spending policy …\nReturns a unique id for the SatisfiableItem\nIdentifier for this policy node\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).\nReturns whether the SatisfiableItem is a leaf item\nReturns whether the Satisfaction is a leaf item\nReturns true if there are no extra conditions to verify\nType of this policy node\nReturn whether or not a specific path in the policy tree …\nHow much a given PSBT already satisfies this policy node …\nOptional timelock condition\nCurrent blockchain height\nThe highest confirmation height between the inputs CSV …\nGiven PSBT\nExtra conditions that also need to be satisfied\nExtra conditions that also need to be satisfied\nExtra conditions that also need to be satisfied\nThe items that can be satisfied by the descriptor or are …\nThe items that can be satisfied by the descriptor\nThreshold\nThreshold\nTotal number of items\nTotal number of items\nWhether the items are sorted in lexicographic order (used …\nWhether the items are sorted in lexicographic order (used …\nThe digest value\nThe digest value\nThe digest value\nThe digest value\nThe policy items\nThe raw public key or extended key fingerprint\nThe required threshold count\nThe required threshold count\nThe timelock value\nThe timelock value\nBIP44 template. Expands to pkh(key/44'/{0,1}'/0'/{0,1}/*)\nBIP44 public template. Expands to pkh(key/{0,1}/*)\nBIP49 template. Expands to …\nBIP49 public template. Expands to sh(wpkh(key/{0,1}/*))\nBIP84 template. Expands to wpkh(key/84'/{0,1}'/0'/{0,1}/*)\nBIP84 public template. Expands to wpkh(key/{0,1}/*)\nBIP86 template. Expands to tr(key/86'/{0,1}'/0'/{0,1}/*)\nBIP86 public template. Expands to tr(key/{0,1}/*)\nTrait for descriptor templates that can be built into a …\nType alias for the return type of DescriptorTemplate, …\nP2PKH template. Expands to a descriptor pkh(key)\nP2TR template. Expands to a descriptor tr(key)\nP2WPKH template. Expands to a descriptor wpkh(key)\nP2WPKH-P2SH template. Expands to a descriptor sh(wpkh(key))\nBuild the complete descriptor\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.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\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).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nBIP32 error\nTrait for keys that can be derived.\nContainer for public or secret keys\nThe descriptor pubkey, either a single pubkey or an xpub.\nThe descriptor secret key, either a single private key or …\nType specifying the amount of entropy required e.g. [u8;32]\nReturned error in case of failure\nTrait that adds extra useful methods to ScriptContexts\nEnum for extended keys that can be either xprv or xpub\nA bitcoin public key (compressed or uncompressed).\nTrait that allows generating a key with the default options\nTrait for keys that can be generated\nOutput of a GeneratableKey key generation\nTrait for objects that can be turned into a public or …\nThe key has an invalid checksum\nThe key is not valid for the given network\nThe key cannot exist in the given script context\nThe consensus key associated with the type. Must be a …\nErrors thrown while working with keys\nAlias type for a map of public key to secret key\nLegacy scripts\nCustom error message\nMiniscript error\nMultiple extended private keys.\nMultiple extended public keys.\nExtra options required by the generate_with_entropy\nA private extended key, aka an xprv\nOptions for generating a PrivateKey\nA public extended key, aka an xpub\nThe ScriptContext for Miniscript. Additional type …\nEnum representation of the known valid ScriptContexts\nSegwitv0 scripts\nSingle public key.\nSingle private key.\nA descriptor bitcoin::PrivateKey with optional origin …\nA descriptor SinglePubKey with optional origin information.\nSingle public key without any origin or range information.\nContents of a “sortedmulti” descriptor\nTaproot scripts\nSet of valid networks for a key\nAn xonly public key.\nExtended private key (xpriv).\nExtended public key (xpub).\nCreate a set containing mainnet, testnet, signet, and …\nReturns the ScriptContext as a ScriptContextEnum\nReplaces any wildcard (i.e. /*) in the key with a …\nAttempt to produce a witness template given the assets …\nDepending on script Context, some of the Terminals might …\nDepending on script Context, some of the script resource …\nCheck the consensus + policy(if not disabled) rules that …\nConsensus rules at the Miniscript satisfaction time. It is …\nPolicy rules at the Miniscript satisfaction time. It is …\nCheck the consensus + policy(if not disabled) rules …\nEach context has slightly different rules on what Pks are …\nDepending on ScriptContext, fragments can be malleable. …\nCheck whether the given satisfaction is valid under the …\nWhether the generated key should be “compressed” or not\nDeprecated name for Self::at_derivation_index.\nEncode as a Bitcoin script\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.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCreate an instance given a public key and a set of valid …\nCreate an instance given a secret key and a set of valid …\nParse an expression tree into a SortedMultiVec\nFull path, from the master key\nReturns a vector containing the full derivation paths from …\nGenerate a key given the options with a random entropy\nGenerate a key with the default options and a random …\nGenerate a key given the extra options and the entropy\nGenerate a key with the default options and a given entropy\nReturn whether or not the key contains the private data\nWhether or not the key has a wildcard\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).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nTurn the key into a DescriptorKey within the requested …\nConsume self and turn it into a DescriptorKey by adding …\nConsume self and turn it into an ExtendedKey\nConsumes self and returns the key\nGet as many keys as derivation paths in this key.\nGet as many keys as derivation paths in this key.\nTransform the ExtendedKey into an Xpriv for the given …\nTransform the ExtendedKey into an Xpub for the given …\nWhether or not the key has a wildcard\nReturns whether the script context is Legacy\nReturns whether the script context is …\nWhether or not this key has multiple derivation paths.\nWhether or not this key has multiple derivation paths.\nReturns whether the script context is Segwitv0\nReturns whether the script context is …\nReturns whether the script context is Tap, aka Taproot or …\nReturns whether the script context is …\nThe threshold value for the multisig.\nThe public key.\nThe private key.\nCreate a set only containing mainnet\nThe fingerprint of the master key associated with this …\nDepending on script context, the size of a satifaction …\nMaximum size, in bytes, of a satisfying witness. In …\nMaximum number of witness elements used to satisfy the …\nCompute the intersection of two sets\nThe number of keys in the multisig.\nLocal helper function to display error messages with …\nCreate a new instance of SortedMultiVec given a list of …\nOrigin information (fingerprint and derivation path).\nOrigin information (fingerprint and derivation path).\nOther top level checks that are context specific\nOverride the computed set of valid networks\nGet the len of public key when serialized based on context …\nAccessor for the public keys in the multisig.\nutility function to sanity a sorted multi vec\nAttempt to produce a satisfying witness for the witness …\nSize, in bytes of the script-pubkey. If this Miniscript is …\nThe type of signature required for satisfaction\nCreate Terminal::Multi containing sorted pubkeys\nCreate a set containing testnet and regtest\nReturns the public version of this key.\nCheck top level consensus rules.\nCheck whether the top-level is type B\nThis will panic if fpk returns an uncompressed key when …\nTrait to add functions to extract utxos and calculate fees.\nThe total transaction fee amount, sum of input amounts …\nThe transaction’s fee rate. This value will only be …\nGet the TxOut for the specified input index, if it doesn’…\nA derived address and the index it was found at. For …\nAn error that may occur when applying a block to Wallet.\nBalance, differentiated into various categories.\nOccurs when the update chain cannot connect with original …\nThe changes made to a wallet by applying an Update.\nThe error variant that occurs when the caller attempts to …\nThere was problem with the passed-in descriptor(s).\nThere was a problem with the passed-in descriptor(s).\nThere is a problem with the passed-in descriptor.\nAn error that may occur when inserting a transaction into …\nTrait to check if a value is below the dust limit. We are …\nThe error type when loading a Wallet from persistence.\nThe loaded desccriptor does not match what was provided.\nThe loaded genesis hash does not match what was provided.\nThe loaded network type does not match what was provided.\nData loaded from persistence is missing descriptor.\nData loaded from persistence is missing genesis hash.\nData loaded from persistence is missing network type.\nThe error type when constructing a fresh Wallet.\nError type for when we try load a Wallet from persistence …\nDatabase already has data.\nWallet not initialized, persistence backend is empty.\nWallet is not initialized, persistence backend is empty.\nWe were unable to write the wallet’s data to the …\nLoading data from the persistence backend failed.\nEither writing to or loading from the persistence backend …\nOccurs when the connected_to hash does not match the hash …\nAn update to Wallet.\nA Bitcoin wallet\nAdd an external signer\nAddress\nGet unbounded script pubkey iterators for both Internal …\nIntroduces a block of height to the wallet, and tries to …\nApplies relevant transactions from block of height to the …\nApply relevant unconfirmed transactions to the wallet.\nApplies an update to the wallet and stages the changes …\nReturn the balance, separated into available, …\nBump the fee of a transaction previously created with this …\nStart building a transaction.\nCalculates the fee of a given transaction. Returns …\nCalculate the FeeRate for a given transaction.\nInforms the wallet that you no longer intend to broadcast …\nChanges to the LocalChain.\nUpdate for the wallet’s internal LocalChain.\nGet all the checkpoints the wallet is currently storing …\nCoin selection\nCommits all currently staged changed to the persistence …\nConfirmed and immediately spendable balance\nThe derivation index of this wallet. It will return None …\nFinds how the wallet derived the script pubkey spk.\nReturn the checksum of the public descriptor associated to …\nErrors that can be thrown by the Wallet\nWallet export\nFinalize a PSBT, i.e., for each input determine if …\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.\nReturns the descriptor used to create addresses for a …\nget the corresponding PSBT Input for a LocalUtxo\nGet the signers\nGet a single transaction from the wallet as a CanonicalTx …\nReturns the utxo owned by this wallet corresponding to …\nUpdate for the wallet’s internal TxGraph.\nAll coinbase outputs not yet matured\nChild index of this address\nChanges to IndexedTxGraph.\nAdd a new checkpoint to the wallet’s internal view of …\nAdd a transaction to the wallet’s internal view of the …\nInserts a TxOut at OutPoint into the wallet’s …\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).\nCheck whether or not a value is below dust limit\nReturn whether or not a script is part of this wallet …\nType of keychain\nIterator over all keychains in this wallet\nContains the last active derivation indices per keychain (K…\nReturns the latest checkpoint.\nList all relevant outputs (includes both spent and …\nReturn the list of unspent outputs of this wallet\nList addresses that are revealed but unused.\nLoad Wallet from the given persistence backend.\nGet a reference to the inner LocalChain.\nMarks an address used of the given keychain at index.\nGet the Bitcoin network the wallet is using.\nStores the network type of the transaction data.\nInitialize an empty Wallet.\nCreates a wallet that does not persist data.\nCreates a wallet that does not persist data, with a custom …\nEither loads Wallet from persistence, or initializes it if …\nEither loads Wallet from persistence, or initializes it if …\nInitialize an empty Wallet with a custom genesis hash.\nThe index of the next address that you would get if you …\nGet the next unused address for the given keychain, i.e. …\nPeek an address of the given keychain at index without …\nReturn the spending policies for the wallet’s descriptor\nReturn the “public” version of the wallet’s …\nReveal addresses up to and including the target index and …\nAttempt to reveal the next address of the given keychain.\nReturn the secp256k1 context used for all signing …\nCompute the tx’s sent and received Amounts.\nSign a transaction with all the wallet’s signers, in the …\nGeneralized signers\nGet a reference to the inner KeychainTxOutIndex.\nReturns the changes that will be committed with the next …\nCreate a `FullScanRequest for this wallet.\nCreate a partial SyncRequest for this wallet for all …\nGet the whole balance visible to the wallet.\nIterate over the transactions in the wallet.\nUnconfirmed UTXOs generated by a wallet tx\nGet sum of trusted_pending and confirmed coins.\nTransaction builder\nGet a reference to the inner TxGraph.\nGet an unbounded script pubkey iterator for the given …\nUndoes the effect of mark_used and returns whether the …\nUnconfirmed UTXOs received from an external wallet\nDeterministically generate a unique name given the …\nBlock hash of connected_to.\nExpected block hash of connected_to, as derived from block.\nThe internal chain’s tip height.\nThe introduced transaction’s confirmation height.\nThe expected genesis block hash.\nThe expected network type.\nThe block hash loaded from persistence.\nThe network type loaded from persistence.\nThe descriptor loaded from persistence.\nThe keychain of the descriptor not matching\nBranch and bound coin selection tries to avoid needing a …\nBranch and bound coin selection possible attempts with …\nBranch and bound coin selection\nIt’s possible to create spendable output from excess …\nTrait for generalized coin selection algorithms\nResult of a successful coin selection\nDefault coin selection algorithm used by TxBuilder if not …\nErrors that can be thrown by the coin_selection module\nRemaining amount after performing coin selection\nWallet’s UTXO set is not enough to cover recipient’s …\nSimple and dumb coin selection\nIt’s not possible to create spendable output from excess …\nOldestFirstCoinSelection always picks the utxo with the …\nPerform the coin selection\nDecide if change can be created\nRemaining amount after deducing fees and outgoing outputs\nTotal fee amount for the selected utxos in satoshis\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nThe total value of the inputs selected from the local …\nCreate new instance with target size for change output\nList of outputs selected for use as inputs\nThe total value of the inputs selected.\nSats available for spending\nSats needed for some transaction\nEffective amount available to create change after …\nThe calculated fee for the drain TxOut with the selected …\nThreshold to consider amount as dust for this particular …\nThe deducted change output fee\nExceeding amount of current selection over outgoing value …\nError returned from Wallet::build_fee_bump\nThere was an error with coin selection\nDescriptor key conversion error\nError returned from TxBuilder::finish\nThere was a problem with the descriptors passed in\nWhen bumping a tx the fee rate requested is lower than …\nNode doesn’t have data to estimate a fee rate\nWhen bumping a tx the absolute fee requested is lower than …\nTrying to replace a tx that has a sequence >= 0xFFFFFFFE\nRequested LockTime is less than is required to spend from …\nMiniscript PSBT error\nErrors returned by miniscript when updating inconsistent …\nIn order to use the TxBuilder::add_global_xpubs option …\nMissing non_witness_utxo on foreign utxo for given OutPoint\nCannot build a tx without recipients\nmanually_selected_only option is selected but no utxo has …\nOutput created is under the dust limit, 546 satoshis\nReturn error type for …\nWe were unable to load wallet data from or write wallet …\nThere was a problem while extracting and manipulating …\nPartially signed bitcoin transaction error\nCannot enable RBF with a Sequence >= 0xFFFFFFFE\nCannot enable RBF with Sequence given a required OP_CSV\nSpending policy is not compatible with this KeychainKind\nHappens when trying to bump a transaction that is already …\nThrown when a tx is not found in the internal database\nHappens when trying to spend an UTXO that is not in the …\nHappens when trying to spend an UTXO that is not in the …\nReturn error type for PsbtExt::update_input_with_descriptor\nRequested invalid transaction version ‘0’\nRequested transaction version 1, but at least 2 is needed …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nRequired OP_CSV Sequence\nGiven RBF Sequence\nRequested LockTime\nRequired LockTime\nRequired fee absolute value Amount\nRequired fee rate\nStructure that contains the export of a wallet\nAlias for FullyNodedExport\nEarliest block to rescan when looking for the wallet’s …\nEarliest block to rescan when looking for the wallet’s …\nReturn the internal descriptor, if present\nReturn the external descriptor\nExport a wallet\nReturns the argument unchanged.\nCalls U::from(self).\nArbitrary label for the wallet\nArbitrary label for the wallet\nThe signer will sign all the leaves it has a key for.\nDummy identifier\nThe signer won’t sign the specified leaves.\nTo be used only by external libraries implementing …\nThe fingerprint of a BIP32 extended key\nThe signer won’t sign leaves other than the ones …\nInput index is out of range\nPSBT Input signer\nThe private key in use has the right fingerprint but …\nThe non_witness_utxo specified is invalid\nInvalid SIGHASH for the signing context in use\nLegacy context\nMiniscript PSBT error\nThe fingerprint and derivation path are missing from the …\nThe private key is missing for the required public key\nThe non_witness_utxo field of the transaction is required …\nThe witness_script field of the transaction is required to …\nThe witness_utxo field of the transaction is required to …\nThe psbt contains a non-SIGHASH_ALL sighash in one of its …\nThe signer won’t sign any leaf.\nBitcoin HASH160 (RIPEMD160 after SHA256) hash of an ECDSA …\nSegwit v0 context (BIP 143)\nError while computing the hash to sign a P2WPKH input.\nError while computing the hash to sign a Taproot input.\nOptions for a software signer\nCommon signer methods\nSigning context\nSigning error\nIdentifier of a signer in the SignersContainers. Used as a …\nDefines the order in which signers are called\nWrapper to pair a signer with its context\nContainer for multiple signers\nTaproot context (BIP 340)\nCustomize which taproot script-path leaves the signer …\nPSBT signer\nError while computing the hash, out of bounds access on …\nThe user canceled the operation\nAdds an external signer to the container for the specified …\nWhether the signer should use the sighash_type set in the …\nWhether we should grind ECDSA signature to ensure signing …\nCreate a map of public keys to secret keys\nWhether the wallet should assume a specific height has …\nBuild a new signer container from a KeyMap\nReturn the secret key for the signer\nFinds the signer with lowest ordering for a given id in …\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.\nReturn the SignerId for this signer\nReturns the list of identifiers of all the signers in the …\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).\nCreate a wrapped signer from a signer and a context\nDefault constructor\nRemoves a signer from the container and returns it\nWhether to remove partial signatures from the PSBT inputs …\nWhether to remove taproot specific fields from the PSBT on …\nSign a single psbt input\nSign all the inputs of the psbt\nWhether we should try to sign a taproot transaction with …\nReturns the list of signers in the container, sorted by …\nSpecifies which Taproot script-spend leaves we should sign …\nWhether the signer should trust the witness_utxo, if the …\nWhether to try finalizing the PSBT after the inputs are …\nWhether the signer can sign for the internal key or not\nError returned from TxBuilder::add_foreign_utxo.\nError returned from TxBuilder::add_utxo and …\nBIP69 / Lexicographic\nUse both change and non-change outputs (default)\nOnly use non-change outputs (see …\nPolicy regarding the use of change outputs when creating a …\nRequested outpoint doesn’t exist in the tx (vout greater …\nForeign utxo outpoint txid does not match PSBT input txid\nForeign utxo missing witness_utxo or non_witness_utxo\nOnly use change outputs (see TxBuilder::only_spend_change)\nRandomized (default)\nA transaction builder\nOrdering of the transaction’s inputs and outputs\nHappens when trying to spend an UTXO that is not in the …\nUnchanged\nAdd data as an output, using OP_RETURN\nAdd a foreign UTXO i.e. a UTXO not owned by this wallet.\nSame as add_foreign_utxo but allows to set the nSequence …\nFill-in the PSBT_GLOBAL_XPUB field with the extended keys …\nAdd a recipient to the internal list\nAdd a utxo to the internal list of unspendable utxos\nAdd a utxo to the internal list of utxos that must be spent\nAdd the list of outpoints to the internal list of UTXOs …\nSet whether or not the dust limit is checked.\nSet a specific ChangeSpendPolicy. See …\nChoose the coin selection algorithm\nSet the current blockchain height.\nDo not spend change outputs\nSets the address to drain excess coins to.\nSpend all the available inputs. This respects filters like …\nEnable signaling RBF\nEnable signaling RBF with a specific nSequence value\nSet an absolute fee The fee_absolute method refers to the …\nSet a custom fee rate.\nFinish building the transaction.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nFill-in the psbt::Output::redeem_script and …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nOnly spend utxos added by add_utxo.\nUse a specific nLockTime while creating the transaction\nOnly spend change outputs\nOnly Fill-in the psbt::Input::witness_utxo field when …\nChoose the ordering for inputs and outputs of the …\nSet the policy path to use while creating the transaction …\nReplace the recipients already added with a new list\nSign with a specific sig hash\nSort transaction inputs and outputs by TxOrdering variant\nReplace the internal list of unspendable utxos with a new …\nBuild a transaction with a specific version\nForeign UTXO outpoint\nPSBT input txid") \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/src/bdk_chain/descriptor_ext.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_chain/descriptor_ext.rs.html index d8d9af7f55..5c5c89737e 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk_chain/descriptor_ext.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk_chain/descriptor_ext.rs.html @@ -75,7 +75,7 @@ self.at_derivation_index(0) .expect("descriptor can't have hardened derivation") .script_pubkey() - .dust_value() + .minimal_non_dust() .to_sat() } 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 8630069cb2..dd1e63a4e8 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 @@ -503,7 +503,7 @@ let mut graph = tx_graph::ChangeSet::default(); for (tx, anchors) in txs { if self.index.is_tx_relevant(tx) { - let txid = tx.txid(); + let txid = tx.compute_txid(); graph.append(self.graph.insert_tx(tx.clone())); for anchor in anchors { graph.append(self.graph.insert_anchor(txid, anchor)); @@ -594,7 +594,7 @@ for (tx_pos, tx) in block.txdata.iter().enumerate() { changeset.indexer.append(self.index.index_tx(tx)); if self.index.is_tx_relevant(tx) { - let txid = tx.txid(); + let txid = tx.compute_txid(); let anchor = A::from_block_position(block, block_id, tx_pos); changeset.graph.append(self.graph.insert_tx(tx.clone())); changeset @@ -621,7 +621,7 @@ let mut graph = tx_graph::ChangeSet::default(); for (tx_pos, tx) in block.txdata.iter().enumerate() { let anchor = A::from_block_position(&block, block_id, tx_pos); - graph.append(self.graph.insert_anchor(tx.txid(), anchor)); + graph.append(self.graph.insert_anchor(tx.compute_txid(), anchor)); graph.append(self.graph.insert_tx(tx.clone())); } let indexer = self.index_tx_graph_changeset(&graph); diff --git a/docs-rs/bdk/nightly/latest/src/bdk_chain/keychain/txout_index.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_chain/keychain/txout_index.rs.html index 493e0df733..57bbfb1acc 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk_chain/keychain/txout_index.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk_chain/keychain/txout_index.rs.html @@ -1222,7 +1222,7 @@ fn index_tx(&mut self, tx: &bitcoin::Transaction) -> Self::ChangeSet { let mut changeset = super::ChangeSet::<K>::default(); for (op, txout) in tx.output.iter().enumerate() { - changeset.append(self.index_txout(OutPoint::new(tx.txid(), op as u32), txout)); + changeset.append(self.index_txout(OutPoint::new(tx.compute_txid(), op as u32), txout)); } changeset } diff --git a/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_txout_index.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_txout_index.rs.html index 5149ceefe6..7869f2354e 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_txout_index.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_txout_index.rs.html @@ -418,7 +418,7 @@ /// 2. When getting new data from the chain, you usually scan it before incorporating it into your chain state. pub fn scan(&mut self, tx: &Transaction) -> BTreeSet<I> { let mut scanned_indices = BTreeSet::new(); - let txid = tx.txid(); + let txid = tx.compute_txid(); for (i, txout) in tx.output.iter().enumerate() { let op = OutPoint::new(txid, i as u32); if let Some(spk_i) = self.scan_txout(op, txout) { diff --git a/docs-rs/bdk/nightly/latest/src/bdk_chain/tx_data_traits.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_chain/tx_data_traits.rs.html index 7754be41f0..d9d67c9efa 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk_chain/tx_data_traits.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk_chain/tx_data_traits.rs.html @@ -228,7 +228,7 @@ /// let mut graph_a = TxGraph::<BlockId>::default(); /// let _ = graph_a.insert_tx(tx.clone()); /// graph_a.insert_anchor( -/// tx.txid(), +/// tx.compute_txid(), /// BlockId { /// height: 1, /// hash: Hash::hash("first".as_bytes()), @@ -243,7 +243,7 @@ /// let mut graph_b = TxGraph::<ConfirmationHeightAnchor>::default(); /// let _ = graph_b.insert_tx(tx.clone()); /// graph_b.insert_anchor( -/// tx.txid(), +/// tx.compute_txid(), /// ConfirmationHeightAnchor { /// anchor_block: BlockId { /// height: 2, @@ -261,7 +261,7 @@ /// let mut graph_c = TxGraph::<ConfirmationTimeHeightAnchor>::default(); /// let _ = graph_c.insert_tx(tx.clone()); /// graph_c.insert_anchor( -/// tx.txid(), +/// tx.compute_txid(), /// ConfirmationTimeHeightAnchor { /// anchor_block: BlockId { /// height: 2, diff --git a/docs-rs/bdk/nightly/latest/src/bdk_chain/tx_graph.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_chain/tx_graph.rs.html index 5fe46d8668..2abb5dced4 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk_chain/tx_graph.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk_chain/tx_graph.rs.html @@ -1571,6 +1571,7 @@ 1571 1572 1573 +1574
    //! Module for structures that store and traverse transactions.
     //!
     //! [`TxGraph`] contains transactions and indexes them so you can easily traverse the graph of
    @@ -2018,7 +2019,7 @@
             &'g self,
             tx: &'g Transaction,
         ) -> impl Iterator<Item = (usize, Txid)> + '_ {
    -        let txid = tx.txid();
    +        let txid = tx.compute_txid();
             tx.input
                 .iter()
                 .enumerate()
    @@ -2089,9 +2090,10 @@
         pub fn insert_tx<T: Into<Arc<Transaction>>>(&mut self, tx: T) -> ChangeSet<A> {
             let tx = tx.into();
             let mut update = Self::default();
    -        update
    -            .txs
    -            .insert(tx.txid(), (TxNodeInternal::Whole(tx), BTreeSet::new(), 0));
    +        update.txs.insert(
    +            tx.compute_txid(),
    +            (TxNodeInternal::Whole(tx), BTreeSet::new(), 0),
    +        );
             self.apply_update(update)
         }
     
    @@ -2106,7 +2108,7 @@
         ) -> ChangeSet<A> {
             let mut changeset = ChangeSet::<A>::default();
             for (tx, seen_at) in txs {
    -            changeset.append(self.insert_seen_at(tx.txid(), seen_at));
    +            changeset.append(self.insert_seen_at(tx.compute_txid(), seen_at));
                 changeset.append(self.insert_tx(tx));
             }
             changeset
    @@ -2215,7 +2217,7 @@
         pub fn apply_changeset(&mut self, changeset: ChangeSet<A>) {
             for wrapped_tx in changeset.txs {
                 let tx = wrapped_tx.as_ref();
    -            let txid = tx.txid();
    +            let txid = tx.compute_txid();
     
                 tx.input
                     .iter()
    @@ -2233,7 +2235,7 @@
                     }
                     Some((TxNodeInternal::Whole(tx), _, _)) => {
                         debug_assert_eq!(
    -                        tx.as_ref().txid(),
    +                        tx.as_ref().compute_txid(),
                             txid,
                             "tx should produce txid that is same as key"
                         );
    @@ -2398,7 +2400,7 @@
             // resulting array will also include `tx`
             let unconfirmed_ancestor_txs =
                 TxAncestors::new_include_root(self, tx.clone(), |_, ancestor_tx: Arc<Transaction>| {
    -                let tx_node = self.get_tx_node(ancestor_tx.as_ref().txid())?;
    +                let tx_node = self.get_tx_node(ancestor_tx.as_ref().compute_txid())?;
                     // We're filtering the ancestors to keep only the unconfirmed ones (= no anchors in
                     // the best chain)
                     for block in tx_node.anchors {
    @@ -2416,7 +2418,7 @@
             // and our unconf descendants' last seen.
             let unconfirmed_descendants_txs = TxDescendants::new_include_root(
                 self,
    -            tx.as_ref().txid(),
    +            tx.as_ref().compute_txid(),
                 |_, descendant_txid: Txid| {
                     let tx_node = self.get_tx_node(descendant_txid)?;
                     // We're filtering the ancestors to keep only the unconfirmed ones (= no anchors in
    @@ -2457,7 +2459,7 @@
                         return Ok(None);
                     }
                     if conflicting_tx.last_seen_unconfirmed == *last_seen
    -                    && conflicting_tx.as_ref().txid() > tx.as_ref().txid()
    +                    && conflicting_tx.as_ref().compute_txid() > tx.as_ref().compute_txid()
                     {
                         // Conflicting tx has priority if txid of conflicting tx > txid of original tx
                         return Ok(None);
    @@ -2828,7 +2830,7 @@
                     tx.output
                         .iter()
                         .enumerate()
    -                    .map(move |(vout, txout)| (OutPoint::new(tx.txid(), vout as _), txout))
    +                    .map(move |(vout, txout)| (OutPoint::new(tx.compute_txid(), vout as _), txout))
                 })
                 .chain(self.txouts.iter().map(|(op, txout)| (*op, txout)))
         }
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_electrum/bdk_electrum_client.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_electrum/bdk_electrum_client.rs.html
    index 5193fe2b37..c36d809e95 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_electrum/bdk_electrum_client.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_electrum/bdk_electrum_client.rs.html
    @@ -899,7 +899,7 @@
                     Some(txout) => txout,
                     None => continue,
                 };
    -            debug_assert_eq!(op_tx.txid(), op_txid);
    +            debug_assert_eq!(op_tx.compute_txid(), op_txid);
     
                 // attempt to find the following transactions (alongside their chain positions), and
                 // add to our sparsechain `update`:
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_sqlite/store.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_sqlite/store.rs.html
    index f955300af9..5231490a1b 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_sqlite/store.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_sqlite/store.rs.html
    @@ -1082,7 +1082,7 @@
                 let insert_tx_stmt = &mut db_transaction
                     .prepare_cached("INSERT INTO tx (txid, whole_tx) VALUES (:txid, :whole_tx) ON CONFLICT (txid) DO UPDATE SET whole_tx = :whole_tx WHERE txid = :txid")
                     .expect("insert or update tx whole_tx statement");
    -            let txid = tx.txid().to_string();
    +            let txid = tx.compute_txid().to_string();
                 let whole_tx = serialize(&tx);
                 insert_tx_stmt
                     .execute(named_params! {":txid": txid, ":whole_tx": whole_tx })
    @@ -1464,9 +1464,9 @@
             let tx2_hex = Vec::<u8>::from_hex("01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0e0432e7494d010e062f503253482fffffffff0100f2052a010000002321038a7f6ef1c8ca0c588aa53fa860128077c9e6c11e6830f4d7ee4e763a56b7718fac00000000").unwrap();
             let tx2: Arc<Transaction> = Arc::new(deserialize(tx2_hex.as_slice()).unwrap());
     
    -        let outpoint0_0 = OutPoint::new(tx0.txid(), 0);
    +        let outpoint0_0 = OutPoint::new(tx0.compute_txid(), 0);
             let txout0_0 = tx0.output.first().unwrap().clone();
    -        let outpoint1_0 = OutPoint::new(tx1.txid(), 0);
    +        let outpoint1_0 = OutPoint::new(tx1.compute_txid(), 0);
             let txout1_0 = tx1.output.first().unwrap().clone();
     
             let anchor1 = anchor_fn(1, 1296667328, block_hash_1);
    @@ -1475,11 +1475,11 @@
             let tx_graph_changeset = tx_graph::ChangeSet::<A> {
                 txs: [tx0.clone(), tx1.clone()].into(),
                 txouts: [(outpoint0_0, txout0_0), (outpoint1_0, txout1_0)].into(),
    -            anchors: [(anchor1, tx0.txid()), (anchor1, tx1.txid())].into(),
    +            anchors: [(anchor1, tx0.compute_txid()), (anchor1, tx1.compute_txid())].into(),
                 last_seen: [
    -                (tx0.txid(), 1598918400),
    -                (tx1.txid(), 1598919121),
    -                (tx2.txid(), 1608919121),
    +                (tx0.compute_txid(), 1598918400),
    +                (tx1.compute_txid(), 1598919121),
    +                (tx2.compute_txid(), 1608919121),
                 ]
                 .into(),
             };
    @@ -1509,7 +1509,7 @@
                 txs: [tx2.clone()].into(),
                 txouts: BTreeMap::default(),
                 anchors: BTreeSet::default(),
    -            last_seen: [(tx2.txid(), 1708919121)].into(),
    +            last_seen: [(tx2.compute_txid(), 1708919121)].into(),
             };
     
             let graph_changeset2: indexed_tx_graph::ChangeSet<A, keychain::ChangeSet<Keychain>> =
    @@ -1528,7 +1528,7 @@
             let tx_graph_changeset3 = tx_graph::ChangeSet::<A> {
                 txs: BTreeSet::default(),
                 txouts: BTreeMap::default(),
    -            anchors: [(anchor2, tx0.txid()), (anchor2, tx1.txid())].into(),
    +            anchors: [(anchor2, tx0.compute_txid()), (anchor2, tx1.compute_txid())].into(),
                 last_seen: BTreeMap::default(),
             };
     
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_tmp_plan/plan_impls.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_tmp_plan/plan_impls.rs.html
    index 6f4d98d4ad..b4cc181c74 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_tmp_plan/plan_impls.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_tmp_plan/plan_impls.rs.html
    @@ -565,7 +565,7 @@
                 if max_sequence.is_height_locked() == older.is_height_locked() {
                     if max_sequence.to_consensus_u32() >= older.to_consensus_u32() {
                         Some(TermPlan {
    -                        min_sequence: Some(*older),
    +                        min_sequence: Some((*older).into()),
                             ..Default::default()
                         })
                     } else {
    @@ -643,9 +643,9 @@
                     (lplan, rplan) => lplan.or(rplan),
                 }
             }
    -        Terminal::Thresh(_, _) => todo!(),
    -        Terminal::Multi(_, _) => todo!(),
    -        Terminal::MultiA(_, _) => todo!(),
    +        Terminal::Thresh(_) => todo!(),
    +        Terminal::Multi(_) => todo!(),
    +        Terminal::MultiA(_) => todo!(),
         }
     }
     

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/src/bdk_tmp_plan/requirements.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_tmp_plan/requirements.rs.html index bfe8b6eea9..dbde25605a 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk_tmp_plan/requirements.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk_tmp_plan/requirements.rs.html @@ -227,6 +227,14 @@ 227 228 229 +230 +231 +232 +233 +234 +235 +236 +237
    use bdk_chain::{bitcoin, collections::*, miniscript};
     use core::ops::Deref;
     
    @@ -316,20 +324,28 @@
     
     #[derive(Clone, Debug)]
     pub enum SigningError {
    -    SigHashError(sighash::Error),
    +    SigHashP2wpkh(sighash::P2wpkhError),
    +    SigHashTaproot(sighash::TaprootError),
         DerivationError(bip32::Error),
     }
     
    -impl From<sighash::Error> for SigningError {
    -    fn from(e: sighash::Error) -> Self {
    -        Self::SigHashError(e)
    +impl From<sighash::TaprootError> for SigningError {
    +    fn from(v: sighash::TaprootError) -> Self {
    +        Self::SigHashTaproot(v)
    +    }
    +}
    +
    +impl From<sighash::P2wpkhError> for SigningError {
    +    fn from(v: sighash::P2wpkhError) -> Self {
    +        Self::SigHashP2wpkh(v)
         }
     }
     
     impl core::fmt::Display for SigningError {
         fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
             match self {
    -            SigningError::SigHashError(e) => e.fmt(f),
    +            SigningError::SigHashP2wpkh(e) => e.fmt(f),
    +            SigningError::SigHashTaproot(e) => e.fmt(f),
                 SigningError::DerivationError(e) => e.fmt(f),
             }
         }
    @@ -399,8 +415,8 @@
                     let sig = secp.sign_schnorr_no_aux_rand(&msg, &keypair);
     
                     let bitcoin_sig = taproot::Signature {
    -                    sig,
    -                    hash_ty: schnorr_sighashty,
    +                    signature: sig,
    +                    sighash_type: schnorr_sighashty,
                     };
     
                     auth_data
    @@ -439,10 +455,10 @@
                             };
                             let keypair = Keypair::from_secret_key(&secp, &secret_key.clone());
                             let msg = Message::from_digest(sighash.to_byte_array());
    -                        let sig = secp.sign_schnorr_no_aux_rand(&msg, &keypair);
    +                        let signature = secp.sign_schnorr_no_aux_rand(&msg, &keypair);
                             let bitcoin_sig = taproot::Signature {
    -                            sig,
    -                            hash_ty: sighash_type,
    +                            signature,
    +                            sighash_type,
                             };
     
                             auth_data
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/dsl.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/dsl.rs.html
    index 9f1e8b99e5..a17ed46dad 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/dsl.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/dsl.rs.html
    @@ -1215,6 +1215,17 @@
     1215
     1216
     1217
    +1218
    +1219
    +1220
    +1221
    +1222
    +1223
    +1224
    +1225
    +1226
    +1227
    +1228
     
    // Bitcoin Dev Kit
     // Written in 2020 by Alekos Filini <alekos.filini@gmail.com>
     //
    @@ -1920,10 +1931,10 @@
             $crate::keys::make_pkh($key, &secp)
         });
         ( after ( $value:expr ) ) => ({
    -        $crate::impl_leaf_opcode_value!(After, $crate::miniscript::AbsLockTime::from_consensus($value))
    +        $crate::impl_leaf_opcode_value!(After, $crate::miniscript::AbsLockTime::from_consensus($value).expect("valid `AbsLockTime`"))
         });
         ( older ( $value:expr ) ) => ({
    -        $crate::impl_leaf_opcode_value!(Older, $crate::bitcoin::Sequence($value)) // TODO!!
    +        $crate::impl_leaf_opcode_value!(Older, $crate::miniscript::RelLockTime::from_consensus($value).expect("valid `RelLockTime`")) // TODO!!
         });
         ( sha256 ( $hash:expr ) ) => ({
             $crate::impl_leaf_opcode_value!(Sha256, $hash)
    @@ -1974,7 +1985,8 @@
                 (keys_acc, net_acc)
             });
     
    -        $crate::impl_leaf_opcode_value_two!(Thresh, $thresh, items)
    +        let thresh = $crate::miniscript::Threshold::new($thresh, items).expect("valid threshold and pks collection");
    +        $crate::impl_leaf_opcode_value!(Thresh, thresh)
                 .map(|(minisc, _, _)| (minisc, key_maps, valid_networks))
         });
         ( thresh ( $thresh:expr, $( $inner:tt )* ) ) => ({
    @@ -1986,7 +1998,12 @@
         ( multi_vec ( $thresh:expr, $keys:expr ) ) => ({
             let secp = $crate::bitcoin::secp256k1::Secp256k1::new();
     
    -        $crate::keys::make_multi($thresh, $crate::miniscript::Terminal::Multi, $keys, &secp)
    +        let fun = |k, pks| {
    +            let thresh = $crate::miniscript::Threshold::new(k, pks).expect("valid threshold and pks collection");
    +            $crate::miniscript::Terminal::Multi(thresh)
    +        };
    +
    +        $crate::keys::make_multi($thresh, fun, $keys, &secp)
         });
         ( multi ( $thresh:expr $(, $key:expr )+ ) ) => ({
             $crate::group_multi_keys!( $( $key ),* )
    @@ -1995,7 +2012,12 @@
         ( multi_a_vec ( $thresh:expr, $keys:expr ) ) => ({
             let secp = $crate::bitcoin::secp256k1::Secp256k1::new();
     
    -        $crate::keys::make_multi($thresh, $crate::miniscript::Terminal::MultiA, $keys, &secp)
    +        let fun = |k, pks| {
    +            let thresh = $crate::miniscript::Threshold::new(k, pks).expect("valid threshold and pks collection");
    +            $crate::miniscript::Terminal::MultiA(thresh)
    +        };
    +
    +        $crate::keys::make_multi($thresh, fun, $keys, &secp)
         });
         ( multi_a ( $thresh:expr $(, $key:expr )+ ) ) => ({
             $crate::group_multi_keys!( $( $key ),* )
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/error.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/error.rs.html
    index ee50920163..d34b64b023 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/error.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/error.rs.html
    @@ -165,7 +165,7 @@
         /// Error during base58 decoding
         Base58(bitcoin::base58::Error),
         /// Key-related error
    -    Pk(bitcoin::key::Error),
    +    Pk(bitcoin::key::ParsePublicKeyError),
         /// Miniscript error
         Miniscript(miniscript::Error),
         /// Hex decoding error
    @@ -231,8 +231,8 @@
         }
     }
     
    -impl From<bitcoin::key::Error> for Error {
    -    fn from(err: bitcoin::key::Error) -> Self {
    +impl From<bitcoin::key::ParsePublicKeyError> for Error {
    +    fn from(err: bitcoin::key::ParsePublicKeyError) -> Self {
             Error::Pk(err)
         }
     }
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/mod.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/mod.rs.html
    index 6e18343df0..3c6993704a 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/mod.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/mod.rs.html
    @@ -1129,7 +1129,7 @@
                     let pk = match pk {
                         DescriptorPublicKey::XPub(ref xpub) => {
                             let mut xpub = xpub.clone();
    -                        xpub.xkey.network = self.network;
    +                        xpub.xkey.network = self.network.into();
     
                             DescriptorPublicKey::XPub(xpub)
                         }
    @@ -1164,11 +1164,11 @@
                 .map(|(mut k, mut v)| {
                     match (&mut k, &mut v) {
                         (DescriptorPublicKey::XPub(xpub), DescriptorSecretKey::XPrv(xprv)) => {
    -                        xpub.xkey.network = network;
    -                        xprv.xkey.network = network;
    +                        xpub.xkey.network = network.into();
    +                        xprv.xkey.network = network.into();
                         }
                         (_, DescriptorSecretKey::Single(key)) => {
    -                        key.key.network = network;
    +                        key.key.network = network.into();
                         }
                         _ => {}
                     }
    @@ -1506,8 +1506,8 @@
         use assert_matches::assert_matches;
         use bitcoin::hex::FromHex;
         use bitcoin::secp256k1::Secp256k1;
    -    use bitcoin::ScriptBuf;
         use bitcoin::{bip32, Psbt};
    +    use bitcoin::{NetworkKind, ScriptBuf};
     
         use super::*;
         use crate::psbt::PsbtUtils;
    @@ -1643,7 +1643,7 @@
                 .unwrap();
     
             let mut xprv_testnet = xprv;
    -        xprv_testnet.network = Network::Testnet;
    +        xprv_testnet.network = NetworkKind::Test;
     
             let xpub_testnet = bip32::Xpub::from_priv(&secp, &xprv_testnet);
             let desc_pubkey = DescriptorPublicKey::XPub(DescriptorXKey {
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/policy.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/policy.rs.html
    index 62e7ba64e0..b57aef1049 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/policy.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/policy.rs.html
    @@ -1945,6 +1945,7 @@
     use alloc::string::String;
     use alloc::vec::Vec;
     use core::cmp::max;
    +use miniscript::miniscript::limits::{MAX_PUBKEYS_IN_CHECKSIGADD, MAX_PUBKEYS_PER_MULTISIG};
     
     use core::fmt;
     
    @@ -1953,12 +1954,12 @@
     
     use bitcoin::bip32::Fingerprint;
     use bitcoin::hashes::{hash160, ripemd160, sha256};
    -use bitcoin::{absolute, key::XOnlyPublicKey, PublicKey, Sequence};
    +use bitcoin::{absolute, key::XOnlyPublicKey, relative, PublicKey, Sequence};
     
     use miniscript::descriptor::{
         DescriptorPublicKey, ShInner, SinglePub, SinglePubKey, SortedMultiVec, WshInner,
     };
    -use miniscript::hash256;
    +use miniscript::{hash256, Threshold};
     use miniscript::{
         Descriptor, Miniscript, Satisfier, ScriptContext, SigType, Terminal, ToPublicKey,
     };
    @@ -2042,7 +2043,7 @@
         /// Relative timelock locktime
         RelativeTimelock {
             /// The timelock value
    -        value: Sequence,
    +        value: relative::LockTime,
         },
         /// Multi-signature public keys with threshold count
         Multisig {
    @@ -2491,30 +2492,25 @@
             Ok(Some(policy))
         }
     
    -    fn make_multisig<Ctx: ScriptContext + 'static>(
    -        keys: &[DescriptorPublicKey],
    +    fn make_multi<Ctx: ScriptContext + 'static, const MAX: usize>(
    +        threshold: &Threshold<DescriptorPublicKey, MAX>,
             signers: &SignersContainer,
             build_sat: BuildSatisfaction,
    -        threshold: usize,
             sorted: bool,
             secp: &SecpCtx,
         ) -> Result<Option<Policy>, PolicyError> {
    -        if threshold == 0 {
    -            return Ok(None);
    -        }
    -
    -        let parsed_keys = keys.iter().map(|k| PkOrF::from_key(k, secp)).collect();
    +        let parsed_keys = threshold.iter().map(|k| PkOrF::from_key(k, secp)).collect();
     
             let mut contribution = Satisfaction::Partial {
    -            n: keys.len(),
    -            m: threshold,
    +            n: threshold.n(),
    +            m: threshold.k(),
                 items: vec![],
                 conditions: Default::default(),
                 sorted: Some(sorted),
             };
             let mut satisfaction = contribution.clone();
     
    -        for (index, key) in keys.iter().enumerate() {
    +        for (index, key) in threshold.iter().enumerate() {
                 if signers.find(signer_id(key, secp)).is_some() {
                     contribution.add(
                         &Satisfaction::Complete {
    @@ -2523,7 +2519,6 @@
                         index,
                     )?;
                 }
    -
                 if let Some(psbt) = build_sat.psbt() {
                     if Ctx::find_signature(psbt, key, secp) {
                         satisfaction.add(
    @@ -2540,12 +2535,11 @@
     
             let mut policy: Policy = SatisfiableItem::Multisig {
                 keys: parsed_keys,
    -            threshold,
    +            threshold: threshold.k(),
             }
             .into();
             policy.contribution = contribution;
             policy.satisfaction = satisfaction;
    -
             Ok(Some(policy))
         }
     
    @@ -2630,7 +2624,7 @@
                     timelock: Some(*value),
                 }),
                 SatisfiableItem::RelativeTimelock { value } => Ok(Condition {
    -                csv: Some(*value),
    +                csv: Some((*value).into()),
                     timelock: None,
                 }),
                 _ => Ok(Condition::default()),
    @@ -2857,11 +2851,14 @@
                     Some(policy)
                 }
                 Terminal::Older(value) => {
    -                let mut policy: Policy = SatisfiableItem::RelativeTimelock { value: *value }.into();
    +                let mut policy: Policy = SatisfiableItem::RelativeTimelock {
    +                    value: (*value).into(),
    +                }
    +                .into();
                     policy.contribution = Satisfaction::Complete {
                         condition: Condition {
                             timelock: None,
    -                        csv: Some(*value),
    +                        csv: Some((*value).into()),
                         },
                     };
                     if let BuildSatisfaction::PsbtTimelocks {
    @@ -2871,9 +2868,11 @@
                     } = build_sat
                     {
                         let older = Older::new(Some(current_height), Some(input_max_height), false);
    -                    let older_sat = Satisfier::<bitcoin::PublicKey>::check_older(&older, *value);
    -                    let inputs_sat = psbt_inputs_sat(psbt)
    -                        .all(|sat| Satisfier::<bitcoin::PublicKey>::check_older(&sat, *value));
    +                    let older_sat =
    +                        Satisfier::<bitcoin::PublicKey>::check_older(&older, (*value).into());
    +                    let inputs_sat = psbt_inputs_sat(psbt).all(|sat| {
    +                        Satisfier::<bitcoin::PublicKey>::check_older(&sat, (*value).into())
    +                    });
                         if older_sat && inputs_sat {
                             policy.satisfaction = policy.contribution.clone();
                         }
    @@ -2891,9 +2890,12 @@
                 Terminal::Hash160(hash) => {
                     Some(SatisfiableItem::Hash160Preimage { hash: *hash }.into())
                 }
    -            Terminal::Multi(k, pks) | Terminal::MultiA(k, pks) => {
    -                Policy::make_multisig::<Ctx>(pks, signers, build_sat, *k, false, secp)?
    -            }
    +            Terminal::Multi(threshold) => Policy::make_multi::<Ctx, MAX_PUBKEYS_PER_MULTISIG>(
    +                threshold, signers, build_sat, false, secp,
    +            )?,
    +            Terminal::MultiA(threshold) => Policy::make_multi::<Ctx, MAX_PUBKEYS_IN_CHECKSIGADD>(
    +                threshold, signers, build_sat, false, secp,
    +            )?,
                 // Identities
                 Terminal::Alt(inner)
                 | Terminal::Swap(inner)
    @@ -2921,8 +2923,9 @@
                     a.extract_policy(signers, build_sat, secp)?,
                     b.extract_policy(signers, build_sat, secp)?,
                 )?,
    -            Terminal::Thresh(k, nodes) => {
    -                let mut threshold = *k;
    +            Terminal::Thresh(threshold) => {
    +                let mut k = threshold.k();
    +                let nodes = threshold.data();
                     let mapped: Vec<_> = nodes
                         .iter()
                         .map(|n| n.extract_policy(signers, build_sat, secp))
    @@ -2932,13 +2935,13 @@
                         .collect();
     
                     if mapped.len() < nodes.len() {
    -                    threshold = match threshold.checked_sub(nodes.len() - mapped.len()) {
    +                    k = match k.checked_sub(nodes.len() - mapped.len()) {
                             None => return Ok(None),
                             Some(x) => x,
                         };
                     }
     
    -                Policy::make_thresh(mapped, threshold)?
    +                Policy::make_thresh(mapped, k)?
                 }
     
                 // Unsupported
    @@ -2992,13 +2995,10 @@
                 build_sat: BuildSatisfaction,
                 secp: &SecpCtx,
             ) -> Result<Option<Policy>, Error> {
    -            Ok(Policy::make_multisig::<Ctx>(
    -                keys.pks.as_ref(),
    -                signers,
    -                build_sat,
    -                keys.k,
    -                true,
    -                secp,
    +            let threshold = Threshold::new(keys.k(), keys.pks().to_vec())
    +                .expect("valid threshold and pks collection");
    +            Ok(Policy::make_multi::<Ctx, MAX_PUBKEYS_PER_MULTISIG>(
    +                &threshold, signers, build_sat, true, secp,
                 )?)
             }
     
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/template.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/template.rs.html
    index 6c0679b713..221cc3a697 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/template.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_wallet/descriptor/template.rs.html
    @@ -1583,7 +1583,7 @@
             use bitcoin::bip32::ChildNumber::{self, Hardened};
     
             let xprvkey = bitcoin::bip32::Xpriv::from_str("xprv9s21ZrQH143K2fpbqApQL69a4oKdGVnVN52R82Ft7d1pSqgKmajF62acJo3aMszZb6qQ22QsVECSFxvf9uyxFUvFYQMq3QbtwtRSMjLAhMf").unwrap();
    -        assert_eq!(Network::Bitcoin, xprvkey.network);
    +        assert!(xprvkey.network.is_mainnet());
             let xdesc = Bip44(xprvkey, KeychainKind::Internal)
                 .build(Network::Bitcoin)
                 .unwrap();
    @@ -1597,7 +1597,7 @@
             }
     
             let tprvkey = bitcoin::bip32::Xpriv::from_str("tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy").unwrap();
    -        assert_eq!(Network::Testnet, tprvkey.network);
    +        assert!(!tprvkey.network.is_mainnet());
             let tdesc = Bip44(tprvkey, KeychainKind::Internal)
                 .build(Network::Testnet)
                 .unwrap();
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_wallet/keys/mod.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_wallet/keys/mod.rs.html
    index 5f10dd7514..131f8d5c1c 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_wallet/keys/mod.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_wallet/keys/mod.rs.html
    @@ -1000,12 +1000,6 @@
     1000
     1001
     1002
    -1003
    -1004
    -1005
    -1006
    -1007
    -1008
     
    // Bitcoin Dev Kit
     // Written in 2020 by Alekos Filini <alekos.filini@gmail.com>
     //
    @@ -1344,7 +1338,7 @@
         pub fn into_xprv(self, network: Network) -> Option<bip32::Xpriv> {
             match self {
                 ExtendedKey::Private((mut xprv, _)) => {
    -                xprv.network = network;
    +                xprv.network = network.into();
                     Some(xprv)
                 }
                 ExtendedKey::Public(_) => None,
    @@ -1363,7 +1357,7 @@
                 ExtendedKey::Public((xpub, _)) => xpub,
             };
     
    -        xpub.network = network;
    +        xpub.network = network.into();
             xpub
         }
     }
    @@ -1410,7 +1404,7 @@
     /// impl<Ctx: ScriptContext> DerivableKey<Ctx> for MyCustomKeyType {
     ///     fn into_extended_key(self) -> Result<ExtendedKey<Ctx>, KeyError> {
     ///         let xprv = bip32::Xpriv {
    -///             network: self.network,
    +///             network: self.network.into(),
     ///             depth: 0,
     ///             parent_fingerprint: bip32::Fingerprint::default(),
     ///             private_key: self.key_data.inner,
    @@ -1442,7 +1436,7 @@
     /// impl<Ctx: ScriptContext> DerivableKey<Ctx> for MyCustomKeyType {
     ///     fn into_extended_key(self) -> Result<ExtendedKey<Ctx>, KeyError> {
     ///         let xprv = bip32::Xpriv {
    -///             network: bitcoin::Network::Bitcoin, // pick an arbitrary network here
    +///             network: bitcoin::Network::Bitcoin.into(), // pick an arbitrary network here
     ///             depth: 0,
     ///             parent_fingerprint: bip32::Fingerprint::default(),
     ///             private_key: self.key_data.inner,
    @@ -1725,7 +1719,7 @@
             let inner = secp256k1::SecretKey::from_slice(&entropy)?;
             let private_key = PrivateKey {
                 compressed: options.compressed,
    -            network: Network::Bitcoin,
    +            network: Network::Bitcoin.into(),
                 inner,
             };
     
    @@ -1855,9 +1849,7 @@
         fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError> {
             let networks = match self {
                 DescriptorPublicKey::Single(_) => any_network(),
    -            DescriptorPublicKey::XPub(DescriptorXKey { xkey, .. })
    -                if xkey.network == Network::Bitcoin =>
    -            {
    +            DescriptorPublicKey::XPub(DescriptorXKey { xkey, .. }) if xkey.network.is_mainnet() => {
                     mainnet_network()
                 }
                 _ => test_networks(),
    @@ -1890,12 +1882,8 @@
     impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorSecretKey {
         fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError> {
             let networks = match &self {
    -            DescriptorSecretKey::Single(sk) if sk.key.network == Network::Bitcoin => {
    -                mainnet_network()
    -            }
    -            DescriptorSecretKey::XPrv(DescriptorXKey { xkey, .. })
    -                if xkey.network == Network::Bitcoin =>
    -            {
    +            DescriptorSecretKey::Single(sk) if sk.key.network.is_mainnet() => mainnet_network(),
    +            DescriptorSecretKey::XPrv(DescriptorXKey { xkey, .. }) if xkey.network.is_mainnet() => {
                     mainnet_network()
                 }
                 _ => test_networks(),
    @@ -2011,7 +1999,7 @@
             .unwrap();
             let xprv = xkey.into_xprv(Network::Testnet).unwrap();
     
    -        assert_eq!(xprv.network, Network::Testnet);
    +        assert_eq!(xprv.network, Network::Testnet.into());
         }
     }
     

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/coin_selection.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/coin_selection.rs.html index dced8bb219..b4b0d012ce 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/coin_selection.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/coin_selection.rs.html @@ -1918,7 +1918,7 @@ let drain_val = remaining_amount.saturating_sub(change_fee); if drain_val.is_dust(drain_script) { - let dust_threshold = drain_script.dust_value().to_sat(); + let dust_threshold = drain_script.minimal_non_dust().to_sat(); Excess::NoChange { dust_threshold, change_fee, diff --git a/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/export.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/export.rs.html index 3147db82c7..feb6ea26a0 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/export.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/export.rs.html @@ -513,7 +513,7 @@ fn check_ms<Ctx: ScriptContext>( terminal: &Terminal<String, Ctx>, ) -> Result<(), &'static str> { - if let Terminal::Multi(_, _) = terminal { + if let Terminal::Multi(_) = terminal { Ok(()) } else { Err("The descriptor contains operators not supported by Bitcoin Core") 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 67a62e84de..60fd767cc7 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 @@ -2597,6 +2597,7 @@ 2597 2598 2599 +2600
    // Bitcoin Dev Kit
     // Written in 2020 by Alekos Filini <alekos.filini@gmail.com>
     //
    @@ -3776,7 +3777,7 @@
             };
     
             let mut changeset = ChangeSet::default();
    -        let txid = tx.txid();
    +        let txid = tx.compute_txid();
             changeset.append(self.indexed_graph.insert_tx(tx).into());
             if let Some(anchor) = anchor {
                 changeset.append(self.indexed_graph.insert_anchor(txid, anchor).into());
    @@ -4077,10 +4078,7 @@
             let recipients = params.recipients.iter().map(|(r, v)| (r, *v));
     
             for (index, (script_pubkey, value)) in recipients.enumerate() {
    -            if !params.allow_dust
    -                && value.is_dust(script_pubkey)
    -                && !script_pubkey.is_provably_unspendable()
    -            {
    +            if !params.allow_dust && value.is_dust(script_pubkey) && !script_pubkey.is_op_return() {
                     return Err(CreateTxError::OutputBelowDustLimit(index));
                 }
     
    @@ -4234,7 +4232,7 @@
         /// let tx = psbt.clone().extract_tx().expect("tx");
         /// // broadcast tx but it's taking too long to confirm so we want to bump the fee
         /// let mut psbt =  {
    -    ///     let mut builder = wallet.build_fee_bump(tx.txid())?;
    +    ///     let mut builder = wallet.build_fee_bump(tx.compute_txid())?;
         ///     builder
         ///         .fee_rate(FeeRate::from_sat_per_vb(5).expect("valid feerate"));
         ///     builder.finish()?
    @@ -4272,7 +4270,9 @@
                 .iter()
                 .any(|txin| txin.sequence.to_consensus_u32() <= 0xFFFFFFFD)
             {
    -            return Err(BuildFeeBumpError::IrreplaceableTransaction(tx.txid()));
    +            return Err(BuildFeeBumpError::IrreplaceableTransaction(
    +                tx.compute_txid(),
    +            ));
             }
     
             let fee = self
    @@ -4303,7 +4303,8 @@
                             let satisfaction_weight = self
                                 .get_descriptor_for_keychain(keychain)
                                 .max_weight_to_satisfy()
    -                            .unwrap();
    +                            .unwrap()
    +                            .to_wu() as usize;
                             WeightedUtxo {
                                 utxo: Utxo::Local(LocalOutput {
                                     outpoint: txin.previous_output,
    @@ -4636,6 +4637,7 @@
                         self.get_descriptor_for_keychain(keychain)
                             .max_weight_to_satisfy()
                             .unwrap()
    +                        .to_wu() as usize
                     })
                 })
                 .collect()
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/signer.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/signer.rs.html
    index 7ec2ca5ae5..1596a23796 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/signer.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/signer.rs.html
    @@ -1192,6 +1192,30 @@
     1192
     1193
     1194
    +1195
    +1196
    +1197
    +1198
    +1199
    +1200
    +1201
    +1202
    +1203
    +1204
    +1205
    +1206
    +1207
    +1208
    +1209
    +1210
    +1211
    +1212
    +1213
    +1214
    +1215
    +1216
    +1217
    +1218
     
    // Bitcoin Dev Kit
     // Written in 2020 by Alekos Filini <alekos.filini@gmail.com>
     //
    @@ -1285,7 +1309,7 @@
     use bitcoin::hashes::hash160;
     use bitcoin::secp256k1::Message;
     use bitcoin::sighash::{EcdsaSighashType, TapSighash, TapSighashType};
    -use bitcoin::{ecdsa, psbt, sighash, taproot};
    +use bitcoin::{ecdsa, psbt, sighash, taproot, transaction};
     use bitcoin::{key::TapTweak, key::XOnlyPublicKey, secp256k1};
     use bitcoin::{PrivateKey, Psbt, PublicKey};
     
    @@ -1353,8 +1377,12 @@
         NonStandardSighash,
         /// Invalid SIGHASH for the signing context in use
         InvalidSighash,
    -    /// Error while computing the hash to sign
    -    SighashError(sighash::Error),
    +    /// Error while computing the hash to sign a P2WPKH input.
    +    SighashP2wpkh(sighash::P2wpkhError),
    +    /// Error while computing the hash to sign a Taproot input.
    +    SighashTaproot(sighash::TaprootError),
    +    /// Error while computing the hash, out of bounds access on the transaction inputs.
    +    TxInputsIndexError(transaction::InputsIndexError),
         /// Miniscript PSBT error
         MiniscriptPsbt(MiniscriptPsbtError),
         /// To be used only by external libraries implementing [`InputSigner`] or
    @@ -1363,9 +1391,21 @@
         External(String),
     }
     
    -impl From<sighash::Error> for SignerError {
    -    fn from(e: sighash::Error) -> Self {
    -        SignerError::SighashError(e)
    +impl From<transaction::InputsIndexError> for SignerError {
    +    fn from(v: transaction::InputsIndexError) -> Self {
    +        Self::TxInputsIndexError(v)
    +    }
    +}
    +
    +impl From<sighash::P2wpkhError> for SignerError {
    +    fn from(e: sighash::P2wpkhError) -> Self {
    +        Self::SighashP2wpkh(e)
    +    }
    +}
    +
    +impl From<sighash::TaprootError> for SignerError {
    +    fn from(e: sighash::TaprootError) -> Self {
    +        Self::SighashTaproot(e)
         }
     }
     
    @@ -1383,7 +1423,9 @@
                 Self::MissingHdKeypath => write!(f, "Missing fingerprint and derivation path"),
                 Self::NonStandardSighash => write!(f, "The psbt contains a non standard sighash"),
                 Self::InvalidSighash => write!(f, "Invalid SIGHASH for the signing context in use"),
    -            Self::SighashError(err) => write!(f, "Error while computing the hash to sign: {}", err),
    +            Self::SighashP2wpkh(err) => write!(f, "Error while computing the hash to sign a P2WPKH input: {}", err),
    +            Self::SighashTaproot(err) => write!(f, "Error while computing the hash to sign a Taproot input: {}", err),
    +            Self::TxInputsIndexError(err) => write!(f, "Error while computing the hash, out of bounds access on the transaction inputs: {}", err),
                 Self::MiniscriptPsbt(err) => write!(f, "Miniscript PSBT error: {}", err),
                 Self::External(err) => write!(f, "{}", err),
             }
    @@ -1743,21 +1785,24 @@
         secret_key: &secp256k1::SecretKey,
         pubkey: PublicKey,
         psbt_input: &mut psbt::Input,
    -    hash: impl bitcoin::hashes::Hash + bitcoin::secp256k1::ThirtyTwoByteHash,
    -    hash_ty: EcdsaSighashType,
    +    hash: impl bitcoin::hashes::Hash<Bytes = [u8; 32]>,
    +    sighash_type: EcdsaSighashType,
         secp: &SecpCtx,
         allow_grinding: bool,
     ) {
    -    let msg = &Message::from(hash);
    -    let sig = if allow_grinding {
    +    let msg = &Message::from_digest(hash.to_byte_array());
    +    let signature = if allow_grinding {
             secp.sign_ecdsa_low_r(msg, secret_key)
         } else {
             secp.sign_ecdsa(msg, secret_key)
         };
    -    secp.verify_ecdsa(msg, &sig, &pubkey.inner)
    +    secp.verify_ecdsa(msg, &signature, &pubkey.inner)
             .expect("invalid or corrupted ecdsa signature");
     
    -    let final_signature = ecdsa::Signature { sig, hash_ty };
    +    let final_signature = ecdsa::Signature {
    +        signature,
    +        sighash_type,
    +    };
         psbt_input.partial_sigs.insert(pubkey, final_signature);
     }
     
    @@ -1768,7 +1813,7 @@
         leaf_hash: Option<taproot::TapLeafHash>,
         psbt_input: &mut psbt::Input,
         hash: TapSighash,
    -    hash_ty: TapSighashType,
    +    sighash_type: TapSighashType,
         secp: &SecpCtx,
     ) {
         let keypair = secp256k1::Keypair::from_seckey_slice(secp, secret_key.as_ref()).unwrap();
    @@ -1780,11 +1825,14 @@
         };
     
         let msg = &Message::from(hash);
    -    let sig = secp.sign_schnorr(msg, &keypair);
    -    secp.verify_schnorr(&sig, msg, &XOnlyPublicKey::from_keypair(&keypair).0)
    +    let signature = secp.sign_schnorr(msg, &keypair);
    +    secp.verify_schnorr(&signature, msg, &XOnlyPublicKey::from_keypair(&keypair).0)
             .expect("invalid or corrupted schnorr signature");
     
    -    let final_signature = taproot::Signature { sig, hash_ty };
    +    let final_signature = taproot::Signature {
    +        signature,
    +        sighash_type,
    +    };
     
         if let Some(lh) = leaf_hash {
             psbt_input
    @@ -2127,7 +2175,7 @@
             // Always try first with the non-witness utxo
             let utxo = if let Some(prev_tx) = &psbt_input.non_witness_utxo {
                 // Check the provided prev-tx
    -            if prev_tx.txid() != tx_input.previous_output.txid {
    +            if prev_tx.compute_txid() != tx_input.previous_output.txid {
                     return Err(SignerError::InvalidNonWitnessUtxo);
                 }
     
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/tx_builder.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/tx_builder.rs.html
    index f9e88aef9b..6b61153b0d 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/tx_builder.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/tx_builder.rs.html
    @@ -998,6 +998,8 @@
     998
     999
     1000
    +1001
    +1002
     
    // Bitcoin Dev Kit
     // Written in 2020 by Alekos Filini <alekos.filini@gmail.com>
     //
    @@ -1295,7 +1297,9 @@
     
                 for utxo in utxos {
                     let descriptor = wallet.get_descriptor_for_keychain(utxo.keychain);
    -                let satisfaction_weight = descriptor.max_weight_to_satisfy().unwrap();
    +
    +                let satisfaction_weight =
    +                    descriptor.max_weight_to_satisfy().unwrap().to_wu() as usize;
                     self.params.utxos.push(WeightedUtxo {
                         satisfaction_weight,
                         utxo: Utxo::Local(utxo),
    @@ -1385,9 +1389,9 @@
             if psbt_input.witness_utxo.is_none() {
                 match psbt_input.non_witness_utxo.as_ref() {
                     Some(tx) => {
    -                    if tx.txid() != outpoint.txid {
    +                    if tx.compute_txid() != outpoint.txid {
                             return Err(AddForeignUtxoError::InvalidTxid {
    -                            input_txid: tx.txid(),
    +                            input_txid: tx.compute_txid(),
                                 foreign_utxo: outpoint,
                             });
                         }
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/utils.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/utils.rs.html
    index d397e3d9d8..8d3c03d3c5 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/utils.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_wallet/wallet/utils.rs.html
    @@ -195,7 +195,7 @@
     // licenses.
     
     use bitcoin::secp256k1::{All, Secp256k1};
    -use bitcoin::{absolute, Script, Sequence};
    +use bitcoin::{absolute, relative, Script, Sequence};
     
     use miniscript::{MiniscriptKey, Satisfier, ToPublicKey};
     
    @@ -211,7 +211,7 @@
     
     impl IsDust for u64 {
         fn is_dust(&self, script: &Script) -> bool {
    -        *self < script.dust_value().to_sat()
    +        *self < script.minimal_non_dust().to_sat()
         }
     }
     
    @@ -280,7 +280,7 @@
     }
     
     impl<Pk: MiniscriptKey + ToPublicKey> Satisfier<Pk> for Older {
    -    fn check_older(&self, n: Sequence) -> bool {
    +    fn check_older(&self, n: relative::LockTime) -> bool {
             if let Some(current_height) = self.current_height {
                 // TODO: test >= / >
                 current_height
    diff --git a/docs-rs/bdk/nightly/latest/src/example_cli/lib.rs.html b/docs-rs/bdk/nightly/latest/src/example_cli/lib.rs.html
    index 1fe754240e..5043c503e8 100644
    --- a/docs-rs/bdk/nightly/latest/src/example_cli/lib.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/example_cli/lib.rs.html
    @@ -1382,7 +1382,7 @@
     
                 match (broadcast)(chain_specific, &transaction) {
                     Ok(_) => {
    -                    println!("Broadcasted Tx : {}", transaction.txid());
    +                    println!("Broadcasted Tx : {}", transaction.compute_txid());
     
                         let keychain_changeset = graph.lock().unwrap().insert_tx(transaction);
     
    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 9a0fdae2c4..bbe374fbe4 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
    @@ -194,7 +194,7 @@
     
         let tx = psbt.extract_tx()?;
         client.transaction_broadcast(&tx)?;
    -    println!("Tx broadcasted! Txid: {}", tx.txid());
    +    println!("Tx broadcasted! Txid: {}", tx.compute_txid());
     
         Ok(())
     }
    diff --git a/docs-rs/bdk/nightly/latest/src/wallet_esplora_async/main.rs.html b/docs-rs/bdk/nightly/latest/src/wallet_esplora_async/main.rs.html
    index e6f9449433..e2745b6b79 100644
    --- a/docs-rs/bdk/nightly/latest/src/wallet_esplora_async/main.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/wallet_esplora_async/main.rs.html
    @@ -212,7 +212,7 @@
     
         let tx = psbt.extract_tx()?;
         client.broadcast(&tx).await?;
    -    println!("Tx broadcasted! Txid: {}", tx.txid());
    +    println!("Tx broadcasted! Txid: {}", tx.compute_txid());
     
         Ok(())
     }
    diff --git a/docs-rs/bdk/nightly/latest/src/wallet_esplora_blocking/main.rs.html b/docs-rs/bdk/nightly/latest/src/wallet_esplora_blocking/main.rs.html
    index d6b858b515..90dcd69c4a 100644
    --- a/docs-rs/bdk/nightly/latest/src/wallet_esplora_blocking/main.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/wallet_esplora_blocking/main.rs.html
    @@ -166,7 +166,7 @@
     
         let tx = psbt.extract_tx()?;
         client.broadcast(&tx)?;
    -    println!("Tx broadcasted! Txid: {}", tx.txid());
    +    println!("Tx broadcasted! Txid: {}", tx.compute_txid());
     
         Ok(())
     }
    diff --git a/docs-rs/bdk/nightly/latest/trait.impl/bdk_persist/persist/trait.PersistBackend.js b/docs-rs/bdk/nightly/latest/trait.impl/bdk_persist/persist/trait.PersistBackend.js
    index 3b174df996..52fe17caf5 100644
    --- a/docs-rs/bdk/nightly/latest/trait.impl/bdk_persist/persist/trait.PersistBackend.js
    +++ b/docs-rs/bdk/nightly/latest/trait.impl/bdk_persist/persist/trait.PersistBackend.js
    @@ -1,5 +1,5 @@
     (function() {var implementors = {
     "bdk_file_store":[["impl<C> PersistBackend<C> for Store<C>
    where\n C: Append + Serialize + DeserializeOwned + Send + Sync,
    "]], "bdk_persist":[], -"bdk_sqlite":[["impl<K, A, C> PersistBackend<C> for Store<K, A>
    where\n K: Ord + for<'de> Deserialize<'de> + Serialize + Send,\n A: Anchor + for<'de> Deserialize<'de> + Serialize + Send,\n C: Clone + From<CombinedChangeSet<K, A>> + Into<CombinedChangeSet<K, A>>,
    "]] +"bdk_sqlite":[["impl<K, A, C> PersistBackend<C> for Store<K, A>
    where\n K: Ord + for<'de> Deserialize<'de> + Serialize + Send,\n A: Anchor + for<'de> Deserialize<'de> + Serialize + Send,\n C: Clone + From<CombinedChangeSet<K, A>> + Into<CombinedChangeSet<K, A>>,
    "]] };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.From.js b/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.From.js index 1330e6aa11..53151dcc28 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.From.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.From.js @@ -3,7 +3,7 @@ "bdk_coin_select":[["impl From<usize> for BnbLimit"],["impl From<Duration> for BnbLimit"]], "bdk_file_store":[["impl From<Error> for FileError"],["impl From<Error> for IterError"]], "bdk_persist":[["impl<K, A> From<BTreeMap<u32, Option<BlockHash>>> for CombinedChangeSet<K, A>"],["impl<K, A> From<ChangeSet<A, ChangeSet<K>>> for CombinedChangeSet<K, A>"]], -"bdk_tmp_plan":[["impl From<Error> for SigningError"],["impl From<Error> for SigningError"]], -"bdk_wallet":[["impl From<Error> for CreateTxError"],["impl From<PolicyError> for Error"],["impl From<PolicyError> for CreateTxError"],["impl From<SatisfiableItem> for Policy"],["impl From<KeyError> for Error"],["impl From<Error> for CreateTxError"],["impl From<MiniscriptPsbtError> for CreateTxError"],["impl From<bool> for Satisfaction"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for KeyError"],["impl From<Error> for KeyError"],["impl From<Error> for CreateTxError"],["impl From<Error> for SignerError"],["impl From<Fingerprint> for SignerId"],["impl From<FullScanResult<KeychainKind>> for Update"],["impl From<Hash> for SignerId"],["impl From<HexToBytesError> for Error"],["impl From<SyncResult> for Update"],["impl<Ctx: ScriptContext> From<Xpriv> for ExtendedKey<Ctx>"],["impl<Ctx: ScriptContext> From<Xpub> for ExtendedKey<Ctx>"]], +"bdk_tmp_plan":[["impl From<Error> for SigningError"],["impl From<P2wpkhError> for SigningError"],["impl From<TaprootError> for SigningError"]], +"bdk_wallet":[["impl From<Error> for CreateTxError"],["impl From<PolicyError> for Error"],["impl From<PolicyError> for CreateTxError"],["impl From<SatisfiableItem> for Policy"],["impl From<KeyError> for Error"],["impl From<Error> for CreateTxError"],["impl From<MiniscriptPsbtError> for CreateTxError"],["impl From<bool> for Satisfaction"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for KeyError"],["impl From<Error> for KeyError"],["impl From<Error> for CreateTxError"],["impl From<Fingerprint> for SignerId"],["impl From<FullScanResult<KeychainKind>> for Update"],["impl From<Hash> for SignerId"],["impl From<HexToBytesError> for Error"],["impl From<InputsIndexError> for SignerError"],["impl From<P2wpkhError> for SignerError"],["impl From<ParsePublicKeyError> for Error"],["impl From<SyncResult> for Update"],["impl From<TaprootError> for SignerError"],["impl<Ctx: ScriptContext> From<Xpriv> for ExtendedKey<Ctx>"],["impl<Ctx: ScriptContext> From<Xpub> for ExtendedKey<Ctx>"]], "example_bitcoind_rpc_polling":[["impl From<RpcArgs> for Auth"]] };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/type.impl/bdk_wallet/descriptor/enum.Descriptor.js b/docs-rs/bdk/nightly/latest/type.impl/bdk_wallet/descriptor/enum.Descriptor.js index 683c65b80f..a405cef60f 100644 --- a/docs-rs/bdk/nightly/latest/type.impl/bdk_wallet/descriptor/enum.Descriptor.js +++ b/docs-rs/bdk/nightly/latest/type.impl/bdk_wallet/descriptor/enum.Descriptor.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"bdk_wallet":[["
    §

    impl<Pk> Clone for Descriptor<Pk>
    where\n Pk: Clone + MiniscriptKey,

    §

    fn clone(&self) -> Descriptor<Pk>

    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
    ","Clone","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> Debug for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

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

    Formats the value using the given formatter. Read more
    ","Debug","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl Descriptor<DefiniteDescriptorKey>

    pub fn derived_descriptor<C>(\n &self,\n secp: &Secp256k1<C>\n) -> Result<Descriptor<PublicKey>, ConversionError>
    where\n C: Verification,

    Convert all the public keys in the descriptor to [bitcoin::PublicKey] by deriving them or\notherwise converting them. All [bitcoin::secp256k1::XOnlyPublicKey]s are converted to by adding a\ndefault(0x02) y-coordinate.

    \n
    §Examples
    \n
    use miniscript::descriptor::{Descriptor, DescriptorPublicKey};\nuse miniscript::bitcoin::secp256k1;\nuse std::str::FromStr;\n\n// test from bip 86\nlet secp = secp256k1::Secp256k1::verification_only();\nlet descriptor = Descriptor::<DescriptorPublicKey>::from_str(\"tr(xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*)\")\n    .expect(\"Valid ranged descriptor\");\nlet result = descriptor.at_derivation_index(0).unwrap().derived_descriptor(&secp).expect(\"Non-hardened derivation\");\nassert_eq!(result.to_string(), \"tr(03cc8a4bc64d897bddc5fbc2f670f7a8ba0b386779106cf1223c6fc5d7cd6fc115)#6qm9h8ym\");
    \n
    §Errors
    \n

    This function will return an error if hardened derivation is attempted.

    \n
    ",0,"bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl Descriptor<DefiniteDescriptorKey>

    pub fn plan<P>(\n self,\n provider: &P\n) -> Result<Plan, Descriptor<DefiniteDescriptorKey>>
    where\n P: AssetProvider<DefiniteDescriptorKey>,

    Returns a plan if the provided assets are sufficient to produce a non-malleable satisfaction

    \n

    If the assets aren’t sufficient for generating a Plan, the descriptor is returned

    \n

    pub fn plan_mall<P>(\n self,\n provider: &P\n) -> Result<Plan, Descriptor<DefiniteDescriptorKey>>
    where\n P: AssetProvider<DefiniteDescriptorKey>,

    Returns a plan if the provided assets are sufficient to produce a malleable satisfaction

    \n

    If the assets aren’t sufficient for generating a Plan, the descriptor is returned

    \n
    ",0,"bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl Descriptor<DescriptorPublicKey>

    pub fn is_deriveable(&self) -> bool

    👎Deprecated: use has_wildcards instead

    Whether or not the descriptor has any wildcards

    \n

    pub fn has_wildcard(&self) -> bool

    Whether or not the descriptor has any wildcards i.e. /*.

    \n

    pub fn at_derivation_index(\n &self,\n index: u32\n) -> Result<Descriptor<DefiniteDescriptorKey>, ConversionError>

    Replaces all wildcards (i.e. /*) in the descriptor with a particular derivation index,\nturning it into a definite descriptor.

    \n
    §Errors
    \n
      \n
    • If index ≥ 2^31
    • \n
    \n

    pub fn derive(\n &self,\n index: u32\n) -> Result<Descriptor<DefiniteDescriptorKey>, ConversionError>

    👎Deprecated: use at_derivation_index instead

    Deprecated name for Self::at_derivation_index.

    \n

    pub fn derived_descriptor<C>(\n &self,\n secp: &Secp256k1<C>,\n index: u32\n) -> Result<Descriptor<PublicKey>, ConversionError>
    where\n C: Verification,

    Convert all the public keys in the descriptor to [bitcoin::PublicKey] by deriving them or\notherwise converting them. All [bitcoin::secp256k1::XOnlyPublicKey]s are converted to by adding a\ndefault(0x02) y-coordinate.

    \n

    This is a shorthand for:

    \n\n
        .expect(\"Valid ranged descriptor\");\nlet derived_descriptor = descriptor.at_derivation_index(index).unwrap().derived_descriptor(&secp).unwrap();
    \n

    and is only here really here for backwards compatbility.\nSee at_derivation_index and [derived_descriptor] for more documentation.

    \n
    §Errors
    \n

    This function will return an error if hardened derivation is attempted.

    \n

    pub fn parse_descriptor<C>(\n secp: &Secp256k1<C>,\n s: &str\n) -> Result<(Descriptor<DescriptorPublicKey>, BTreeMap<DescriptorPublicKey, DescriptorSecretKey>), Error>
    where\n C: Signing,

    Parse a descriptor that may contain secret keys

    \n

    Internally turns every secret key found into the corresponding public key and then returns a\na descriptor that only contains public keys and a map to lookup the secret key given a public key.

    \n

    pub fn to_string_with_secret(\n &self,\n key_map: &BTreeMap<DescriptorPublicKey, DescriptorSecretKey>\n) -> String

    Serialize a descriptor to string with its secret keys

    \n

    pub fn find_derivation_index_for_spk<C>(\n &self,\n secp: &Secp256k1<C>,\n script_pubkey: &Script,\n range: Range<u32>\n) -> Result<Option<(u32, Descriptor<PublicKey>)>, ConversionError>
    where\n C: Verification,

    Utility method for deriving the descriptor at each index in a range to find one matching\nscript_pubkey.

    \n

    If it finds a match then it returns the index it was derived at and the concrete\ndescriptor at that index. If the descriptor is non-derivable then it will simply check the\nscript pubkey against the descriptor and return it if it matches (in this case the index\nreturned will be meaningless).

    \n

    pub fn is_multipath(&self) -> bool

    Whether this descriptor contains a key that has multiple derivation paths.

    \n

    pub fn into_single_descriptors(\n self\n) -> Result<Vec<Descriptor<DescriptorPublicKey>>, Error>

    Get as many descriptors as different paths in this descriptor.

    \n

    For multipath descriptors it will return as many descriptors as there is\n“parallel” paths. For regular descriptors it will just return itself.

    \n
    ",0,"bdk_wallet::descriptor::ExtendedDescriptor"],["
    §

    impl<Pk> Descriptor<Pk>
    where\n Pk: MiniscriptKey + ToPublicKey,

    pub fn address(&self, network: Network) -> Result<Address, Error>

    Computes the Bitcoin address of the descriptor, if one exists

    \n

    Some descriptors like pk() don’t have an address.

    \n
    §Errors
    \n

    For raw/bare descriptors that don’t have an address.

    \n

    pub fn script_pubkey(&self) -> ScriptBuf

    Computes the scriptpubkey of the descriptor.

    \n

    pub fn unsigned_script_sig(&self) -> ScriptBuf

    Computes the scriptSig that will be in place for an unsigned input\nspending an output with this descriptor. For pre-segwit descriptors,\nwhich use the scriptSig for signatures, this returns the empty script.

    \n

    This is used in Segwit transactions to produce an unsigned transaction\nwhose txid will not change during signing (since only the witness data\nwill change).

    \n

    pub fn explicit_script(&self) -> Result<ScriptBuf, Error>

    Computes the the underlying script before any hashing is done. For\nBare, Pkh and Wpkh this is the scriptPubkey; for ShWpkh and Sh\nthis is the redeemScript; for the others it is the witness script.

    \n
    §Errors
    \n

    If the descriptor is a taproot descriptor.

    \n

    pub fn script_code(&self) -> Result<ScriptBuf, Error>

    Computes the scriptCode of a transaction output.

    \n

    The scriptCode is the Script of the previous transaction output being\nserialized in the sighash when evaluating a CHECKSIG & co. OP code.

    \n
    §Errors
    \n

    If the descriptor is a taproot descriptor.

    \n

    pub fn get_satisfaction<S>(\n &self,\n satisfier: S\n) -> Result<(Vec<Vec<u8>>, ScriptBuf), Error>
    where\n S: Satisfier<Pk>,

    Returns satisfying non-malleable witness and scriptSig to spend an\noutput controlled by the given descriptor if it possible to\nconstruct one using the satisfier S.

    \n

    pub fn get_satisfaction_mall<S>(\n &self,\n satisfier: S\n) -> Result<(Vec<Vec<u8>>, ScriptBuf), Error>
    where\n S: Satisfier<Pk>,

    Returns a possilbly mallable satisfying non-malleable witness and scriptSig to spend an\noutput controlled by the given descriptor if it possible to\nconstruct one using the satisfier S.

    \n

    pub fn satisfy<S>(&self, txin: &mut TxIn, satisfier: S) -> Result<(), Error>
    where\n S: Satisfier<Pk>,

    Attempts to produce a non-malleable satisfying witness and scriptSig to spend an\noutput controlled by the given descriptor; add the data to a given\nTxIn output.

    \n
    ",0,"bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    pub fn new_pk(pk: Pk) -> Descriptor<Pk>

    Create a new pk descriptor

    \n

    pub fn new_pkh(pk: Pk) -> Result<Descriptor<Pk>, Error>

    Create a new PkH descriptor

    \n

    pub fn new_wpkh(pk: Pk) -> Result<Descriptor<Pk>, Error>

    Create a new Wpkh descriptor\nWill return Err if uncompressed key is used

    \n

    pub fn new_sh_wpkh(pk: Pk) -> Result<Descriptor<Pk>, Error>

    Create a new sh wrapped wpkh from Pk.\nErrors when uncompressed keys are supplied

    \n

    pub fn new_sh(ms: Miniscript<Pk, Legacy>) -> Result<Descriptor<Pk>, Error>

    Create a new sh for a given redeem script\nErrors when miniscript exceeds resource limits under p2sh context\nor does not type check at the top level

    \n

    pub fn new_wsh(ms: Miniscript<Pk, Segwitv0>) -> Result<Descriptor<Pk>, Error>

    Create a new wsh descriptor from witness script\nErrors when miniscript exceeds resource limits under p2sh context\nor does not type check at the top level

    \n

    pub fn new_sh_wsh(ms: Miniscript<Pk, Segwitv0>) -> Result<Descriptor<Pk>, Error>

    Create a new sh wrapped wsh descriptor with witness script\nErrors when miniscript exceeds resource limits under wsh context\nor does not type check at the top level

    \n

    pub fn new_bare(ms: Miniscript<Pk, BareCtx>) -> Result<Descriptor<Pk>, Error>

    Create a new bare descriptor from witness script\nErrors when miniscript exceeds resource limits under bare context\nor does not type check at the top level

    \n

    pub fn new_sh_with_wpkh(wpkh: Wpkh<Pk>) -> Descriptor<Pk>

    Create a new sh wrapper for the given wpkh descriptor

    \n

    pub fn new_sh_with_wsh(wsh: Wsh<Pk>) -> Descriptor<Pk>

    Create a new sh wrapper for the given wsh descriptor

    \n

    pub fn new_sh_sortedmulti(\n k: usize,\n pks: Vec<Pk>\n) -> Result<Descriptor<Pk>, Error>

    Create a new sh sortedmulti descriptor with threshold k\nand Vec of pks.\nErrors when miniscript exceeds resource limits under p2sh context

    \n

    pub fn new_sh_wsh_sortedmulti(\n k: usize,\n pks: Vec<Pk>\n) -> Result<Descriptor<Pk>, Error>

    Create a new sh wrapped wsh sortedmulti descriptor from threshold\nk and Vec of pks\nErrors when miniscript exceeds resource limits under segwit context

    \n

    pub fn new_wsh_sortedmulti(\n k: usize,\n pks: Vec<Pk>\n) -> Result<Descriptor<Pk>, Error>

    Create a new wsh sorted multi descriptor\nErrors when miniscript exceeds resource limits under p2sh context

    \n

    pub fn new_tr(\n key: Pk,\n script: Option<TapTree<Pk>>\n) -> Result<Descriptor<Pk>, Error>

    Create new tr descriptor\nErrors when miniscript exceeds resource limits under Tap context

    \n

    pub fn desc_type(&self) -> DescriptorType

    Get the [DescriptorType] of Descriptor

    \n

    pub fn sanity_check(&self) -> Result<(), Error>

    Checks whether the descriptor is safe.

    \n

    Checks whether all the spend paths in the descriptor are possible on the\nbitcoin network under the current standardness and consensus rules. Also\nchecks whether the descriptor requires signatures on all spend paths and\nwhether the script is malleable.

    \n

    In general, all the guarantees of miniscript hold only for safe scripts.\nThe signer may not be able to find satisfactions even if one exists.

    \n

    pub fn max_weight_to_satisfy(&self) -> Result<usize, Error>

    Computes an upper bound on the difference between a non-satisfied\nTxIn’s segwit_weight and a satisfied TxIn’s segwit_weight

    \n

    Since this method uses segwit_weight instead of legacy_weight,\nif you want to include only legacy inputs in your transaction,\nyou should remove 1WU from each input’s max_weight_to_satisfy\nfor a more accurate estimate.

    \n

    In other words, for segwit inputs or legacy inputs included in\nsegwit transactions, the following will hold for each input if\nthat input was satisfied with the largest possible witness:

    \n\n
    for i in 0..transaction.input.len() {\n    assert_eq!(\n        descriptor_for_input[i].max_weight_to_satisfy(),\n        transaction.input[i].segwit_weight() - TxIn::default().segwit_weight()\n    );\n}
    \n

    Instead, for legacy transactions, the following will hold for each input\nif that input was satisfied with the largest possible witness:

    \n\n
    for i in 0..transaction.input.len() {\n    assert_eq!(\n        descriptor_for_input[i].max_weight_to_satisfy(),\n        transaction.input[i].legacy_weight() - TxIn::default().legacy_weight()\n    );\n}
    \n

    Assumes all ECDSA signatures are 73 bytes, including push opcode and\nsighash suffix.\nAssumes all Schnorr signatures are 66 bytes, including push opcode and\nsighash suffix.

    \n
    §Errors
    \n

    When the descriptor is impossible to safisfy (ex: sh(OP_FALSE)).

    \n

    pub fn max_satisfaction_weight(&self) -> Result<usize, Error>

    👎Deprecated: use max_weight_to_satisfy instead

    Computes an upper bound on the weight of a satisfying witness to the\ntransaction.

    \n

    Assumes all ec-signatures are 73 bytes, including push opcode and\nsighash suffix. Includes the weight of the VarInts encoding the\nscriptSig and witness stack length.

    \n
    §Errors
    \n

    When the descriptor is impossible to safisfy (ex: sh(OP_FALSE)).

    \n
    ",0,"bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl DescriptorExt for Descriptor<DescriptorPublicKey>

    §

    fn dust_value(&self) -> u64

    Returns the minimum value (in satoshis) at which an output is broadcastable.\nPanics if the descriptor wildcard is hardened.
    §

    fn descriptor_id(&self) -> DescriptorId

    Returns the descriptor id, calculated as the sha256 of the descriptor, checksum not\nincluded.
    ","DescriptorExt","bdk_wallet::descriptor::ExtendedDescriptor"],["
    §

    impl<'de, Pk> Deserialize<'de> for Descriptor<Pk>
    where\n Pk: MiniscriptKey + FromStr,\n <Pk as MiniscriptKey>::Sha256: FromStr,\n <Pk as MiniscriptKey>::Hash256: FromStr,\n <Pk as MiniscriptKey>::Ripemd160: FromStr,\n <Pk as MiniscriptKey>::Hash160: FromStr,\n <Pk as FromStr>::Err: Display,\n <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: Display,\n <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: Display,\n <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: Display,\n <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: Display,

    §

    fn deserialize<D>(\n deserializer: D\n) -> Result<Descriptor<Pk>, <D as Deserializer<'de>>::Error>
    where\n D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    ","Deserialize<'de>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> Display for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

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

    Formats the value using the given formatter. Read more
    ","Display","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    source§

    impl ExtractPolicy for Descriptor<DescriptorPublicKey>

    source§

    fn extract_policy(\n &self,\n signers: &SignersContainer,\n build_sat: BuildSatisfaction<'_>,\n secp: &Secp256k1<All>\n) -> Result<Option<Policy>, Error>

    Extract the spending policy
    ","ExtractPolicy","bdk_wallet::descriptor::ExtendedDescriptor"],["
    §

    impl<Pk> ForEachKey<Pk> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn for_each_key<'a, F>(&'a self, pred: F) -> bool
    where\n F: FnMut(&'a Pk) -> bool,

    Run a predicate on every key in the descriptor, returning whether\nthe predicate returned true for every key
    §

    fn for_any_key<'a, F>(&'a self, pred: F) -> bool
    where\n F: FnMut(&'a Pk) -> bool,\n Pk: 'a,

    Run a predicate on every key in the descriptor, returning whether\nthe predicate returned true for any key
    ","ForEachKey","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> From<Bare<Pk>> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn from(inner: Bare<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    ","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> From<Pkh<Pk>> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn from(inner: Pkh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    ","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> From<Sh<Pk>> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn from(inner: Sh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    ","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> From<Tr<Pk>> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn from(inner: Tr<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    ","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> From<Wpkh<Pk>> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn from(inner: Wpkh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    ","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> From<Wsh<Pk>> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn from(inner: Wsh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    ","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> FromStr for Descriptor<Pk>
    where\n Pk: MiniscriptKey + FromStr,\n <Pk as MiniscriptKey>::Sha256: FromStr,\n <Pk as MiniscriptKey>::Hash256: FromStr,\n <Pk as MiniscriptKey>::Ripemd160: FromStr,\n <Pk as MiniscriptKey>::Hash160: FromStr,\n <Pk as FromStr>::Err: ToString,\n <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,\n <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,\n <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,\n <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,

    §

    type Err = Error

    The associated error which can be returned from parsing.
    §

    fn from_str(s: &str) -> Result<Descriptor<Pk>, Error>

    Parses a string s to return a value of this type. Read more
    ","FromStr","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> FromTree for Descriptor<Pk>
    where\n Pk: MiniscriptKey + FromStr,\n <Pk as MiniscriptKey>::Sha256: FromStr,\n <Pk as MiniscriptKey>::Hash256: FromStr,\n <Pk as MiniscriptKey>::Ripemd160: FromStr,\n <Pk as MiniscriptKey>::Hash160: FromStr,\n <Pk as FromStr>::Err: ToString,\n <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,\n <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,\n <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,\n <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,

    §

    fn from_tree(top: &Tree<'_>) -> Result<Descriptor<Pk>, Error>

    Parse an expression tree into a descriptor.

    \n
    ","FromTree","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> Hash for Descriptor<Pk>
    where\n Pk: Hash + MiniscriptKey,

    §

    fn hash<__H>(&self, state: &mut __H)
    where\n __H: Hasher,

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where\n H: Hasher,\n Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    ","Hash","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> Liftable<Pk> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn lift(&self) -> Result<Policy<Pk>, Error>

    Converts this object into an abstract policy.
    ","Liftable","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> Ord for Descriptor<Pk>
    where\n Pk: Ord + MiniscriptKey,

    §

    fn cmp(&self, other: &Descriptor<Pk>) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Self
    where\n Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · source§

    fn min(self, other: Self) -> Self
    where\n Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · source§

    fn clamp(self, min: Self, max: Self) -> Self
    where\n Self: Sized + PartialOrd,

    Restrict a value to a certain interval. Read more
    ","Ord","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> PartialEq for Descriptor<Pk>
    where\n Pk: PartialEq + MiniscriptKey,

    §

    fn eq(&self, other: &Descriptor<Pk>) -> 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_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> PartialOrd for Descriptor<Pk>
    where\n Pk: PartialOrd + MiniscriptKey,

    §

    fn partial_cmp(&self, other: &Descriptor<Pk>) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

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

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

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

    This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
    1.0.0 · source§

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

    This method tests greater than (for self and other) and is used by the > operator. Read more
    1.0.0 · source§

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

    This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
    ","PartialOrd","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<'de, Pk> Serialize for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    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_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<P, Q> TranslatePk<P, Q> for Descriptor<P>
    where\n P: MiniscriptKey,\n Q: MiniscriptKey,

    §

    fn translate_pk<T, E>(\n &self,\n t: &mut T\n) -> Result<<Descriptor<P> as TranslatePk<P, Q>>::Output, TranslateErr<E>>
    where\n T: Translator<P, Q, E>,

    Converts a descriptor using abstract keys to one using specific keys.

    \n
    §

    type Output = Descriptor<Q>

    The associated output type. This must be Self<Q>.
    ","TranslatePk","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> Eq for Descriptor<Pk>
    where\n Pk: Eq + MiniscriptKey,

    ","Eq","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> StructuralPartialEq for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    ","StructuralPartialEq","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"]] +"bdk_wallet":[["
    §

    impl<Pk> Clone for Descriptor<Pk>
    where\n Pk: Clone + MiniscriptKey,

    §

    fn clone(&self) -> Descriptor<Pk>

    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
    ","Clone","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> Debug for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

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

    Formats the value using the given formatter. Read more
    ","Debug","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl Descriptor<DefiniteDescriptorKey>

    pub fn derived_descriptor<C>(\n &self,\n secp: &Secp256k1<C>\n) -> Result<Descriptor<PublicKey>, ConversionError>
    where\n C: Verification,

    Convert all the public keys in the descriptor to [bitcoin::PublicKey] by deriving them or\notherwise converting them. All [bitcoin::secp256k1::XOnlyPublicKey]s are converted to by adding a\ndefault(0x02) y-coordinate.

    \n
    §Examples
    \n
    use miniscript::descriptor::{Descriptor, DescriptorPublicKey};\nuse miniscript::bitcoin::secp256k1;\nuse std::str::FromStr;\n\n// test from bip 86\nlet secp = secp256k1::Secp256k1::verification_only();\nlet descriptor = Descriptor::<DescriptorPublicKey>::from_str(\"tr(xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*)\")\n    .expect(\"Valid ranged descriptor\");\nlet result = descriptor.at_derivation_index(0).unwrap().derived_descriptor(&secp).expect(\"Non-hardened derivation\");\nassert_eq!(result.to_string(), \"tr(03cc8a4bc64d897bddc5fbc2f670f7a8ba0b386779106cf1223c6fc5d7cd6fc115)#6qm9h8ym\");
    \n
    §Errors
    \n

    This function will return an error if hardened derivation is attempted.

    \n
    ",0,"bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl Descriptor<DefiniteDescriptorKey>

    pub fn plan<P>(\n self,\n provider: &P\n) -> Result<Plan, Descriptor<DefiniteDescriptorKey>>
    where\n P: AssetProvider<DefiniteDescriptorKey>,

    Returns a plan if the provided assets are sufficient to produce a non-malleable satisfaction

    \n

    If the assets aren’t sufficient for generating a Plan, the descriptor is returned

    \n

    pub fn plan_mall<P>(\n self,\n provider: &P\n) -> Result<Plan, Descriptor<DefiniteDescriptorKey>>
    where\n P: AssetProvider<DefiniteDescriptorKey>,

    Returns a plan if the provided assets are sufficient to produce a malleable satisfaction

    \n

    If the assets aren’t sufficient for generating a Plan, the descriptor is returned

    \n
    ",0,"bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl Descriptor<DescriptorPublicKey>

    pub fn is_deriveable(&self) -> bool

    👎Deprecated: use has_wildcards instead

    Whether or not the descriptor has any wildcards

    \n

    pub fn has_wildcard(&self) -> bool

    Whether or not the descriptor has any wildcards i.e. /*.

    \n

    pub fn at_derivation_index(\n &self,\n index: u32\n) -> Result<Descriptor<DefiniteDescriptorKey>, ConversionError>

    Replaces all wildcards (i.e. /*) in the descriptor with a particular derivation index,\nturning it into a definite descriptor.

    \n
    §Errors
    \n
      \n
    • If index ≥ 2^31
    • \n
    \n

    pub fn derive(\n &self,\n index: u32\n) -> Result<Descriptor<DefiniteDescriptorKey>, ConversionError>

    👎Deprecated: use at_derivation_index instead

    Deprecated name for Self::at_derivation_index.

    \n

    pub fn derived_descriptor<C>(\n &self,\n secp: &Secp256k1<C>,\n index: u32\n) -> Result<Descriptor<PublicKey>, ConversionError>
    where\n C: Verification,

    Convert all the public keys in the descriptor to [bitcoin::PublicKey] by deriving them or\notherwise converting them. All [bitcoin::secp256k1::XOnlyPublicKey]s are converted to by adding a\ndefault(0x02) y-coordinate.

    \n

    This is a shorthand for:

    \n\n
        .expect(\"Valid ranged descriptor\");\nlet derived_descriptor = descriptor.at_derivation_index(index).unwrap().derived_descriptor(&secp).unwrap();
    \n

    and is only here really here for backwards compatbility.\nSee at_derivation_index and [derived_descriptor] for more documentation.

    \n
    §Errors
    \n

    This function will return an error if hardened derivation is attempted.

    \n

    pub fn parse_descriptor<C>(\n secp: &Secp256k1<C>,\n s: &str\n) -> Result<(Descriptor<DescriptorPublicKey>, BTreeMap<DescriptorPublicKey, DescriptorSecretKey>), Error>
    where\n C: Signing,

    Parse a descriptor that may contain secret keys

    \n

    Internally turns every secret key found into the corresponding public key and then returns a\na descriptor that only contains public keys and a map to lookup the secret key given a public key.

    \n

    pub fn to_string_with_secret(\n &self,\n key_map: &BTreeMap<DescriptorPublicKey, DescriptorSecretKey>\n) -> String

    Serialize a descriptor to string with its secret keys

    \n

    pub fn find_derivation_index_for_spk<C>(\n &self,\n secp: &Secp256k1<C>,\n script_pubkey: &Script,\n range: Range<u32>\n) -> Result<Option<(u32, Descriptor<PublicKey>)>, ConversionError>
    where\n C: Verification,

    Utility method for deriving the descriptor at each index in a range to find one matching\nscript_pubkey.

    \n

    If it finds a match then it returns the index it was derived at and the concrete\ndescriptor at that index. If the descriptor is non-derivable then it will simply check the\nscript pubkey against the descriptor and return it if it matches (in this case the index\nreturned will be meaningless).

    \n

    pub fn is_multipath(&self) -> bool

    Whether this descriptor contains a key that has multiple derivation paths.

    \n

    pub fn into_single_descriptors(\n self\n) -> Result<Vec<Descriptor<DescriptorPublicKey>>, Error>

    Get as many descriptors as different paths in this descriptor.

    \n

    For multipath descriptors it will return as many descriptors as there is\n“parallel” paths. For regular descriptors it will just return itself.

    \n
    ",0,"bdk_wallet::descriptor::ExtendedDescriptor"],["
    §

    impl<Pk> Descriptor<Pk>
    where\n Pk: MiniscriptKey + ToPublicKey,

    pub fn address(&self, network: Network) -> Result<Address, Error>

    Computes the Bitcoin address of the descriptor, if one exists

    \n

    Some descriptors like pk() don’t have an address.

    \n
    §Errors
    \n

    For raw/bare descriptors that don’t have an address.

    \n

    pub fn script_pubkey(&self) -> ScriptBuf

    Computes the scriptpubkey of the descriptor.

    \n

    pub fn unsigned_script_sig(&self) -> ScriptBuf

    Computes the scriptSig that will be in place for an unsigned input\nspending an output with this descriptor. For pre-segwit descriptors,\nwhich use the scriptSig for signatures, this returns the empty script.

    \n

    This is used in Segwit transactions to produce an unsigned transaction\nwhose txid will not change during signing (since only the witness data\nwill change).

    \n

    pub fn explicit_script(&self) -> Result<ScriptBuf, Error>

    Computes the the underlying script before any hashing is done. For\nBare, Pkh and Wpkh this is the scriptPubkey; for ShWpkh and Sh\nthis is the redeemScript; for the others it is the witness script.

    \n
    §Errors
    \n

    If the descriptor is a taproot descriptor.

    \n

    pub fn script_code(&self) -> Result<ScriptBuf, Error>

    Computes the scriptCode of a transaction output.

    \n

    The scriptCode is the Script of the previous transaction output being\nserialized in the sighash when evaluating a CHECKSIG & co. OP code.

    \n
    §Errors
    \n

    If the descriptor is a taproot descriptor.

    \n

    pub fn get_satisfaction<S>(\n &self,\n satisfier: S\n) -> Result<(Vec<Vec<u8>>, ScriptBuf), Error>
    where\n S: Satisfier<Pk>,

    Returns satisfying non-malleable witness and scriptSig to spend an\noutput controlled by the given descriptor if it possible to\nconstruct one using the satisfier S.

    \n

    pub fn get_satisfaction_mall<S>(\n &self,\n satisfier: S\n) -> Result<(Vec<Vec<u8>>, ScriptBuf), Error>
    where\n S: Satisfier<Pk>,

    Returns a possilbly mallable satisfying non-malleable witness and scriptSig to spend an\noutput controlled by the given descriptor if it possible to\nconstruct one using the satisfier S.

    \n

    pub fn satisfy<S>(&self, txin: &mut TxIn, satisfier: S) -> Result<(), Error>
    where\n S: Satisfier<Pk>,

    Attempts to produce a non-malleable satisfying witness and scriptSig to spend an\noutput controlled by the given descriptor; add the data to a given\nTxIn output.

    \n
    ",0,"bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    pub fn new_pk(pk: Pk) -> Descriptor<Pk>

    Create a new pk descriptor

    \n

    pub fn new_pkh(pk: Pk) -> Result<Descriptor<Pk>, Error>

    Create a new PkH descriptor

    \n

    pub fn new_wpkh(pk: Pk) -> Result<Descriptor<Pk>, Error>

    Create a new Wpkh descriptor\nWill return Err if uncompressed key is used

    \n

    pub fn new_sh_wpkh(pk: Pk) -> Result<Descriptor<Pk>, Error>

    Create a new sh wrapped wpkh from Pk.\nErrors when uncompressed keys are supplied

    \n

    pub fn new_sh(ms: Miniscript<Pk, Legacy>) -> Result<Descriptor<Pk>, Error>

    Create a new sh for a given redeem script\nErrors when miniscript exceeds resource limits under p2sh context\nor does not type check at the top level

    \n

    pub fn new_wsh(ms: Miniscript<Pk, Segwitv0>) -> Result<Descriptor<Pk>, Error>

    Create a new wsh descriptor from witness script\nErrors when miniscript exceeds resource limits under p2sh context\nor does not type check at the top level

    \n

    pub fn new_sh_wsh(ms: Miniscript<Pk, Segwitv0>) -> Result<Descriptor<Pk>, Error>

    Create a new sh wrapped wsh descriptor with witness script\nErrors when miniscript exceeds resource limits under wsh context\nor does not type check at the top level

    \n

    pub fn new_bare(ms: Miniscript<Pk, BareCtx>) -> Result<Descriptor<Pk>, Error>

    Create a new bare descriptor from witness script\nErrors when miniscript exceeds resource limits under bare context\nor does not type check at the top level

    \n

    pub fn new_sh_with_wpkh(wpkh: Wpkh<Pk>) -> Descriptor<Pk>

    Create a new sh wrapper for the given wpkh descriptor

    \n

    pub fn new_sh_with_wsh(wsh: Wsh<Pk>) -> Descriptor<Pk>

    Create a new sh wrapper for the given wsh descriptor

    \n

    pub fn new_sh_sortedmulti(\n k: usize,\n pks: Vec<Pk>\n) -> Result<Descriptor<Pk>, Error>

    Create a new sh sortedmulti descriptor with threshold k\nand Vec of pks.\nErrors when miniscript exceeds resource limits under p2sh context

    \n

    pub fn new_sh_wsh_sortedmulti(\n k: usize,\n pks: Vec<Pk>\n) -> Result<Descriptor<Pk>, Error>

    Create a new sh wrapped wsh sortedmulti descriptor from threshold\nk and Vec of pks\nErrors when miniscript exceeds resource limits under segwit context

    \n

    pub fn new_wsh_sortedmulti(\n k: usize,\n pks: Vec<Pk>\n) -> Result<Descriptor<Pk>, Error>

    Create a new wsh sorted multi descriptor\nErrors when miniscript exceeds resource limits under p2sh context

    \n

    pub fn new_tr(\n key: Pk,\n script: Option<TapTree<Pk>>\n) -> Result<Descriptor<Pk>, Error>

    Create new tr descriptor\nErrors when miniscript exceeds resource limits under Tap context

    \n

    pub fn desc_type(&self) -> DescriptorType

    Get the [DescriptorType] of Descriptor

    \n

    pub fn sanity_check(&self) -> Result<(), Error>

    Checks whether the descriptor is safe.

    \n

    Checks whether all the spend paths in the descriptor are possible on the\nbitcoin network under the current standardness and consensus rules. Also\nchecks whether the descriptor requires signatures on all spend paths and\nwhether the script is malleable.

    \n

    In general, all the guarantees of miniscript hold only for safe scripts.\nThe signer may not be able to find satisfactions even if one exists.

    \n

    pub fn max_weight_to_satisfy(&self) -> Result<Weight, Error>

    Computes an upper bound on the difference between a non-satisfied\nTxIn’s segwit_weight and a satisfied TxIn’s segwit_weight

    \n

    Since this method uses segwit_weight instead of legacy_weight,\nif you want to include only legacy inputs in your transaction,\nyou should remove 1WU from each input’s max_weight_to_satisfy\nfor a more accurate estimate.

    \n

    In other words, for segwit inputs or legacy inputs included in\nsegwit transactions, the following will hold for each input if\nthat input was satisfied with the largest possible witness:

    \n\n
    for i in 0..transaction.input.len() {\n    assert_eq!(\n        descriptor_for_input[i].max_weight_to_satisfy(),\n        transaction.input[i].segwit_weight() - TxIn::default().segwit_weight()\n    );\n}
    \n

    Instead, for legacy transactions, the following will hold for each input\nif that input was satisfied with the largest possible witness:

    \n\n
    for i in 0..transaction.input.len() {\n    assert_eq!(\n        descriptor_for_input[i].max_weight_to_satisfy(),\n        transaction.input[i].legacy_weight() - TxIn::default().legacy_weight()\n    );\n}
    \n

    Assumes all ECDSA signatures are 73 bytes, including push opcode and\nsighash suffix.\nAssumes all Schnorr signatures are 66 bytes, including push opcode and\nsighash suffix.

    \n
    §Errors
    \n

    When the descriptor is impossible to safisfy (ex: sh(OP_FALSE)).

    \n

    pub fn max_satisfaction_weight(&self) -> Result<usize, Error>

    👎Deprecated since 10.0.0: Use max_weight_to_satisfy instead. The method to count bytes was redesigned and the results will differ from max_weight_to_satisfy. For more details check rust-bitcoin/rust-miniscript#476.

    Computes an upper bound on the weight of a satisfying witness to the\ntransaction.

    \n

    Assumes all ec-signatures are 73 bytes, including push opcode and\nsighash suffix. Includes the weight of the VarInts encoding the\nscriptSig and witness stack length.

    \n
    §Errors
    \n

    When the descriptor is impossible to safisfy (ex: sh(OP_FALSE)).

    \n
    ",0,"bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl DescriptorExt for Descriptor<DescriptorPublicKey>

    §

    fn dust_value(&self) -> u64

    Returns the minimum value (in satoshis) at which an output is broadcastable.\nPanics if the descriptor wildcard is hardened.
    §

    fn descriptor_id(&self) -> DescriptorId

    Returns the descriptor id, calculated as the sha256 of the descriptor, checksum not\nincluded.
    ","DescriptorExt","bdk_wallet::descriptor::ExtendedDescriptor"],["
    §

    impl<'de, Pk> Deserialize<'de> for Descriptor<Pk>
    where\n Pk: FromStrKey,

    §

    fn deserialize<D>(\n deserializer: D\n) -> Result<Descriptor<Pk>, <D as Deserializer<'de>>::Error>
    where\n D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    ","Deserialize<'de>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> Display for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

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

    Formats the value using the given formatter. Read more
    ","Display","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    source§

    impl ExtractPolicy for Descriptor<DescriptorPublicKey>

    source§

    fn extract_policy(\n &self,\n signers: &SignersContainer,\n build_sat: BuildSatisfaction<'_>,\n secp: &Secp256k1<All>\n) -> Result<Option<Policy>, Error>

    Extract the spending policy
    ","ExtractPolicy","bdk_wallet::descriptor::ExtendedDescriptor"],["
    §

    impl<Pk> ForEachKey<Pk> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn for_each_key<'a, F>(&'a self, pred: F) -> bool
    where\n F: FnMut(&'a Pk) -> bool,

    Run a predicate on every key in the descriptor, returning whether\nthe predicate returned true for every key
    §

    fn for_any_key<'a, F>(&'a self, pred: F) -> bool
    where\n F: FnMut(&'a Pk) -> bool,\n Pk: 'a,

    Run a predicate on every key in the descriptor, returning whether\nthe predicate returned true for any key
    ","ForEachKey","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> From<Bare<Pk>> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn from(inner: Bare<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    ","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> From<Pkh<Pk>> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn from(inner: Pkh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    ","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> From<Sh<Pk>> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn from(inner: Sh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    ","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> From<Tr<Pk>> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn from(inner: Tr<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    ","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> From<Wpkh<Pk>> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn from(inner: Wpkh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    ","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> From<Wsh<Pk>> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn from(inner: Wsh<Pk>) -> Descriptor<Pk>

    Converts to this type from the input type.
    ","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> FromStr for Descriptor<Pk>
    where\n Pk: FromStrKey,

    §

    type Err = Error

    The associated error which can be returned from parsing.
    §

    fn from_str(s: &str) -> Result<Descriptor<Pk>, Error>

    Parses a string s to return a value of this type. Read more
    ","FromStr","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> FromTree for Descriptor<Pk>
    where\n Pk: FromStrKey,

    §

    fn from_tree(top: &Tree<'_>) -> Result<Descriptor<Pk>, Error>

    Parse an expression tree into a descriptor.

    \n
    ","FromTree","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> Hash for Descriptor<Pk>
    where\n Pk: Hash + MiniscriptKey,

    §

    fn hash<__H>(&self, state: &mut __H)
    where\n __H: Hasher,

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where\n H: Hasher,\n Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    ","Hash","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> Liftable<Pk> for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    fn lift(&self) -> Result<Policy<Pk>, Error>

    Converts this object into an abstract policy.
    ","Liftable","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> Ord for Descriptor<Pk>
    where\n Pk: Ord + MiniscriptKey,

    §

    fn cmp(&self, other: &Descriptor<Pk>) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Self
    where\n Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · source§

    fn min(self, other: Self) -> Self
    where\n Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · source§

    fn clamp(self, min: Self, max: Self) -> Self
    where\n Self: Sized + PartialOrd,

    Restrict a value to a certain interval. Read more
    ","Ord","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> PartialEq for Descriptor<Pk>
    where\n Pk: PartialEq + MiniscriptKey,

    §

    fn eq(&self, other: &Descriptor<Pk>) -> 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_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> PartialOrd for Descriptor<Pk>
    where\n Pk: PartialOrd + MiniscriptKey,

    §

    fn partial_cmp(&self, other: &Descriptor<Pk>) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

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

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

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

    This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
    1.0.0 · source§

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

    This method tests greater than (for self and other) and is used by the > operator. Read more
    1.0.0 · source§

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

    This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
    ","PartialOrd","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<'de, Pk> Serialize for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    §

    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_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<P, Q> TranslatePk<P, Q> for Descriptor<P>
    where\n P: MiniscriptKey,\n Q: MiniscriptKey,

    §

    fn translate_pk<T, E>(\n &self,\n t: &mut T\n) -> Result<<Descriptor<P> as TranslatePk<P, Q>>::Output, TranslateErr<E>>
    where\n T: Translator<P, Q, E>,

    Converts a descriptor using abstract keys to one using specific keys.

    \n
    §

    type Output = Descriptor<Q>

    The associated output type. This must be Self<Q>.
    ","TranslatePk","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> Eq for Descriptor<Pk>
    where\n Pk: Eq + MiniscriptKey,

    ","Eq","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
    §

    impl<Pk> StructuralPartialEq for Descriptor<Pk>
    where\n Pk: MiniscriptKey,

    ","StructuralPartialEq","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"]] };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/examples/index.html b/examples/index.html index a808a3076f..cea8c493d7 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.

    Last Updated: 6/12/2024, 12:38:52 AM
    - + diff --git a/foundation/about/index.html b/foundation/about/index.html index b9cf90aba4..bbdcb280ce 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 471fc82f0f..4752a45174 100644 --- a/foundation/grantees/index.html +++ b/foundation/grantees/index.html @@ -29,7 +29,7 @@ - + @@ -82,6 +82,6 @@
    - + diff --git a/foundation/grants/index.html b/foundation/grants/index.html index 3f4f549cb5..2897ee6b3d 100644 --- a/foundation/grants/index.html +++ b/foundation/grants/index.html @@ -29,7 +29,7 @@ - + @@ -78,6 +78,6 @@
    - + diff --git a/foundation/index.html b/foundation/index.html index 9cf6914e4c..c1328535a1 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 b0e7073b11..934169fedc 100644 --- a/foundation/supporters/index.html +++ b/foundation/supporters/index.html @@ -29,7 +29,7 @@ - + @@ -113,6 +113,6 @@
    - + diff --git a/getting-started/index.html b/getting-started/index.html index f704b524a9..3f4f4f9665 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).

    Last Updated: 6/12/2024, 12:38:52 AM

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

    - + diff --git a/index.html b/index.html index 2fc39b0ed0..a232ab693c 100644 --- a/index.html +++ b/index.html @@ -29,7 +29,7 @@ - + @@ -80,6 +80,6 @@
    - + diff --git a/sitemap.xml b/sitemap.xml index cbdda557c0..2f5559b619 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -https://bitcoindevkit.org/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/_2023-q4-update/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/_2024-q1-update/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/bitcoin-core-rpc-demo/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/bdk-cli-basics/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/bdk-cli-basics-multisig-2of3/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/bdk-core-pt1/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/bdk-rn-making-of/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/bdk-with-tor/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/bindings-scope/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/compact-filters-demo/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/descriptors-in-the-wild/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/descriptor-based-paper-wallet/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/exploring-bdk-flutter/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/exploring-bdk-rn/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-3/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-2/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/2020/12/hello-world/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/getting-started-with-rust-hwi/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/hidden-power-of-bitcoin/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/improving-coin-selection-in-bdk/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/miniscript-vulnerability/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/2020/12/release-v0.2.0/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/release-v0.3.0/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/2021/03/release-v0.5.0/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/2021/02/release-v0.4.0/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/2021/05/release-v0.7.0/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/2021/04/release-v0.6.0/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/2021/06/release-v0.8.0/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/2021/07/release-v0.9.0/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/road-to-bdk-1/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/spending-policy-demo/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/using-bdk-with-hardware-wallets/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/adoption/all/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/adoption/custodial/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/adoption/desktop/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/blog/why-bindings/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/adoption/exchange/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/adoption/hardware/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/adoption/infrastructure/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/adoption/mobile/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/bdk-cli/compiler/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/bdk-cli/concept/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/adoption/web/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/bdk-cli/installation/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/bdk-cli/interface/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/bdk-cli/introduction/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/bdk-cli/playground/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/bdk-cli/regtest/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/descriptors/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/case-studies/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/foundation/about/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/examples/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/foundation/grantees/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/foundation/grants/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/foundation/supporters/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/getting-started/2024-06-12T00:38:52.000Zdailyhttps://bitcoindevkit.org/foundation/2024-06-12T00:38:52.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/multi-sig/dailyhttps://bitcoindevkit.org/blog/tags/architecture/dailyhttps://bitcoindevkit.org/blog/tags/BDK-RN/dailyhttps://bitcoindevkit.org/blog/tags/Development/dailyhttps://bitcoindevkit.org/blog/tags/Architecture/dailyhttps://bitcoindevkit.org/blog/tags/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/getting%20started/dailyhttps://bitcoindevkit.org/blog/tags/rust/dailyhttps://bitcoindevkit.org/blog/tags/Hardware%20Wallets/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/Bitcoin%20Zavior/dailyhttps://bitcoindevkit.org/blog/author/rorp/dailyhttps://bitcoindevkit.org/blog/author/thunderbiscuit/dailyhttps://bitcoindevkit.org/blog/author/Gabriele%20Domenichini/dailyhttps://bitcoindevkit.org/blog/author/Riccardo%20Casatta/dailyhttps://bitcoindevkit.org/blog/author/Alekos%20Filini/dailyhttps://bitcoindevkit.org/blog/author/Wszdexdrf/dailyhttps://bitcoindevkit.org/blog/author/Sandipan%20Dey/dailyhttps://bitcoindevkit.org/blog/author/C%C3%A9sar%20Alvarez%20Vallero/dailyhttps://bitcoindevkit.org/blog/page/2/dailyhttps://bitcoindevkit.org/blog/page/3/dailyhttps://bitcoindevkit.org/blog/page/4/dailyhttps://bitcoindevkit.org/blog/author/Alekos%20Filini/page/2/daily \ No newline at end of file +https://bitcoindevkit.org/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/_2023-q4-update/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/_2024-q1-update/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/bitcoin-core-rpc-demo/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/bdk-core-pt1/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/bdk-cli-basics/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/bdk-cli-basics-multisig-2of3/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/bdk-rn-making-of/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/bdk-with-tor/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/bindings-scope/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/compact-filters-demo/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/descriptor-based-paper-wallet/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/descriptors-in-the-wild/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/exploring-bdk-rn/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/exploring-bdk-flutter/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-2/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-3/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/2020/12/hello-world/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/getting-started-with-rust-hwi/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/improving-coin-selection-in-bdk/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/hidden-power-of-bitcoin/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/miniscript-vulnerability/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/2020/12/release-v0.2.0/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/2021/01/release-v0.3.0/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/2021/02/release-v0.4.0/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/2021/03/release-v0.5.0/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/2021/06/release-v0.8.0/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/2021/04/release-v0.6.0/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/2021/05/release-v0.7.0/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/2021/07/release-v0.9.0/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/spending-policy-demo/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/road-to-bdk-1/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/using-bdk-with-hardware-wallets/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/blog/why-bindings/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/adoption/all/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/adoption/custodial/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/adoption/desktop/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/adoption/exchange/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/adoption/hardware/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/adoption/mobile/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/adoption/web/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/bdk-cli/compiler/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/adoption/infrastructure/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/bdk-cli/concept/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/bdk-cli/interface/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/bdk-cli/introduction/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/bdk-cli/installation/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/bdk-cli/playground/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/bdk-cli/regtest/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/case-studies/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/examples/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/descriptors/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/foundation/grantees/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/foundation/about/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/foundation/supporters/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/foundation/grants/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/foundation/2024-06-13T04:15:03.000Zdailyhttps://bitcoindevkit.org/getting-started/2024-06-13T04:15:03.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/architecture/dailyhttps://bitcoindevkit.org/blog/tags/bdk-cli/dailyhttps://bitcoindevkit.org/blog/tags/basics/dailyhttps://bitcoindevkit.org/blog/tags/novice/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/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/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/Flutter/dailyhttps://bitcoindevkit.org/blog/tags/taproot/dailyhttps://bitcoindevkit.org/blog/tags/miniscript/dailyhttps://bitcoindevkit.org/blog/tags/getting%20started/dailyhttps://bitcoindevkit.org/blog/tags/rust/dailyhttps://bitcoindevkit.org/blog/tags/Hardware%20Wallets/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/bitcoin-cli/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/Lloyd%20Fournier/dailyhttps://bitcoindevkit.org/blog/author/waterst0ne/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/C%C3%A9sar%20Alvarez%20Vallero/dailyhttps://bitcoindevkit.org/blog/author/Sandipan%20Dey/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